You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/SeanInfo/SeanCtnList.aspx.cs

607 lines
31 KiB
C#

2 years ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DSWeb.Models;
using System.Data;
using DSWeb.EntityDA;
using System.Web.UI.HtmlControls;
namespace DSWeb.SeanInfo
{
public partial class SeanCtnList : System.Web.UI.Page
{
public string strUserID = "";//登录用户GID
public string strCompanyID = "";//公司GID
public string strShowName = "";//用户显示名
public string strDeptName = "";//部门名称
string loadgood = "";
string sendgood = "";
DSWeb.EntityDA.Opsean opseaDA = new EntityDA.Opsean();
Models.OpseanEntity opseaEntity = new OpseanEntity();
OpCtnTruckEntity opctnTruckEntity = new OpCtnTruckEntity();
protected void Page_Load(object sender, EventArgs e)
{
if (Session["USERID"] != null)
{
strUserID = Session["USERID"].ToString();
//this.hdUserID.Value = strUserID;
}
else
{
Server.Transfer("~/Error/FriendError.aspx");
return;
}
if (Session["SHOWNAME"] != null)
{
strShowName = Session["SHOWNAME"].ToString();
}
if (Session["COMPANYID"] != null)
{
strCompanyID = Session["COMPANYID"].ToString();
this.hid_comanyid.Value = strCompanyID;
}
if (Session["DEPTNAME"] != null)
{
strDeptName = Session["DEPTNAME"].ToString();
}
if (!this.IsPostBack)
{
this.LoadPageInfo();
this.hid_comanyid.Value = strCompanyID;
}
//this.gridViewAddAttri();
}
/// <summary>
/// 加载页面时需要加载的信息类别
/// </summary>
public void LoadPageInfo()
{
if (Request.QueryString["handdle"] != "")
{
if (Request.QueryString["handdle"] == "oneEdit")//加载一项编辑信息
{
string ID = Request.QueryString["id"].ToString().Trim();
this.GetOneEdit(ID, strCompanyID);
this.gridViewAddAttri();
this.LoadTeamTruck();
this.drop_TRUCK.SelectedValue = MenuTeamTruck(ID);
}
if (Request.QueryString["handdle"] == "moreEdit")
{
string[] ID = Request.QueryString["id"].ToString().Trim().Split(',');
this.LoadMoreEditInfo(ID, strCompanyID);
this.gridViewAddAttri();
this.LoadTeamTruck();
this.span_Status.InnerText = "多项编辑";
}
if (Request.QueryString["handdle"] == "addItem")
{
//this.addNewLetterTruck();
//this.gridViewAddAttri();
rad_loadGood.Checked = true;
this.LoadTeamTruck();
this.GetSearchInfo();
this.rad_loadGood.Checked = true;
this.span_Status.InnerText = "装货";
this.img_PrintLetterTruck.Enabled = false;
this.img_PrintLetterTruck.ToolTip = "打印受限";
}
}
}
/// <summary>
/// 承运车队信息
/// </summary>
public void LoadTeamTruck()
{
DataTable table = opseaDA.GetTeamInfo(strCompanyID);
if (table != null)
{
this.drop_TRUCK.DataSource = table.DefaultView;
this.drop_TRUCK.DataTextField = "NewColumns";
this.drop_TRUCK.DataValueField = "SHORTNAME";
this.drop_TRUCK.DataBind();
}
ListItem list = new ListItem("--请选择车队--","");
this.drop_TRUCK.Items.Insert(0,list);
}
/// <summary>
/// 获得某个派车的承运车队
/// </summary>
/// <param name="leid"></param>
/// <returns></returns>
public string MenuTeamTruck(string leid)
{
string strteam = opseaDA.GetMenuTruckByLeid(leid);
return strteam;
}
/// <summary>
/// 公共消息提示
/// </summary>
/// <param name="strtext"></param>
public void CommonMessageBox(string strtext)
{
this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + strtext + "')</script>");
}
/// <summary>
/// 创建先的派车通知单加载的信息
/// </summary>
public void addNewLetterTruck()
{
DataTable table = opseaDA.GetCtnEmptyInfo(strCompanyID);
PagedDataSource pds = new PagedDataSource();
pds.DataSource = table.DefaultView;
AspNetPager1.RecordCount = table.Rows.Count;
pds.AllowPaging = true;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
pds.PageSize = AspNetPager1.PageSize;
this.gridview_ctnlist.DataSource = pds;
this.gridview_ctnlist.DataKeyNames = new string[] { "CTN_ID" };
this.gridview_ctnlist.DataBind();
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
this.GetSearchInfo();
}
/// <summary>
/// 根据多项通知单id获得需要编辑的派车单信息
/// </summary>
public void LoadMoreEditInfo(string[] id,string companyid)
{
DataTable table = opseaDA.GetCtnEditInfo(id, companyid);
PagedDataSource pds = new PagedDataSource();
pds.DataSource = table.DefaultView;
AspNetPager1.RecordCount = table.Rows.Count;
pds.AllowPaging = true;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
pds.PageSize = AspNetPager1.PageSize;
this.gridview_ctnlist.DataSource = pds;
this.gridview_ctnlist.DataKeyNames = new string[] { "CTN_ID" };
this.gridview_ctnlist.DataBind();
}
/// <summary>
/// 加载一项编辑信息
/// </summary>
/// <param name="gid"></param>
/// <param name="companyid"></param>
public void GetOneEdit(string gid,string companyid)
{
DataTable table = opseaDA.GetOneEditIfno(gid,companyid);
string teamStatus = table.Rows[0]["TEAMTYPE"].ToString();
if (teamStatus == "0")
{
this.span_Status.InnerText = "装货";
}
else
{
this.span_Status.InnerText = "送货";
}
this.gridview_ctnlist.DataSource = table.DefaultView;
this.gridview_ctnlist.DataKeyNames = new string[] { "CTN_ID" };
this.gridview_ctnlist.DataBind();
}
/// <summary>
/// 限制已经生成派车单的集装箱再次派出
/// </summary>
public void gridViewAddAttri()
{
for (int i = 0; i < gridview_ctnlist.Rows.Count; i++)
{
Label labelteamStatus = (Label)gridview_ctnlist.Rows[i].FindControl("lab_teamStatus");
//CheckBox checboxItem = (CheckBox)gridview_ctnlist.Rows[i].Cells[0].FindControl("checkItems");
Label labisStatus = (Label)gridview_ctnlist.Rows[i].FindControl("lab_isTeamStatus");
LinkButton linkbtn = (LinkButton)gridview_ctnlist.Rows[i].FindControl("link_save");
string teamstatus = labelteamStatus.Text;
string isteamstatus = labisStatus.Text;
if (teamstatus != "")
{
//checboxItem.Checked = false;
//checboxItem.Enabled = false;
this.img_MakeLetterTruck.Enabled = false;
}
if (isteamstatus == "True")
{
linkbtn.Enabled = false;
linkbtn.ToolTip = "限制修改";
}
}
//int i = 0;//hang
//while (i < gridview_ctnlist.Rows.Count)
//{
// //while (j < gridview_ctnlist.Columns.Count)
// //{
// // //string idd=gridview_ctnlist.DataKeys[gridview_ctnlist.Rows[i].RowIndex].Value.ToString();
// // //gridview_ctnlist.Rows[i].Cells[j].Attributes.Add("onclick","return getTeamTruck("+idd+")");
// //}
//}
}
protected void gridview_ctnlist_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "saveInfo")
{
//string gid=e.CommandArgument.ToString().Split('|')[0];
//string ctnid=e.CommandArgument.ToString().Split('|')[1];
string ctnid=e.CommandArgument.ToString();
GridViewRow row = ((Control)e.CommandSource).BindingContainer as GridViewRow;
// Label lable_gid = (Label)row.FindControl("lab_ctnid");
HtmlInputHidden lable_gid = (HtmlInputHidden)row.FindControl("hidden_gid");
string gid = lable_gid.Value.ToString() ;
opctnTruckEntity.CTN_ID = ctnid;
opctnTruckEntity.GID = gid;
TextBox txtTruckNo = (TextBox)row.FindControl("txt_TRUCKNO");
opctnTruckEntity.TRUCKNO = txtTruckNo.Text.Trim();
TextBox txtDriver = (TextBox)row.FindControl("txt_DRIVER");
opctnTruckEntity.DRIVER = txtDriver.Text.Trim();
TextBox txtIdEntityCard = (TextBox)row.FindControl("txt_IDENTITYCARD");
opctnTruckEntity.IDENTITYCARD = txtIdEntityCard.Text.Trim();
TextBox txtMobile = (TextBox)row.FindControl("txt_MOBILE");
opctnTruckEntity.MOBILE = txtMobile.Text.Trim();
if (gid == "")//表示该集装箱尚未有任何操作--添加
{
bool result = opseaDA.InertNewCtnTruck(opctnTruckEntity,GetNewid());
if (result)
{
//this.addNewLetterTruck();
this.CommonMessageBox("添加成功");
}
else
{
this.CommonMessageBox("操作失败,请重试");
}
}
else
{
bool result = opseaDA.UpdateCtnTruck(opctnTruckEntity);//表示已经对该集装箱进行多操作--修改
if (result)
{
//this.addNewLetterTruck();
this.CommonMessageBox("修改成功");
}
else
{
this.CommonMessageBox("操作失败,请重试");
}
}
}
}
/// <summary>
/// 查询
/// </summary>
protected void GetSearchInfo()
{
string allsearch = txt_allsearch.Text.Trim();
if (this.rad_loadGood.Checked)
{
loadgood = "0";
}
if (this.rad_sendGood.Checked)
{
sendgood = "1";
}
DataTable table = opseaDA.GetSearchCtnTruckInfo(allsearch, loadgood, sendgood, strCompanyID);
PagedDataSource pds = new PagedDataSource();
pds.DataSource = table.DefaultView;
AspNetPager1.RecordCount = table.Rows.Count;
pds.AllowPaging = true;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
pds.PageSize = AspNetPager1.PageSize;
this.gridview_ctnlist.DataSource = pds;
this.gridview_ctnlist.DataKeyNames = new string[] { "CTN_ID" };
this.gridview_ctnlist.DataBind();
this.gridViewAddAttri();
}
protected void imgbtn_search_Click(object sender, ImageClickEventArgs e)
{
this.GetSearchInfo();
}
protected void gridview_ctnlist_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//string idd = gridview_ctnlist.DataKeys[e.Row.RowIndex].Value.ToString();
//e.Row.Cells[1].Attributes.Add("onclick", "return getTeamTruck('" + gridview_ctnlist.DataKeys[e.Row.RowIndex].Value.ToString() + "')");//单元格添加单击事件
//e.Row.Cells[2].Attributes.Add("onclick", "return getTeamTruck('" + gridview_ctnlist.DataKeys[e.Row.RowIndex].Value.ToString() + "')");//单元格添加单击事件
//e.Row.Cells[3].Attributes.Add("onclick", "return getTeamTruck('" + gridview_ctnlist.DataKeys[e.Row.RowIndex].Value.ToString() + "')");//单元格添加单击事件
//e.Row.Cells[4].Attributes.Add("onclick", "return getTeamTruck('" + gridview_ctnlist.DataKeys[e.Row.RowIndex].Value.ToString() + "')");//单元格添加单击事件
//e.Row.Cells[5].Attributes.Add("onclick", "return getTeamTruck('" + gridview_ctnlist.DataKeys[e.Row.RowIndex].Value.ToString() + "')");//单元格添加单击事件
//e.Row.Cells[6].Attributes.Add("onclick", "return getTeamTruck('" + gridview_ctnlist.DataKeys[e.Row.RowIndex].Value.ToString() + "')");//单元格添加单击事件
//e.Row.Cells[7].Attributes.Add("onclick", "return getTeamTruck('" + gridview_ctnlist.DataKeys[e.Row.RowIndex].Value.ToString() + "')");//单元格添加单击事件
//e.Row.Attributes.Add();
}
}
/// <summary>
/// [op_letter_truck]自动生成的newid主键
/// </summary>
/// <returns></returns>
protected String getBSNO()
{
string strBSNO = Guid.NewGuid().ToString();
strBSNO = strBSNO.Replace("-", "");
strBSNO = "TopLetterTruck" + strBSNO;
return strBSNO;
}
/// <summary>
/// [op_ctn_truck]自动生成的newid主键
/// </summary>
/// <returns></returns>
protected string GetNewid()
{
string strBSNO = Guid.NewGuid().ToString();
//strBSNO = strBSNO.Replace("-", "");
//strBSNO = "TopCtnTruck" + strBSNO;出现截断
return strBSNO;
}
protected void img_MakeLetterTruck_Click(object sender, ImageClickEventArgs e)
{
string truck = drop_TRUCK.SelectedValue.ToString();
string gid = "";
string newgid =GetNewid();
string le_id=getBSNO();
DateTime inputtime = DateTime.Now;
int teamtype =-1;
if (this.rad_loadGood.Checked)
{
teamtype = 0;
}
if(this.rad_sendGood.Checked)
{
teamtype = 1;
}
bool isTruckStatus = false;
string inputby = strShowName.ToString();
string ctnid="";
string ctntID = "";
for (int i = 0; i < gridview_ctnlist.Rows.Count; i++)
{
HtmlInputCheckBox checkitem = (HtmlInputCheckBox)gridview_ctnlist.Rows[i].Cells[0].FindControl("checkItems");
if (checkitem.Checked)
{
ctnid = gridview_ctnlist.DataKeys[i].Value.ToString();
HtmlInputHidden labelgid = (HtmlInputHidden)gridview_ctnlist.Rows[i].FindControl("hidden_gid");
opctnTruckEntity.CTN_ID = ctnid;
TextBox txtTruckNo = (TextBox)gridview_ctnlist.Rows[i].FindControl("txt_TRUCKNO");
opctnTruckEntity.TRUCKNO = txtTruckNo.Text.Trim();
TextBox txtDriver = (TextBox)gridview_ctnlist.Rows[i].FindControl("txt_DRIVER");
opctnTruckEntity.DRIVER = txtDriver.Text.Trim();
TextBox txtIdEntityCard = (TextBox)gridview_ctnlist.Rows[i].FindControl("txt_IDENTITYCARD");
opctnTruckEntity.IDENTITYCARD = txtIdEntityCard.Text.Trim();
TextBox txtMobile = (TextBox)gridview_ctnlist.Rows[i].FindControl("txt_MOBILE");
opctnTruckEntity.MOBILE = txtMobile.Text.Trim();
DataTable table=opseaDA.CountNumCtn(teamtype,ctnid);
if (table.Rows.Count==0)//判定该信息是否存在,不存在先执行添加
{
opseaDA.InertNewCtnTruck(opctnTruckEntity, newgid);//添加新的派车信息【op_ctn_truck】
gid += newgid + ",";
}
else//表示修改信息
{
if (labelgid.Value.Trim() != "")
{
opctnTruckEntity.GID = labelgid.Value.Trim();
gid += labelgid.Value.Trim() + ",";
}
else
{
opctnTruckEntity.GID = table.Rows[0]["GID"].ToString();
gid += table.Rows[0]["GID"] + ",";
}
opseaDA.UpdateCtnTruck(opctnTruckEntity);
}
ctntID = ctntID + ctnid + ",";
}
}
string[] ctn_ids = ctntID.Remove(ctntID.Length - 1, 1).Split(',');
bool results = opseaDA.GenerateMenuTruck(le_id, truck, inputtime, teamtype, isTruckStatus, inputby, ctn_ids);
if (results)
{
//this.addNewLetterTruck();
//this.gridViewAddAttri();
//this.LoadTeamTruck();
//this.rad_loadGood.Checked = true;
//this.span_Status.InnerText = "装货";
//this.CommonMessageBox("成功生成派车单");
string url = "SeanCtnList.aspx?id=" + le_id + "&handdle=oneEdit";
string entity = "height=700, width=1200, top=10,left=10, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no";
Response.Write("<script>window.open('" + url + "','','" + entity + "');window.parent.opener.location.href = window.parent.opener.location.href;window.close();</script>");
}
else
{
this.CommonMessageBox("操作失败,请重试");
}
}
protected void checkall_CheckedChanged1(object sender, EventArgs e)
{
CheckBox checkall = (CheckBox)gridview_ctnlist.HeaderRow.Cells[0].FindControl("checkall");
foreach (GridViewRow gvr in gridview_ctnlist.Rows)
{
HtmlInputCheckBox checkitem = (HtmlInputCheckBox)gvr.Cells[0].FindControl("checkItems");
if (checkall.Checked && checkall.Enabled == true)
{
checkitem.Checked = true;
}
else
{
checkitem.Checked = false;
}
}
}
#region 打印出口派车通知报表
/// <summary>
/// 打印出口派车通知报表
/// </summary>
/// <param name="tempUserID">用户GID</param>
/// <param name="tempBSNO">id编号</param>
/// <returns>返回JSON对象</returns>
private void PrintSeaeBusinessTruckReport(string tempUserID, string tempGID)
{
var typeName = "PrintLoadGoodsApplicationReport";
//string strResult = "";
//先获取用户所在的公司信息GID
CompanyEntity companyEntity = new CompanyEntity();
CompanyDA companyDA = new CompanyDA();
companyEntity = companyDA.GetCompanyByUserID(tempUserID);
if (companyEntity.GID != null)
{
strCompanyID = companyEntity.GID;
}
ReportDBSourceDA reportDBSourceDA = new ReportDBSourceDA();
ReportDBSourceEntity reportDBSourceEntity = new ReportDBSourceEntity();
reportDBSourceEntity = reportDBSourceDA.GetReportDBSourceByUserIDAndType(strUserID, "PrintLoadGoodsApplicationReport");
//如果有相似的值则直接获取
if (reportDBSourceEntity.GID != null)
{
reportDBSourceEntity.SqlString_1 = "select * from op_sean where bsno in (select distinct bsno from [op_ctn] A inner join [op_ctn_truck] B on A.ctn_id=B.ctn_id where gid='"+tempGID+"' )";
reportDBSourceEntity.SqlString_2 = "select * from [op_ctn_truck] where gid='"+tempGID+"'";
reportDBSourceEntity.SqlString_3 = "select LT.GID,CTN_ID,LT.LE_ID,LT.TEAMTYPE,LT.ISTEAMSTATUS,TRUCKNO,DRIVER,IDENTITYCARD,LT.MOBILE,INPUTBY,U.GID, U.USERNAME, U.CODENAME, U.PASSWORD, U.SHOWNAME, U.ENROLLTIME,"
+ "U.CREATEUSER, U.MODIFIEDUSER, U.MODIFIEDTIME,U.ISDELETED, U.ISDISABLE, U.DELETEUSER, U.DELETETIME,B.GID AS b_GID, B.USERID,B.COMPANYNAME, B.DEPTNAME, B.OFFICEPHONE,"
+ "B.HOMEPHONE, B.MOBILE, B.FAX, B.EMAIL1, B.EMAIL2, B.HOMEADDRESS, B.REMARK, B.CREATEUSER AS B_CREATEUSER, B.CREATETIME, B.MODIFIEDUSER AS B_MODIFIEDUSER, "
+ "B.MODIFIEDTIME AS B_MODIFIEDTIME, B.EMERGUSER, B.EMERGPHONE, B.EMERGEMAIL, B.POSTCODE, B.QQ, B.MSN,B.FINANCESOFTCODE,"
+ " B.SIGNATURE from (select GID,CTN_ID,L.LE_ID,L.TEAMTYPE,L.ISTEAMSTATUS,TRUCKNO,DRIVER,IDENTITYCARD,MOBILE,INPUTBY from [op_ctn_truck] L inner join [op_letter_truck] T on L.LE_ID=T.LE_ID WHERE GID='" + tempGID + "')LT "
+ "INNER JOIN [user] U ON LT.INPUTBY=U.SHOWNAME INNER JOIN user_baseinfo B ON U.GID=B.USERID "
+ "where U.ISDELETED=0 and U.ISDISABLE=0 AND LT.GID='"+tempGID+"'";//操作的基本信息
reportDBSourceEntity.SqlString_4 = "";
reportDBSourceEntity.SqlString_5 = "";
reportDBSourceEntity.SqlString_6 = "";
reportDBSourceEntity.SqlString_7 = "SELECT [user].USERNAME,[user].CODENAME,[user].PASSWORD,[user].SHOWNAME,[user].ENROLLTIME,[user].CREATEUSER,[user].MODIFIEDUSER, [user].MODIFIEDTIME, [user].ISDELETED, [user].ISDISABLE, user_baseinfo.GID,user_baseinfo.USERID,user_baseinfo.COMPANYNAME, user_baseinfo.DEPTNAME, user_baseinfo.OFFICEPHONE, user_baseinfo.HOMEPHONE, user_baseinfo.MOBILE, user_baseinfo.FAX, user_baseinfo.EMAIL1, user_baseinfo.EMAIL2, user_baseinfo.HOMEADDRESS, user_baseinfo.REMARK, user_baseinfo.EMERGUSER, user_baseinfo.EMERGPHONE,user_baseinfo.EMERGEMAIL, user_baseinfo.POSTCODE, user_baseinfo.QQ, user_baseinfo.MSN, user_baseinfo.FINANCESOFTCODE FROM [user] INNER JOIN user_baseinfo ON [user].GID = user_baseinfo.USERID where user_baseinfo.USERID='" + strUserID + "'";
reportDBSourceEntity.SqlString_8 = " SELECT * FROM [company] WHERE GID = '" + strCompanyID + "'";
int iTempStatus = reportDBSourceDA.UpdateReportSql(reportDBSourceEntity);
if (iTempStatus == 1)
{
//strResult = GetJosonResult(strCompanyID, reportDBSourceEntity.GID, strUserID);
this.loadhref(strCompanyID, typeName, reportDBSourceEntity.GID, strUserID);
}
else
{
//strResult = GetJosonResult("", "", "");
this.loadhref("", "", "", "");
}
}
else
{
reportDBSourceEntity.GID = Guid.NewGuid().ToString();
reportDBSourceEntity.ReportID = "";
reportDBSourceEntity.Name = "";
reportDBSourceEntity.Description = "";
reportDBSourceEntity.Type = "PrintLoadGoodsApplicationReport";
reportDBSourceEntity.CreateUser = strUserID;
reportDBSourceEntity.UserID = strUserID;
reportDBSourceEntity.SqlString_1 = "select * from op_sean where bsno in (select distinct bsno from [op_ctn] A inner join [op_ctn_truck] B on A.ctn_id=B.ctn_id where gid='" + tempGID + "' )";
reportDBSourceEntity.SqlString_2 = "select * from [op_ctn_truck] where gid='" + tempGID + "'";
reportDBSourceEntity.SqlString_3 = "select LT.GID,CTN_ID,LT.LE_ID,LT.TEAMTYPE,LT.ISTEAMSTATUS,TRUCKNO,DRIVER,IDENTITYCARD,LT.MOBILE,INPUTBY,U.GID, U.USERNAME, U.CODENAME, U.PASSWORD, U.SHOWNAME, U.ENROLLTIME,"
+ "U.CREATEUSER, U.MODIFIEDUSER, U.MODIFIEDTIME,U.ISDELETED, U.ISDISABLE, U.DELETEUSER, U.DELETETIME,B.GID AS b_GID, B.USERID,B.COMPANYNAME, B.DEPTNAME, B.OFFICEPHONE,"
+ "B.HOMEPHONE, B.MOBILE, B.FAX, B.EMAIL1, B.EMAIL2, B.HOMEADDRESS, B.REMARK, B.CREATEUSER AS B_CREATEUSER, B.CREATETIME, B.MODIFIEDUSER AS B_MODIFIEDUSER, "
+ "B.MODIFIEDTIME AS B_MODIFIEDTIME, B.EMERGUSER, B.EMERGPHONE, B.EMERGEMAIL, B.POSTCODE, B.QQ, B.MSN,B.FINANCESOFTCODE,"
+ " B.SIGNATURE from (select GID,CTN_ID,L.LE_ID,L.TEAMTYPE,L.ISTEAMSTATUS,TRUCKNO,DRIVER,IDENTITYCARD,MOBILE,INPUTBY from [op_ctn_truck] L inner join [op_letter_truck] T on L.LE_ID=T.LE_ID WHERE GID='" + tempGID + "')LT "
+ "INNER JOIN [user] U ON LT.INPUTBY=U.SHOWNAME INNER JOIN user_baseinfo B ON U.GID=B.USERID "
+ "where U.ISDELETED=0 and U.ISDISABLE=0 AND LT.GID='" + tempGID + "'";//操作的基本信息
reportDBSourceEntity.SqlString_4 = "";
reportDBSourceEntity.SqlString_5 = "";
reportDBSourceEntity.SqlString_6 = "";
reportDBSourceEntity.SqlString_7 = "SELECT [user].USERNAME,[user].CODENAME,[user].PASSWORD,[user].SHOWNAME,[user].ENROLLTIME,[user].CREATEUSER,[user].MODIFIEDUSER, [user].MODIFIEDTIME, [user].ISDELETED, [user].ISDISABLE, user_baseinfo.GID,user_baseinfo.USERID,user_baseinfo.COMPANYNAME, user_baseinfo.DEPTNAME, user_baseinfo.OFFICEPHONE, user_baseinfo.HOMEPHONE, user_baseinfo.MOBILE, user_baseinfo.FAX, user_baseinfo.EMAIL1, user_baseinfo.EMAIL2, user_baseinfo.HOMEADDRESS, user_baseinfo.REMARK, user_baseinfo.EMERGUSER, user_baseinfo.EMERGPHONE,user_baseinfo.EMERGEMAIL, user_baseinfo.POSTCODE, user_baseinfo.QQ, user_baseinfo.MSN, user_baseinfo.FINANCESOFTCODE FROM [user] INNER JOIN user_baseinfo ON [user].GID = user_baseinfo.USERID where user_baseinfo.USERID='" + strUserID + "'";
reportDBSourceEntity.SqlString_8 = " SELECT * FROM [company] WHERE GID = '" + strCompanyID + "'";
int iTempStatus = reportDBSourceDA.InsertReportDBSource(reportDBSourceEntity);
if (iTempStatus == 1)
{
//strResult = GetJosonResult(strCompanyID, reportDBSourceEntity.GID, strUserID);
this.loadhref(strCompanyID, typeName, reportDBSourceEntity.GID,strUserID);
}
else
{
//strResult = GetJosonResult("", "", "");
this.loadhref("", "", "", "");
}
}
}
protected void loadhref(string strCompanyID,string typename ,string gid, string struserid)
{
string url = "print://?comp=" + strCompanyID + "&type=" + typename + "&dbid=" + gid + "&uid=" + struserid;
Response.Write("<script language='javascript'>window.location=print://?comp=Comcab2d43f60454327af30a131fc1d3abd&type=PrintLoadGoodsApplicationReport&dbid=cdc97758-5ce0-4e90-b9d0-6ed661dbab47&uid=b775e6db-fa3b-40a2-8e38-a59b03125881;</script>");
}
#endregion
protected void img_PrintLetterTruck_Click(object sender, ImageClickEventArgs e)
{
//string GID = "";//
//string ctnid = "";//集装箱编号
//string isstatus="";
////foreach (GridViewRow row in gridview_ctnlist.Rows)
////{
//// CheckBox checkitem = (CheckBox)row.Cells[0].FindControl("checkItems");
//// Label labegid = (Label)row.FindControl("lab_ctnid");
//// Label labeisstauts = (Label)row.FindControl("lab_isTeamStatus");
//// if (checkitem.Checked && labegid.Text != "")
//// {
//// ctnid += gridview_ctnlist.DataKeys[row.RowIndex].Value.ToString() + ",";
//// GID = labegid.Text;
//// isstatus = labeisstauts.Text;
//// }
////}
//for(int i=0;i<gridview_ctnlist.Rows.Count;i++)
//{
// HtmlInputCheckBox checkitem = (HtmlInputCheckBox)gridview_ctnlist.Rows[i].Cells[0].FindControl("checkItems");
// //Label labegid = (Label)gridview_ctnlist.Rows[i].FindControl("lab_ctnid");
// HtmlInputHidden labegid = (HtmlInputHidden)gridview_ctnlist.Rows[i].FindControl("hidden_gid");
// Label labeisstauts = (Label)gridview_ctnlist.Rows[i].FindControl("lab_isTeamStatus");
// if (checkitem.Checked && labegid.Value != "")
// {
// ctnid += gridview_ctnlist.DataKeys[i].Value.ToString() + ",";
// GID = labegid.Value;
// isstatus = labeisstauts.Text;
// }
//}
////this.CommonMessageBox(ctnid.Length.ToString()+"_"+GID+"_"+isstatus);
//if (ctnid.Length < 37)
//{
// this.CommonMessageBox("您还没有选择打印项");
// return;
//}
//else if (ctnid.Length > 50)
//{
// this.CommonMessageBox("每次只能打印一项");
// return;
//}
//else if (isstatus != "True")
//{
// this.CommonMessageBox("此派车单尚未完成,不能打印");
// return;
//}
//this.PrintSeaeBusinessTruckReport(strUserID, GID);
}
/// <summary>
/// 转换checkbox 的值
/// </summary>
/// <param name="str1"></param>
/// <param name="str2"></param>
/// <returns></returns>
protected string ComebineCtnAndGid(object str1,object str2)
{
string ctnid = Convert.ToString(str1);
string gid = Convert.ToString(str2);
string comebinestr = ctnid + "|" + gid;
return comebinestr;
}
}
}