private void BindDetail(string ID) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); string filter = string.Format("Flag=1 and {0}='{1}'", KeyField, ID); DataTable dt = dal.GetSubDetail(EnterpriseID, filter).Tables[0]; this.GridView2.DataSource = dt.DefaultView; this.GridView2.DataBind(); filter = string.Format("Flag=2 and {0}='{1}'", KeyField, ID); dt = dal.GetSubDetail(EnterpriseID, filter).Tables[0]; this.GridView3.DataSource = dt.DefaultView; this.GridView3.DataBind(); if (GridView2.Rows.Count != 0 && GridView3.Rows.Count != 0) { for (var i = 0; i < this.GridView2.Columns.Count; i++) { if (GridView2.Rows[0].Cells[i].Text != GridView3.Rows[0].Cells[i].Text) { GridView2.Rows[0].Cells[i].ForeColor = System.Drawing.Color.Red; GridView3.Rows[0].Cells[i].ForeColor = System.Drawing.Color.Red; } } } }
private void BindData() { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dt = dal.GetSubDetail(EnterpriseID).Tables[0]; this.GridView1.DataSource = dt.DefaultView; this.GridView1.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString()); DataRow dr = dt.NewRow(); dr["Flag"] = Flag;//旗標 Flag=1 訂單 Flag=2 生產計劃單 dr["BillID"] = this.txtBillID.Text;//單號 if (this.txtBillDate.Text.Length > 0) dr["BillDate"] = this.txtBillDate.Text;//日期 dr["CustomerPO"] = this.txtCustomerPO.Text;//客戶PO dr["EnterpriseID"] = this.txtEnterpriseID.Text;//企業用戶編號 dr["EnterpriseName"] = this.txtEnterpriseName.Text;//企業用戶名稱 dr["Contact"] = this.txtContact.Text;//連絡人員 dr["ContactPhone"] = this.txtContactPhone.Text;//聯絡電話 dr["Fax"] = this.txtFax.Text;//公司傳真 dr["BusPersonID"] = this.txtBusPersonID.Text;//業務員編號 dr["BusPersonName"] = this.txtBusPersonName.Text;//業務員姓名 dr["BillState"] = ddlBillState.SelectedIndex;//單況 0:有效 1:結案 dr["DeliverCountry"] = this.txtDeliverCountry.Text;//送貨地址國別 dr["DeliverAddress"] = this.txtDeliverAddress.Text;//送貨地址 dr["DeliverMehtod"] = this.txtDeliverMehtod.Text;//交貨方式 dr["Memo"] = this.txtMemo.Text;//備註 //dr["TotalPages"] = int.Parse(this.txtTotalPages.Text);//張數合計 if (this.txtCreateDate.Text.Length > 0) dr["CreateDate"] = this.txtCreateDate.Text;//建檔日期 dr["CreateUserName"] = this.txtCreateUserName.Text;//建檔人員 if (this.txtLastModifyDate.Text.Length > 0) dr["LastModifyDate"] = this.txtLastModifyDate.Text;//異動日期 dr["LastModifyUserName"] = this.txtLastModifyUserName.Text;//異動人員 if (this.txtBU_CheckDate.Text.Length > 0) dr["CheckDate"] = this.txtBU_CheckDate.Text;//營運覆核日期 dr["CheckUserName"] = this.txtBU_CheckUserName.Text;//營運覆核人員 if (ID.Length > 0) dal.Update(dr, ID); else dal.Add(dr); DataTable dtSub1 = dal.GetSubDetail("").Tables[0]; DataTable newdtb = Js.Com.JsonHelper.Json2Dtb(HdnSubDetail1.Value); for (int i = 0; i < newdtb.Rows.Count; i++) { DataRow dr1 = dtSub1.NewRow(); dr1["Flag"] = Flag; dr1["BillID"] = this.txtBillID.Text; dr1["EnterpriseID"] = this.txtEnterpriseID.Text; dr1["BillDate"] = this.txtBillDate.DateValue; for (int j = 0; j < newdtb.Columns.Count; j++) { dr1[newdtb.Columns[j].ColumnName] = newdtb.Rows[i][j]; } dtSub1.Rows.Add(dr1); } dtSub1.TableName = "LB_OrderSub"; dal.SaveDetail(dtSub1, ID); Response.Redirect("OrderView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtBillID.Text)); }
protected void btnSave_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString()); DataRow dr = dt.NewRow(); dr["BillID"] = this.txtBillID.Text;//單號 if (this.txtBillDate.Text.Length > 0) dr["BillDate"] = this.txtBillDate.Text;//日期 dr["StyleID"] = this.txtStyleID1.Value; dr["SourceBillID"] = this.txtSourceBillID.Text; dr["ProducePages"] = this.txtProducePages.Text; dr["StdPages"] = this.txtStdPages.Text; dr["Volumes"] = this.txtVolumes.Text; dr["StartLabelNo"] = this.txtStartLabelNo.Text; dr["EndLabelNo"] = this.txtEndLabelNo.Text; dr["ProductionUnitID"] = this.ddlProductionUnitID.SelectedValue; dr["ScheduleBillID"] = this.txtScheduleBillID.Text; if (this.txtPreInStockDate.Text.Length > 0) dr["PreInStockDate"] = this.txtPreInStockDate.Text; dr["BillState"] = this.ddlBillState.SelectedIndex; if (this.txtCreateDate.Text.Length > 0) dr["CreateDate"] = this.txtCreateDate.Text;//建檔日期 dr["CreateUserName"] = this.txtCreateUserName.Text;//建檔人員 dr["LastModifyDate"] = DateTime.Now;// this.txtLastModifyDate.Text;//異動日期 dr["LastModifyUserName"] = Session["User"].ToString();// this.txtLastModifyUserName.Text;//異動人員 if (this.txtCheckDate.Text.Length > 0) dr["CheckDate"] = this.txtCheckDate.Text;//營運覆核日期 dr["CheckUserName"] = this.txtCheckUserName.Text;//營運覆核用戶 dr["Memo"] = this.txtMemo.Text; if (ID.Length > 0) dal.Update(dr, ID); else dal.Add(dr); DataTable dtSub1 = dal.GetSubDetail("").Tables[0]; DataTable newdtb = Js.Com.JsonHelper.Json2Dtb(HdnSubDetail1.Value); for (int i = 0; i < newdtb.Rows.Count; i++) { DataRow dr1 = dtSub1.NewRow(); dr1["BillID"] = this.txtBillID.Text; //dr1["EnterpriseID"] = this.txtEnterpriseID.Text; dr1["BillDate"] = this.txtBillDate.DateValue; for (int j = 0; j < newdtb.Columns.Count; j++) { dr1[newdtb.Columns[j].ColumnName] = newdtb.Rows[i][j]; } dtSub1.Rows.Add(dr1); } dtSub1.TableName = "LB_ProductionSub"; dal.SaveDetail(dtSub1, ID); Response.Redirect("ProductionView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtBillID.Text)); }
protected void btnSave_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString()); DataRow dr = dt.NewRow(); dr["AnnounceID"] = this.txtAnnounceID.Text; dr["Announcer"] = this.txtAnnouncer.Text; if (this.txtAnnounceFlag.Text == Resources.Resource.AnnounceFlag1) dr["AnnounceFlag"] = 0; else dr["AnnounceFlag"] = 1; dr["AnnounceUnitNo"] = this.txtAnnounceUnitNo.Text; dr["AnnouncerUserName"] = this.txtAnnouncerUserName.Text; if (this.txtSource.Text == Resources.Resource.AnnounceSource1) dr["Source"] = 0; else dr["Source"] = 1; dr["AnnounceDate"] = DateTime.Now; dr["Title"] = this.txtTitle.Text.Trim(); dr["Contents"] = this.txtContents.Text.Trim(); dal.Add(dr); DataTable dtSub = dal.GetSubDetail("").Tables[0]; for (int i = 0; i < this.GridView1.Rows.Count; i++) { CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect")); if (cb.Checked) { DataRow subdr = dtSub.NewRow(); subdr["AnnounceID"] = this.txtAnnounceID.Text; subdr["ReceiverUserName"] = this.GridView1.Rows[i].Cells[1].Text; if (this.GridView1.Rows[i].Cells[2].Text == Resources.Resource.AnnounceFlag1) subdr["ReceiverFlag"] = 0; else subdr["ReceiverFlag"] = 1; subdr["ReceiveUnitNo"] = this.GridView1.Rows[i].Cells[3].Text; subdr["Receiver"] = this.GridView1.Rows[i].Cells[4].Text; dtSub.Rows.Add(subdr); } } dal.SaveDetail(dtSub, ""); Response.Redirect("AnnounceMessageView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtAnnounceID.Text)); }
protected void Page_Load(object sender, EventArgs e) { ID = Request.QueryString["ID"] + ""; FormID = Request.QueryString["FormID"] + ""; Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataTable dt = dal.GetRecord(string.Format(" BillID='{0}'", ID)); this.txtBillID.Text = ID; this.txtEnterpriseID.Text = "" + dt.Rows[0]["EnterpriseID"]; this.txtEnterpriseName.Text = "" + dt.Rows[0]["EnterpriseName"]; DataSet ds = dal.GetSubDetail(ID); //GridView1.DataSource = ds.Tables[0]; //GridView1.DataBind(); HdnSubDetail1.Value = Js.Com.JsonHelper.Dtb2Json(ds.Tables[0]); //ID="sub1xxRowID" Text="(序號), 40, label,1" InitSubCols(FormID, cnKey, subColsName1.ID, "LB_OrderSub"); //InitSubCols(subColsName2.ID, "LB_OrderSub1"); writeJsvar(FormID, cnKey, ID); }
//protected void btnLimitedProduct_Click(object sender, EventArgs e) //{ // //Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); // //DataTable dtSub1 = dal.GetSubDetail("").Tables[0]; // DataTable newdtb = Js.Com.JsonHelper.Json2Dtb(HdnSubDetail1.Value); // DataColumn dc; // dc = new DataColumn("ID", typeof(string)); // newdtb.Columns.Add(dc); // dc = new DataColumn("StyleID", typeof(string)); // newdtb.Columns.Add(dc); // dc = new DataColumn("EnterpriseID", typeof(string)); // newdtb.Columns.Add(dc); // for (int i = 0; i < newdtb.Rows.Count; i++) // { // newdtb.Rows[i]["ID"] = txtStyleID.Value; // newdtb.Rows[i]["StyleID"] = this.txtStyleID1.Text; // // newdtb.Rows[i]["EnterpriseID"] = this.txtEnterpriseID.Text; // } // newdtb.TableName = "LB_StyleSub"; // new Js.DAO.SubBaseDao(cnKey).Save(newdtb, " ID ='" + ID + "'"); // ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "Resize", "content_resize();initial();", true); //} protected void btnStylePages_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataTable dtSub1 = dal.GetSubDetail(this.txtStyleID.Text).Tables[0]; DataTable newdtb = Js.Com.JsonHelper.Json2Dtb(HdnSubDetail1.Value); for (int i = 0; i < newdtb.Rows.Count; i++) { DataRow dr1 = dtSub1.Rows[i]; for (int j = 0; j < newdtb.Columns.Count; j++) { dr1[newdtb.Columns[j].ColumnName] = newdtb.Rows[i][j]; } } dtSub1.TableName = "LB_WarehousePages"; dal.SaveDetail(dtSub1, this.txtStyleID.Text); }
protected void btnSave_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString()); DataRow dr = dt.NewRow(); dr["EnterpriseID"] = this.txtEnterpriseID.Text; dr["CategoryID"] = this.ddlCategoryID.SelectedValue.ToString(); dr["EnterpriseName"] = this.txtEnterpriseName.Text; dr["EnterpriseEName"] = this.txtEnterpriseEName.Text; dr["EnterpriseSName"] = this.txtEnterpriseSName.Text; dr["UnionID"] = this.txtUnionID.Text; //dr["LabelFrom"] = this.rbtLabelFromYes.Checked; dr["President"] = this.txtPresident.Text; //dr["PresidentPost"] = this.txtPresidentPost.Text; dr["Phone"] = this.txtPhone.Text; dr["Fax"] = this.txtFax.Text; //dr["Contact"] = this.txtContact.Text; //dr["ContactPost"] = this.txtContactPost.Text; //dr["ContactPhone"] = this.txtContactPhone.Text; //dr["CellPhone"] = this.txtCellPhone.Text; //dr["Email"] = this.txtEmail.Text; dr["WebUrl"] = this.txtWebUrl.Text; dr["Address"] = this.txtAddress.Text; dr["ZipNo"] = this.txtZipNo.Text; byte ServiceYears; byte.TryParse(this.txtServiceYears.Text.Trim(), out ServiceYears); this.txtServiceYears.Text = ServiceYears.ToString(); dr["ServiceYears"] = ServiceYears; dr["EnableMonths"] = byte.Parse(this.ddlEnableMonths.Text); dr["Memo"] = this.txtMemo.Text.Trim(); dr["CreateUserName"] = this.txtCreateUserName.Text; dr["CreateDate"] = this.txtCreateDate.Text; dr["LastModifyUserName"] = Session["User"].ToString(); dr["LastModifyDate"] = DateTime.Now.ToString(Js.Com.User.strDateFormat); dr["CheckUserName"] = this.txtCheckUserName.Text; if (this.txtCheckDate.Text.Length > 0) dr["CheckDate"] = this.txtCheckDate.Text; if (ID.Length > 0) { Js.BLL.BusinessUnit.EnterpriseDal edal = new Js.BLL.BusinessUnit.EnterpriseDal(); Js.Model.BusinessUnit.EnterpriseInfo model = edal.GetModel(ID); if (ServiceYears != model.ServiceYears || this.ddlEnableMonths.Text != model.EnableMonths.ToString()) { edal.InsertModifyRecord(ID, ServiceYears, byte.Parse(this.ddlEnableMonths.Text)); } dal.Update(dr, ID); } else dal.Add(dr); ////同步更新企業庫裡的這筆資料 //Js.BLL.BaseDal edal = new Js.BLL.BaseDal("EP_Enterprise", this.txtEnterpriseID.Text); //if (edal.Exists(this.txtEnterpriseID.Text)) // edal.Update(dr,ID); //else // edal.Add(dr); DataTable dtSub1 = dal.GetSubDetail("").Tables[0]; DataTable newdtb = Js.Com.JsonHelper.Json2Dtb(this.HdnSubDetail1.Value); for (int i = 0; i < newdtb.Rows.Count; i++) { DataRow subdr = dtSub1.NewRow(); subdr["EnterpriseID"] = this.txtEnterpriseID.Text; for (int j = 0; j < newdtb.Columns.Count; j++) { subdr[newdtb.Columns[j].ColumnName] = newdtb.Rows[i][j]; } if (ID.Length > 0) { subdr["LastModifyDate"] = DateTime.Now.ToString(Js.Com.User.strDateFormat); subdr["LastModifyUserName"] = Session["User"].ToString(); } else { subdr["CreateUserName"] = this.txtCreateUserName.Text; subdr["CreateDate"] = this.txtCreateDate.Text; subdr["LastModifyDate"] = DateTime.Now.ToString(Js.Com.User.strDateFormat); subdr["LastModifyUserName"] = Session["User"].ToString(); } dtSub1.Rows.Add(subdr); } dal.SaveDetail(dtSub1, ID); //dtSub1.TableName = "EP_EnterpriseLinkMan"; //edal.SaveDetail(dtSub1, ID); Response.Redirect("EnterpriseView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtEnterpriseID.Text)); }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { //this.txtFlag.SelectedIndex = int.Parse(dt.Rows[0]["Flag"].ToString());//旗標 this.txtBillID.Text = dt.Rows[0]["BillID"].ToString(); //上架單號 this.txtEnableDate.DateValue = (DateTime)dt.Rows[0]["EnableDate"]; //日期 this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); //企業用戶編號 this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); //企業用戶名稱 this.ddlBillState.SelectedIndex = int.Parse(dt.Rows[0]["BillState"].ToString());//狀態 0未上架、1異常待修正、2檢查OK、3上架中、4已上架 this.txtQtyTotal.Text = dt.Rows[0]["QtyTotal"].ToString( );//數量合計 this.txtCreateDate.Text = dt.Rows[0]["CreateDate"].ToString(); //建檔日期 this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); //建檔人員 this.txtLastModifyDate.Text = dt.Rows[0]["LastModifyDate"].ToString(); //異動日期 this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); //異動人員 this.txtEP_CheckDate.Text = dt.Rows[0]["EP_CheckDate"].ToString(); //建檔日期 this.txtEP_CheckUserName.Text = dt.Rows[0]["EP_CheckUserName"].ToString(); //營運覆核 this.txtBU_CheckDate.Text = dt.Rows[0]["BU_CheckDate"].ToString(); //營運覆核日期 this.txtBU_CheckUserName.Text = dt.Rows[0]["BU_CheckUserName"].ToString(); //營運覆核用戶 Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataSet ds = dal.GetSubDetail(dt.Rows[0]["BillID"].ToString()); HdnSubDetail1.Value = Js.Com.JsonHelper.Dtb2Json(ds.Tables[0]); } }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtBillID.Text = dt.Rows[0]["BillID"].ToString(); this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); if(bool.Parse(dt.Rows[0]["BillState"].ToString())) this.txtBillState.Text = "已執行"; else this.txtBillState.Text = "未執行"; this.txtQtyTotal.Text = dt.Rows[0]["QtyTotal"].ToString(); this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); this.txtCreateDate.Text = dt.Rows[0]["CreateDate"].ToString(); this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); this.txtLastModifyDate.Text = dt.Rows[0]["LastModifyDate"].ToString(); this.txtBU_CheckUserName.Text = dt.Rows[0]["BU_CheckUserName"].ToString(); if (this.txtBU_CheckUserName.Text.Length > 0) { this.btnEdit.Enabled = false; this.btnBUCheck.Text = Resources.Resource.BU_UnCheck; } else { this.btnEdit.Enabled = true; this.btnBUCheck.Text = Resources.Resource.BU_Check; } this.txtBU_CheckDate.Text = dt.Rows[0]["BU_CheckDate"].ToString(); this.txtEP_CheckUserName.Text = dt.Rows[0]["EP_CheckUserName"].ToString(); this.txtEP_CheckDate.Text = dt.Rows[0]["EP_CheckDate"].ToString(); Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataTable dtSub = dal.GetSubDetail(this.txtBillID.Text).Tables[0]; this.GridView1.DataSource = dtSub.DefaultView; this.GridView1.DataBind(); } ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "Resize", "content_resize();", true); }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); this.ddlCategoryID.SelectedValue = dt.Rows[0]["CategoryID"].ToString(); this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); this.txtEnterpriseEName.Text = dt.Rows[0]["EnterpriseEName"].ToString(); this.txtEnterpriseSName.Text = dt.Rows[0]["EnterpriseSName"].ToString(); this.txtUnionID.Text = dt.Rows[0]["UnionID"].ToString(); this.txtPresident.Text = dt.Rows[0]["President"].ToString(); this.txtPhone.Text = dt.Rows[0]["Phone"].ToString(); this.txtFax.Text = dt.Rows[0]["Fax"].ToString(); this.txtWebUrl.Text = dt.Rows[0]["WebUrl"].ToString(); this.txtServiceYears.Text = dt.Rows[0]["ServiceYears"].ToString(); this.ddlEnableMonths.Text = dt.Rows[0]["EnableMonths"].ToString(); this.txtAddress.Text = dt.Rows[0]["Address"].ToString(); this.txtZipNo.Text = dt.Rows[0]["ZipNo"].ToString(); this.txtMemo.Text = dt.Rows[0]["Memo"].ToString(); this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); this.txtCreateDate.Text = dt.Rows[0]["CreateDate"].ToString(); this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); this.txtLastModifyDate.Text = dt.Rows[0]["LastModifyDate"].ToString(); this.txtCheckUserName.Text = dt.Rows[0]["CheckUserName"].ToString(); this.txtCheckDate.Text = dt.Rows[0]["CheckDate"].ToString(); Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dtSub = dal.GetSubDetail(ID).Tables[0]; string sdtSub = Js.Com.JsonHelper.Dtb2Json(dtSub); this.HdnSubDetail1.Value = sdtSub; } }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { //this.txtFlag.SelectedIndex = int.Parse(dt.Rows[0]["Flag"].ToString());//旗標 Flag=1 訂單 Flag=2 生產計劃單 this.txtBillID.Text = dt.Rows[0]["BillID"].ToString(); //單號 this.txtBillDate.DateValue = (DateTime)dt.Rows[0]["BillDate"]; //日期 this.txtCustomerPO.Text = dt.Rows[0]["CustomerPO"].ToString(); //客戶PO this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); //企業用戶編號 this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); //企業用戶名稱 this.txtContact.Text = dt.Rows[0]["Contact"].ToString(); //連絡人員 this.txtContactPhone.Text = dt.Rows[0]["ContactPhone"].ToString(); //聯絡電話 this.txtFax.Text = dt.Rows[0]["Fax"].ToString(); //公司傳真 this.txtBusPersonID.Text = dt.Rows[0]["BusPersonID"].ToString(); //業務員編號 this.txtBusPersonName.Text = dt.Rows[0]["BusPersonName"].ToString(); //業務員姓名 this.ddlBillState.SelectedIndex = int.Parse(dt.Rows[0]["BillState"].ToString());//單況 0:有效 1:結案 this.txtDeliverCountry.Text = dt.Rows[0]["DeliverCountry"].ToString(); //送貨地址國別 this.txtDeliverAddress.Text = dt.Rows[0]["DeliverAddress"].ToString(); //送貨地址 this.txtDeliverMehtod.Text = dt.Rows[0]["DeliverMehtod"].ToString(); //交貨方式 this.txtMemo.Text = dt.Rows[0]["Memo"].ToString(); //備註 this.txtTotalPages.Text = string.Format("{0:N0}", dt.Rows[0]["TotalPages"]);//張數合計 this.txtCreateDate.Text = ToYMDHM(dt.Rows[0]["CreateDate"]); //建檔日期 this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); //建檔人員 this.txtLastModifyDate.Text = ToYMDHM(dt.Rows[0]["LastModifyDate"]); //異動日期 this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); //異動人員 this.txtBU_CheckDate.Text = ToYMDHM(dt.Rows[0]["CheckDate"]); //營運覆核日期 this.txtBU_CheckUserName.Text = dt.Rows[0]["CheckUserName"].ToString(); //營運覆核人員 Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataSet ds = dal.GetSubDetail(dt.Rows[0]["BillID"].ToString()); HdnSubDetail1.Value = Js.Com.JsonHelper.Dtb2Json(ds.Tables[0]); } }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dtSub = dal.GetSubDetail(this.txtEnterpriseID.Text).Tables[0]; if (dtSub.Rows.Count > 0) this.txtUploadDate.Text = Js.Com.PageValidate.ParseDateTime(dtSub.Rows[0]["UploadDate"].ToString()); else this.txtUploadDate.Text = ""; this.GridView1.DataSource = dtSub.DefaultView; this.GridView1.DataBind(); } ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "Resize", "content_resize2();", true); }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtBillID.Text = dt.Rows[0]["BillID"].ToString(); this.txtBillDate.DateValue = (DateTime)dt.Rows[0]["BillDate"]; this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); //企業用戶編號 this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); //企業用戶名稱 this.txtProduceBillID.Text = dt.Rows[0]["ProduceBillID"].ToString(); //單號 this.txtOrderBillID.Text = dt.Rows[0]["OrderBillID"].ToString(); //訂單單號 //this.txtOrderSubID.SelectedIndex = int.Parse(dt.Rows[0]["OrderSubID"].ToString());//訂單序號 this.txtStyleID.Text = dt.Rows[0]["StyleID"].ToString(); //款式編號 this.txtLabelMode.Text = dt.Rows[0]["LabelMode"].ToString(); //標籤模式 //this.txtRemainQty.Text = dt.Rows[0]["RemainQty"].ToString();//保留數量 this.txtRemainStartNo.Text = dt.Rows[0]["RemainStartNo"].ToString(); //保留起始序號 this.txtRemainEndNo.Text = dt.Rows[0]["RemainEndNo"].ToString(); //保留終止序號 this.txtQtyTotal.Text = dt.Rows[0]["QtyTotal"].ToString();//入庫張數合計 this.txtLabelReels.Text = dt.Rows[0]["LabelReels"].ToString();//標籤卷數合計 this.ckbIsNoDone.Checked = bool.Parse(dt.Rows[0]["IsNoDone"].ToString());//序號產生 this.ckbIsCheckImage.Checked = bool.Parse(dt.Rows[0]["IsCheckImage"].ToString());//圖檔檢查 //this.ckbIsConfirmBad.Checked = bool.Parse(dt.Rows[0]["IsConfirmBad"].ToString());//壞品確認 this.ckbIsImportImage.Checked = bool.Parse(dt.Rows[0]["IsImportImage"].ToString());//圖檔匯入 this.ckbIsInvalidBad.Checked = bool.Parse(dt.Rows[0]["IsInvalidBad"].ToString());//壞品作廢 this.txtInvalidBillID.Text = dt.Rows[0]["InvalidBillID"].ToString(); //作廢單號 RadioButton3.Checked = !bool.Parse(dt.Rows[0]["LabelFrom"].ToString()); RadioButton4.Checked = bool.Parse(dt.Rows[0]["LabelFrom"].ToString()); //this.ckbBillState.Checked = bool.Parse(dt.Rows[0]["BillState"].ToString());//入庫狀況 this.txtMemo.Text = dt.Rows[0]["Memo"].ToString(); //備註 this.txtCreateDate.Text = dt.Rows[0]["CreateDate"].ToString(); //建檔日期 this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); //建檔人員 this.txtLastModifyDate.Text = dt.Rows[0]["LastModifyDate"].ToString(); //異動日期 this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); //異動人員 //this.txtEP_CheckDate.Text = dt.Rows[0]["EP_CheckDate"].ToString(); //建檔日期 //this.txtEP_CheckUserName.Text = dt.Rows[0]["EP_CheckUserName"].ToString(); //營運覆核 this.txtBU_CheckDate.Text = dt.Rows[0]["BU_CheckDate"].ToString(); //營運覆核日期 this.txtBU_CheckUserName.Text = dt.Rows[0]["BU_CheckUserName"].ToString(); //營運覆核用戶 Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataSet ds = dal.GetSubDetail(dt.Rows[0]["BillID"].ToString()); HdnSubDetail1.Value = Js.Com.JsonHelper.Dtb2Json(ds.Tables[0]); } }
private void BindGrid() { Js.BLL.BaseDal bdal = new Js.BLL.BaseDal(FormID); DataTable dtSub = bdal.GetSubDetail("").Tables[0]; Js.BLL.Account.UserDal dal = new Js.BLL.Account.UserDal(); if (Session["UserType"].ToString() == "BU") { //營運用戶 DataTable dt = dal.GetAllUsers().Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["UserName"].ToString() != Session["User"].ToString()) { DataRow dr = dtSub.NewRow(); dr["AnnounceID"] = this.txtAnnounceID.Text; dr["ReceiverUserName"] = dt.Rows[i]["UserName"]; dr["ReceiverFlag"] = 0; Js.BLL.BusinessUnit.CompanyDal cdal = new Js.BLL.BusinessUnit.CompanyDal(); Js.Model.BusinessUnit.CompanyInfo model = cdal.GetModel(); dr["ReceiveUnitNo"] = model.CompanyNo; dr["Receiver"] = dt.Rows[i]["PersonName"]; dtSub.Rows.Add(dr); } } //各企業用戶 DataTable dtEP = dal.GetEnterprise(); for (int i = 0; i < dtEP.Rows.Count; i++) { Js.BLL.Account.UserDal edal = new Js.BLL.Account.UserDal(dtEP.Rows[i]["EnterpriseID"].ToString()); DataTable dtUser = edal.GetAllUsers().Tables[0]; for (int j = 0; j < dtUser.Rows.Count; j++) { DataRow dr = dtSub.NewRow(); dr["AnnounceID"] = this.txtAnnounceID.Text; dr["ReceiverUserName"] = dtUser.Rows[j]["UserName"]; dr["ReceiverFlag"] = 1; dr["ReceiveUnitNo"] = dtEP.Rows[i]["EnterpriseID"].ToString(); dr["Receiver"] = dtUser.Rows[j]["PersonName"]; dtSub.Rows.Add(dr); } } } else { Js.BLL.Account.UserDal edal = new Js.BLL.Account.UserDal(Session["EnterpriseID"].ToString()); DataTable dtUser = edal.GetAllUsers().Tables[0]; for (int i = 0; i < dtUser.Rows.Count; i++) { if (dtUser.Rows[i]["UserName"].ToString() != Session["User"].ToString()) { DataRow dr = dtSub.NewRow(); dr["AnnounceID"] = this.txtAnnounceID.Text; dr["ReceiverUserName"] = dtUser.Rows[i]["UserName"]; dr["ReceiverFlag"] = 1; dr["ReceiveUnitNo"] = Session["EnterpriseID"].ToString(); dr["Receiver"] = dtUser.Rows[i]["PersonName"]; dtSub.Rows.Add(dr); } } //營運管理用戶 Js.BLL.Enterprise.CheckDal checkdal = new Js.BLL.Enterprise.CheckDal(); dtUser = checkdal.GetManagerUser(Session["EnterpriseID"].ToString()); Js.BLL.BusinessUnit.CompanyDal cdal = new Js.BLL.BusinessUnit.CompanyDal(); Js.Model.BusinessUnit.CompanyInfo model = cdal.GetModel(); for (int i = 0; i < dtUser.Rows.Count; i++) { DataRow dr = dtSub.NewRow(); dr["AnnounceID"] = this.txtAnnounceID.Text; dr["ReceiverUserName"] = dtUser.Rows[i]["UserName"]; dr["ReceiverFlag"] = 0; dr["ReceiveUnitNo"] = model.CompanyNo; dr["Receiver"] = dtUser.Rows[i]["PersonName"]; dtSub.Rows.Add(dr); } } this.GridView1.DataSource = dtSub.DefaultView; this.GridView1.DataBind(); }
private void CheckDefaultUser() { for (int j = 0; j < this.GridView1.Rows.Count; j++) { CheckBox oChk = (CheckBox)this.GridView1.Rows[j].FindControl("cbSelect"); oChk.Checked = false; } Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); dtSub = dal.GetSubDetail(this.ddlRoleID.SelectedValue).Tables[0]; for (int i = 0; i < dtSub.Rows.Count; i++) { for (int j = 0; j < this.GridView1.Rows.Count; j++) { CheckBox oChk = (CheckBox)this.GridView1.Rows[j].FindControl("cbSelect"); if (dtSub.Rows[i]["UserID"].Equals(this.GridView1.DataKeys[j].Value)) { oChk.Checked = true; break; } } } }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtAnnounceID.Text = dt.Rows[0]["AnnounceID"].ToString(); this.txtAnnouncer.Text = dt.Rows[0]["Announcer"].ToString(); this.txtAnnouncerUserName.Text = dt.Rows[0]["AnnouncerUserName"].ToString(); if (dt.Rows[0]["AnnounceFlag"].ToString() == "0") this.txtAnnounceFlag.Text = Resources.Resource.AnnounceFlag1; else this.txtAnnounceFlag.Text = Resources.Resource.AnnounceFlag2; this.txtAnnounceUnitNo.Text = dt.Rows[0]["AnnounceUnitNo"].ToString(); if (dt.Rows[0]["Source"].ToString() == "0") this.txtSource.Text = Resources.Resource.AnnounceSource1; else this.txtSource.Text = Resources.Resource.AnnounceSource2; this.txtTitle.Text = dt.Rows[0]["Title"].ToString(); this.txtContents.Text = dt.Rows[0]["Contents"].ToString(); Js.BLL.BaseDal bdal = new Js.BLL.BaseDal(FormID); DataTable dtSub = bdal.GetSubDetail(this.txtAnnounceID.Text).Tables[0]; this.GridView1.DataSource = dtSub.DefaultView; this.GridView1.DataBind(); } }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtBillID.Text = dt.Rows[0]["BillID"].ToString(); //單號 this.txtBillDate.DateValue = (DateTime)dt.Rows[0]["BillDate"]; this.txtStyleID.Text = dt.Rows[0]["StyleID"].ToString(); this.txtSourceBillID.Text = dt.Rows[0]["SourceBillID"].ToString(); this.txtProducePages.Text= dt.Rows[0]["ProducePages"].ToString() ; this.txtStdPages.Text= dt.Rows[0]["StdPages"].ToString(); this.txtVolumes.Text= dt.Rows[0]["Volumes"].ToString() ; this.txtStartLabelNo.Text= dt.Rows[0]["StartLabelNo"].ToString(); this.txtEndLabelNo.Text= dt.Rows[0]["EndLabelNo"].ToString(); this.ddlProductionUnitID.SelectedValue= dt.Rows[0]["ProductionUnitID"].ToString(); this.txtScheduleBillID.Text= dt.Rows[0]["ScheduleBillID"].ToString() ; if (dt.Rows[0]["PreInStockDate"].ToString() != "") txtPreInStockDate.DateValue = (DateTime)dt.Rows[0]["PreInStockDate"]; this.ddlBillState.SelectedIndex = int.Parse(dt.Rows[0]["BillState"].ToString()); this.txtCreateDate.Text = ToYMDHM(dt.Rows[0]["CreateDate"]); //建檔日期 this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); //建檔人員 this.txtLastModifyDate.Text = ToYMDHM(dt.Rows[0]["LastModifyDate"]); //異動日期 this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); //異動人員 this.txtCheckDate.Text = ToYMDHM(dt.Rows[0]["CheckDate"]); //營運覆核日期 this.txtCheckUserName.Text = dt.Rows[0]["CheckUserName"].ToString(); //營運覆核用戶 this.txtMemo.Text = dt.Rows[0]["Memo"].ToString(); Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataSet ds = dal.GetSubDetail(dt.Rows[0]["BillID"].ToString()); HdnSubDetail1.Value = Js.Com.JsonHelper.Dtb2Json(ds.Tables[0]); } }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { //this.ddlEnterpriseID.SelectedValue = dt.Rows[0]["EnterpriseID"].ToString(); this.ddlCategoryID.SelectedValue = dt.Rows[0]["CategoryID"].ToString(); this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); this.txtEnterpriseEName.Text = dt.Rows[0]["EnterpriseEName"].ToString(); this.txtEnterpriseSName.Text = dt.Rows[0]["EnterpriseSName"].ToString(); this.txtUnionID.Text = dt.Rows[0]["UnionID"].ToString(); //this.rbtLabelFromYes.Checked = bool.Parse(dt.Rows[0]["LabelFrom"].ToString()); this.txtPresident.Text = dt.Rows[0]["President"].ToString(); //this.txtPresidentPost.Text = dt.Rows[0]["PresidentPost"].ToString(); this.txtPhone.Text = dt.Rows[0]["Phone"].ToString(); this.txtFax.Text = dt.Rows[0]["Fax"].ToString(); //this.txtContact.Text = dt.Rows[0]["Contact"].ToString(); //this.txtContactPost.Text = dt.Rows[0]["ContactPost"].ToString(); //this.txtContactPhone.Text = dt.Rows[0]["ContactPhone"].ToString(); //this.txtCellPhone.Text = dt.Rows[0]["CellPhone"].ToString(); //this.txtEmail.Text = dt.Rows[0]["Email"].ToString(); if (this.txtWebUrl.Text.Trim().Length > 0) { if (this.txtWebUrl.Text.ToLower().Trim().IndexOf("http") < 0) this.lnkWebUrl.NavigateUrl = "http://" + dt.Rows[0]["WebUrl"].ToString(); else this.lnkWebUrl.NavigateUrl = dt.Rows[0]["WebUrl"].ToString(); } else this.lnkWebUrl.Visible = false; this.txtServiceYears.Text = dt.Rows[0]["ServiceYears"].ToString(); this.ddlEnableMonths.Text = dt.Rows[0]["EnableMonths"].ToString(); this.txtAddress.Text = dt.Rows[0]["Address"].ToString(); this.txtZipNo.Text = dt.Rows[0]["ZipNo"].ToString(); this.txtMemo.Text = dt.Rows[0]["Memo"].ToString(); this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); this.txtCreateDate.Text = Js.Com.PageValidate.ParseDateTime(dt.Rows[0]["CreateDate"].ToString()); this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); this.txtLastModifyDate.Text = Js.Com.PageValidate.ParseDateTime(dt.Rows[0]["LastModifyDate"].ToString()); this.txtCheckUserName.Text = dt.Rows[0]["CheckUserName"].ToString(); this.txtCheckDate.Text = Js.Com.PageValidate.ParseDateTime(dt.Rows[0]["CheckDate"].ToString()); Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dtSub = dal.GetSubDetail(this.ddlEnterpriseID.SelectedValue.ToString()).Tables[0]; this.GridView1.DataSource = dtSub.DefaultView; this.GridView1.DataBind(); } ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "Resize", "content_resize();initial();", true); }
public static void SystemMessage(string[] ToUserName, int ReceiverFlag, string[] ReceiveUnitNo, string Title, string Content) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal("Sys_AnnounceMessage"); string strAnnounceUnitNo = ""; string strAnnounceID = ""; string strAnnouncer = ""; string strWhere = " AnnounceID like '" + strAnnounceUnitNo + DateTime.Now.ToString("yyyyMMdd") + "%'"; dal.GetMaxID(strWhere); strAnnounceID = dal.GetMaxID(strWhere); if (strAnnounceID.Length <= 0) strAnnounceID = strAnnounceUnitNo + DateTime.Now.ToString("yyyyMMdd") + "0001"; if (HttpContext.Current.Session["UserType"].ToString() == "BU") { Js.BLL.BusinessUnit.CompanyDal cdal = new Js.BLL.BusinessUnit.CompanyDal(); Js.Model.BusinessUnit.CompanyInfo model = cdal.GetModel(); strAnnounceUnitNo = model.CompanyNo; Js.BLL.Account.UserDal udal = new Js.BLL.Account.UserDal(); Js.Model.Account.UsersInfo umodel = udal.GetModel(HttpContext.Current.Session["User"].ToString()); strAnnouncer = umodel.PersonName; } else { strAnnounceUnitNo = HttpContext.Current.Session["EnterpriseID"].ToString(); Js.BLL.Account.UserDal udal = new Js.BLL.Account.UserDal(HttpContext.Current.Session["EnterpriseID"].ToString()); Js.Model.Account.UsersInfo umodel = udal.GetModel(HttpContext.Current.Session["User"].ToString()); strAnnouncer = umodel.PersonName; } DataTable dt = dal.GetRecord("1=2"); DataRow dr = dt.NewRow(); dr["AnnounceID"] = strAnnounceID; dr["Announcer"] = strAnnouncer; if (HttpContext.Current.Session["UserType"].ToString() == "BU") dr["AnnounceFlag"] = 0; else dr["AnnounceFlag"] = 1; dr["AnnounceUnitNo"] = strAnnounceUnitNo; dr["AnnouncerUserName"] = HttpContext.Current.Session["User"].ToString(); dr["Source"] = 1; dr["AnnounceDate"] = DateTime.Now; dr["Title"] = Title; dr["Contents"] = Content; dal.Add(dr); DataTable dtSub = dal.GetSubDetail("").Tables[0]; for (int i = 0; i < ToUserName.Length; i++) { DataRow subdr = dtSub.NewRow(); subdr["AnnounceID"] = strAnnounceID; subdr["ReceiverUserName"] = ToUserName[i]; subdr["ReceiverFlag"] = ReceiverFlag; subdr["ReceiveUnitNo"] = ReceiveUnitNo[i]; Js.BLL.Account.UserDal udal = new Js.BLL.Account.UserDal(ReceiveUnitNo[i]); Js.Model.Account.UsersInfo umodel = udal.GetModel(ToUserName[i]); subdr["Receiver"] = umodel.PersonName; dtSub.Rows.Add(subdr); } dal.SaveDetail(dtSub, ""); }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); this.ddlCategoryID.SelectedValue = dt.Rows[0]["CategoryID"].ToString(); this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); this.txtEnterpriseEName.Text = dt.Rows[0]["EnterpriseEName"].ToString(); this.txtEnterpriseSName.Text = dt.Rows[0]["EnterpriseSName"].ToString(); this.txtUnionID.Text = dt.Rows[0]["UnionID"].ToString(); this.txtPresident.Text = dt.Rows[0]["President"].ToString(); this.txtPhone.Text = dt.Rows[0]["Phone"].ToString(); this.txtFax.Text = dt.Rows[0]["Fax"].ToString(); this.txtWebUrl.Text = dt.Rows[0]["WebUrl"].ToString(); if (this.txtWebUrl.Text.Trim().Length > 0) { if (this.txtWebUrl.Text.ToLower().Trim().IndexOf("http") < 0) this.lnkWebUrl.NavigateUrl = "http://" + dt.Rows[0]["WebUrl"].ToString(); else this.lnkWebUrl.NavigateUrl = dt.Rows[0]["WebUrl"].ToString(); } else this.lnkWebUrl.Visible = false; this.txtServiceYears.Text = dt.Rows[0]["ServiceYears"].ToString(); this.ddlEnableMonths.Text = dt.Rows[0]["EnableMonths"].ToString(); this.txtAddress.Text = dt.Rows[0]["Address"].ToString(); this.txtZipNo.Text = dt.Rows[0]["ZipNo"].ToString(); this.txtMemo.Text = dt.Rows[0]["Memo"].ToString(); this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); this.txtCreateDate.Text = Js.Com.PageValidate.ParseDateTime(dt.Rows[0]["CreateDate"].ToString()); this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); this.txtLastModifyDate.Text = Js.Com.PageValidate.ParseDateTime(dt.Rows[0]["LastModifyDate"].ToString()); this.txtCheckUserName.Text = dt.Rows[0]["CheckUserName"].ToString(); if (this.txtCheckUserName.Text.Length > 0) { this.btnEdit.Enabled = false; this.btnDelete.Enabled = false; this.btnCheck.Text = Resources.Resource.UnCheck; } else { this.btnEdit.Enabled = true; this.btnDelete.Enabled = true; this.btnCheck.Text = Resources.Resource.Check; } this.txtCheckDate.Text = Js.Com.PageValidate.ParseDateTime(dt.Rows[0]["CheckDate"].ToString()); Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dtSub = dal.GetSubDetail(this.txtEnterpriseID.Text).Tables[0]; this.GridView1.DataSource = dtSub.DefaultView; this.GridView1.DataBind(); } ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "Resize", "content_resize();initial();", true); ViewState["StrWhere"] = string.Format(" EnterpriseID='{0}'", this.txtEnterpriseID.Text); ViewState["dt"] = dt; }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtBillID.Text = dt.Rows[0]["BillID"].ToString(); this.txtBillDate.DateValue = (DateTime)dt.Rows[0]["BillDate"]; this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); //企業用戶編號 this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); //企業用戶名稱 this.txtProduceBillID.Text = dt.Rows[0]["ProduceBillID"].ToString(); //單號 this.txtOrderBillID.Text = dt.Rows[0]["OrderBillID"].ToString(); //訂單單號 //this.txtOrderSubID.SelectedIndex = int.Parse(dt.Rows[0]["OrderSubID"].ToString());//訂單序號 this.txtStyleID.Text = dt.Rows[0]["StyleID"].ToString(); //款式編號 this.txtLabelMode.Text = dt.Rows[0]["LabelMode"].ToString(); //標籤模式 //this.txtRemainQty.Text = dt.Rows[0]["RemainQty"].ToString();//保留數量 this.txtRemainStartNo.Text = dt.Rows[0]["RemainStartNo"].ToString(); //保留起始序號 this.txtRemainEndNo.Text = dt.Rows[0]["RemainEndNo"].ToString(); //保留終止序號 this.txtQtyTotal.Text = dt.Rows[0]["QtyTotal"].ToString();//入庫張數合計 this.txtLabelReels.Text = dt.Rows[0]["LabelReels"].ToString();//標籤卷數合計 this.ckbIsNoDone.Checked = bool.Parse(dt.Rows[0]["IsNoDone"].ToString());//序號產生 this.ckbIsCheckImage.Checked = bool.Parse(dt.Rows[0]["IsCheckImage"].ToString());//圖檔檢查 //this.ckbIsConfirmBad.Checked = bool.Parse(dt.Rows[0]["IsConfirmBad"].ToString());//壞品確認 this.ckbIsImportImage.Checked = bool.Parse(dt.Rows[0]["IsImportImage"].ToString());//圖檔匯入 this.ckbIsInvalidBad.Checked = bool.Parse(dt.Rows[0]["IsInvalidBad"].ToString());//壞品作廢 this.txtInvalidBillID.Text = dt.Rows[0]["InvalidBillID"].ToString(); //作廢單號 RadioButton3.Checked = !bool.Parse(dt.Rows[0]["LabelFrom"].ToString()); RadioButton4.Checked = bool.Parse(dt.Rows[0]["LabelFrom"].ToString()); //this.ckbBillState.Checked = bool.Parse(dt.Rows[0]["BillState"].ToString());//入庫狀況 this.txtMemo.Text = dt.Rows[0]["Memo"].ToString(); //備註 this.txtCreateDate.Text = dt.Rows[0]["CreateDate"].ToString(); //建檔日期 this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); //建檔人員 this.txtLastModifyDate.Text = dt.Rows[0]["LastModifyDate"].ToString(); //異動日期 this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); //異動人員 //this.txtEP_CheckDate.Text = dt.Rows[0]["EP_CheckDate"].ToString(); //建檔日期 //this.txtEP_CheckUserName.Text = dt.Rows[0]["EP_CheckUserName"].ToString(); //營運覆核 this.txtBU_CheckDate.Text = dt.Rows[0]["BU_CheckDate"].ToString(); //營運覆核日期 this.txtBU_CheckUserName.Text = dt.Rows[0]["BU_CheckUserName"].ToString(); //營運覆核用戶 if (this.txtBU_CheckUserName.Text.Length > 0) { this.btnEdit.Enabled = false; this.btnDelete.Enabled = false; this.btnCheck.Text = Resources.Resource.BU_UnCheck; } else { this.btnEdit.Enabled = true; this.btnDelete.Enabled = true; this.btnCheck.Text = Resources.Resource.BU_Check; } } Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataSet ds = dal.GetSubDetail(dt.Rows[0]["BillID"].ToString()); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "Resize", "content_resize();initial();", true); }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.ddlRoleID.SelectedValue = dt.Rows[0]["RoleID"].ToString(); this.ddlUserLevel.SelectedIndex = int.Parse(dt.Rows[0]["RoleUserLevel"].ToString()); this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); this.txtLastModifyDate.Text = Js.Com.PageValidate.ParseDateTime(dt.Rows[0]["LastModifyDate"].ToString()); Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dtSub = dal.GetSubDetail(this.ddlRoleID.SelectedValue).Tables[0]; this.GridView1.DataSource = dtSub.DefaultView; this.GridView1.DataBind(); } ViewState["StrWhere"] = string.Format(" RoleID={0}", this.ddlRoleID.SelectedValue); ViewState["dt"] = dt; }
protected void btnOrdPreNO_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataTable dtSub1 = dal.GetSubDetail(this.txtBillID.Text).Tables[0]; DataTable newdtb = Js.Com.JsonHelper.Json2Dtb(HdnSubDetail1.Value); for (int i = 0; i < newdtb.Rows.Count; i++) { DataRow dr1 = dtSub1.Rows[i]; for (int j = 0; j < newdtb.Columns.Count; j++) { dr1[newdtb.Columns[j].ColumnName] = newdtb.Rows[i][j]; } } dtSub1.TableName = "LB_OrderSub"; dal.SaveDetail(dtSub1, this.txtBillID.Text); if (((Button)sender).ClientID == "btnCancelOrdNo") new Js.DAO.Label.OrderDao(FormID, cnKey).updateBillState(this.txtBillID.Text); DataTable dt = dal.GetViewRecord(string.Format(_strWhere, this.txtBillID.Text)); BindData(dt); //Response.Redirect("OrderView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtBillID.Text)); }
private void BindData(DataTable dt) { ViewState["dt"] = dt;//移動,開始記錄 (更新所用) if (dt.Rows.Count > 0) { //this.txtFlag.SelectedIndex = int.Parse(dt.Rows[0]["Flag"].ToString());//旗標 Flag=1 訂單 Flag=2 生產計劃單 this.txtBillID.Text = dt.Rows[0]["BillID"].ToString(); //單號 this.txtBillDate.DateValue = (DateTime)dt.Rows[0]["BillDate"]; //日期 this.txtCustomerPO.Text = dt.Rows[0]["CustomerPO"].ToString(); //客戶PO this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); //企業用戶編號 this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); //企業用戶名稱 this.txtContact.Text = dt.Rows[0]["Contact"].ToString(); //連絡人員 this.txtContactPhone.Text = dt.Rows[0]["ContactPhone"].ToString(); //聯絡電話 this.txtFax.Text = dt.Rows[0]["Fax"].ToString(); //公司傳真 this.txtBusPersonID.Text = dt.Rows[0]["BusPersonID"].ToString(); //業務員編號 this.txtBusPersonName.Text = dt.Rows[0]["BusPersonName"].ToString(); //業務員姓名 this.ddlBillState.SelectedIndex = int.Parse(dt.Rows[0]["BillState"].ToString());//單況 0:有效 1:結案 this.txtDeliverCountry.Text = dt.Rows[0]["DeliverCountry"].ToString(); //送貨地址國別 this.txtDeliverAddress.Text = dt.Rows[0]["DeliverAddress"].ToString(); //送貨地址 this.txtDeliverMehtod.Text = dt.Rows[0]["DeliverMehtod"].ToString(); //交貨方式 this.txtMemo.Text = dt.Rows[0]["Memo"].ToString(); //備註 this.txtTotalPages.Text = string.Format("{0:N0}", dt.Rows[0]["TotalPages"]);//張數合計 this.txtCreateDate.Text = ToYMDHM(dt.Rows[0]["CreateDate"]); //建檔日期 this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); //建檔人員 this.txtLastModifyDate.Text = ToYMDHM(dt.Rows[0]["LastModifyDate"]); //異動日期 this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); //異動人員 this.txtBU_CheckDate.Text = ToYMDHM(dt.Rows[0]["CheckDate"]); //營運覆核日期 this.txtBU_CheckUserName.Text = dt.Rows[0]["CheckUserName"].ToString(); //營運覆核人員 if (this.txtBU_CheckUserName.Text.Length > 0) { this.btnEdit.Enabled = false; this.btnDelete.Enabled = false; this.btnBUCheck.Text = Resources.Resource.BU_UnCheck; } else { this.btnEdit.Enabled = true; this.btnDelete.Enabled = true; this.btnBUCheck.Text = Resources.Resource.BU_Check; } Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataSet ds = dal.GetSubDetail(dt.Rows[0]["BillID"].ToString()); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); } ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "Resize", "content_resize();initial();", true); }
private void BindData(DataTable dt) { if (dt.Rows.Count > 0) { this.txtEnableLabelNoID.Text = dt.Rows[0]["BillID"].ToString(); //上架單號 this.txtEnableDate.DateValue = (DateTime)dt.Rows[0]["EnableDate"]; //日期 this.txtEnterpriseID.Text = dt.Rows[0]["EnterpriseID"].ToString(); //企業用戶編號 this.txtEnterpriseName.Text = dt.Rows[0]["EnterpriseName"].ToString(); //企業用戶名稱 this.ddlBillState.SelectedIndex = int.Parse(dt.Rows[0]["BillState"].ToString());//狀態 0未上架、1異常待修正、2檢查OK、3上架中、4已上架 this.txtQtyTotal.Text = dt.Rows[0]["QtyTotal"].ToString();//數量合計 this.txtCreateDate.Text = dt.Rows[0]["CreateDate"].ToString(); //建檔日期 this.txtCreateUserName.Text = dt.Rows[0]["CreateUserName"].ToString(); //建檔人員 this.txtLastModifyDate.Text = dt.Rows[0]["LastModifyDate"].ToString(); //異動日期 this.txtLastModifyUserName.Text = dt.Rows[0]["LastModifyUserName"].ToString(); //異動人員 this.txtEP_CheckDate.Text = dt.Rows[0]["EP_CheckDate"].ToString(); //建檔日期 this.txtEP_CheckUserName.Text = dt.Rows[0]["EP_CheckUserName"].ToString(); //營運覆核 this.txtBU_CheckDate.Text = dt.Rows[0]["BU_CheckDate"].ToString(); //營運覆核日期 this.txtBU_CheckUserName.Text = dt.Rows[0]["BU_CheckUserName"].ToString(); //營運覆核用戶 if (this.txtBU_CheckUserName.Text.Length > 0) { this.btnEdit.Enabled = false; this.btnDelete.Enabled = false; this.btnBUCheck.Text = Resources.Resource.BU_UnCheck; } else { this.btnEdit.Enabled = true; this.btnDelete.Enabled = false; this.btnBUCheck.Text = Resources.Resource.BU_Check; } } Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataSet ds = dal.GetSubDetail(dt.Rows[0]["BillID"].ToString()); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); ScriptManager.RegisterStartupScript(this.updatePanel, this.GetType(), "Resize", "content_resize();initial();", true); }