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["ProductionUnitID"] = this.txtProductionUnitID.Text; dr["ProductionUnitName"] = this.txtProductionUnitName.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; dr["StopUserName"] = this.txtStopUserName.Text; if (this.txtStopDate.Text.Length > 0) dr["StopDate"] = this.txtStopDate.Text; if (ID.Length > 0) dal.Update(dr, ID); else dal.Add(dr); //Response.Redirect("Departments.aspx?FormID=" + Server.UrlEncode(FormID)); Response.Redirect("ProductionUnitView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtProductionUnitID.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["MemberID"] = this.txtMemberID.Text; dr["Country"] = this.EddlCountry.Text; dr["Password"] = this.txtPassword.Text.Trim(); dr["PasswordHint"] = this.txtPasswordHint.Text.Trim(); dr["Name"] = this.txtName.Text.Trim(); if (this.ddlSex.SelectedIndex > 0) dr["Sex"] = 1; else dr["Sex"] = 0; dr["EMail"] = this.txtEMail.Text; dr["SpareEMail"] = this.txtSpareEMail.Text; if(this.txtBirthday.Text.Trim().Length>0) dr["Birthday"] = this.txtBirthday.Text; dr["CellPhone"] = this.txtCellPhone.Text; dr["LinkPhone"] = this.txtLinkPhone.Text; dr["ZipCode1"] = this.txtZipCode1.Text; dr["Address1"] = this.txtAddress1.Text; dr["ZipCode2"] = this.txtZipCode2.Text; dr["Address2"] = this.txtAddress2.Text; dr["WebSite"] = this.txtWebSite.Text; if (ID.Length > 0) dal.Update(dr, ID); else dal.Add(dr); Response.Redirect("MemberView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtMemberID.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["StateID"] = this.txtStateListID.Text; dr["StateName"] = this.txtStateName.Text; dr["Style"] = this.ddlStyle.SelectedIndex; dr["Description"] = this.txtMemo.Text; dr["ImageProvider"] = this.chkImageProvider.Checked; if (this.txtStopDate.Text.Length > 0) dr["StopDate"] = this.txtStopDate.Text; dr["StopUserName"] = this.txtStopUserName.Text; 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; if (ID.Length > 0) dal.Update(dr, ID); else dal.Add(dr); Response.Redirect("StateListView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtStateListID.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["Flag"] = Flag;//旗標 dr["BillID"] = this.txtBillID.Text;//上架單號 if (this.txtEnableDate.Text.Length > 0) dr["EnableDate"] = this.txtEnableDate.DateValue;//日期 dr["EnterpriseID"] = this.txtEnterpriseID.Text;//企業用戶編號 dr["EnterpriseName"] = this.txtEnterpriseName.Text;//企業用戶名稱 dr["BillState"] = this.ddlBillState.SelectedIndex;//狀態 0未上架、1異常待修正、2檢查OK、3上架中、4已上架 dr["QtyTotal"] = int.Parse(this.txtQtyTotal.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.txtEP_CheckDate.Text.Length > 0) dr["EP_CheckDate"] = this.txtEP_CheckDate.Text;//建檔日期 dr["EP_CheckUserName"] = this.txtEP_CheckUserName.Text;//營運覆核 if (this.txtBU_CheckDate.Text.Length > 0) dr["BU_CheckDate"] = this.txtBU_CheckDate.Text;//營運覆核日期 dr["BU_CheckUserName"] = this.txtBU_CheckUserName.Text;//營運覆核用戶 if (ID.Length > 0) dal.Update(dr, ID); else dal.Add(dr); Response.Redirect("EnableLabelNoView.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["EnterpriseID"] = this.txtEnterpriseID.Text; dr["EnterpriseName"] = this.txtEnterpriseName.Text; dr["BillID"] = this.txtBillID.Text.Trim(); dr["QtyTotal"] = this.txtQtyTotal.Text.Trim(); dr["BillState"] = this.txtBillState.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["EP_CheckUserName"] = this.txtEP_CheckUserName.Text; if (this.txtEP_CheckDate.Text.Length > 0) dr["EP_CheckDate"] = this.txtEP_CheckDate.Text; dr["BU_CheckUserName"] = this.txtBU_CheckUserName.Text; if (this.txtBU_CheckDate.Text.Length > 0) dr["BU_CheckDate"] = this.txtBU_CheckDate.Text; if (ID.Length > 0) dal.Update(dr, ID); else dal.Add(dr); Response.Redirect("InvalidLabelView.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["WarehouseID"] = this.txtWarehouseID.Text.Trim().ToUpper(); dr["WarehouseName"] = this.txtWarehouseName.Text; dr["Contact"] = this.txtContact.Text.Trim(); dr["ContactPhone"] = this.txtContactPhone.Text.Trim(); dr["Address"] = this.txtAddress.Text.Trim(); 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; dr["StopUserName"] = this.txtStopUserName.Text; if (this.txtStopDate.Text.Length > 0) dr["StopDate"] = this.txtStopDate.Text; if (ID.Length > 0) dal.Update(dr, ID); else { dal.Add(dr); //插入標籤數量 Js.BLL.Label.StyleDal sdal = new Js.BLL.Label.StyleDal(cnKey); sdal.InsertWarehousePagesByWID(this.txtWarehouseID.Text.Trim().ToUpper(), Session["User"].ToString()); } //Response.Redirect("Departments.aspx?FormID=" + Server.UrlEncode(FormID)); Response.Redirect("WarehouseView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtWarehouseID.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["ID"] = this.txtEnterpriseID.Text.Trim().ToUpper() + "_" + this.txtStyleID.Text.Trim().ToUpper(); // dr["EnterpriseID"] = this.txtEnterpriseID.Text.ToUpper(); dr["StyleName"] = this.txtStyleName.Text; dr["StyleID"] = this.txtStyleID.Text.Trim().ToUpper(); dr["Volumes"] = this.txtVolumes.DataValue; dr["StdPages"] = this.txtStdPages.DataValue; dr["ImageLocation"] = this.ddlImageLocation.Text.Trim(); dr["Length"] = this.txtLength_R.DataValue; dr["Width"] = this.txtWidth_R.DataValue; dr["Height"] = this.txtHeight_R.DataValue; dr["QRContent"] = this.ddlQRContent.Text.Trim(); dr["ProductionNo"] = this.txtProductionNo.Text.Trim(); dr["QR_X"] = this.txtQR_X_R.DataValue; dr["QR_Y"] = this.txtQR_Y_R.DataValue; dr["QR_Length"] = this.txtQR_Length_R.DataValue; dr["QR_Width"] = this.txtQR_Width_R.DataValue; dr["NowVolumes"] = this.txtNowVolumes.DataValue; dr["NowPages"] = this.txtNowPages.DataValue; dr["ImagePath"] = this.txtImagePath.Text.Trim(); dr["ServiceYears"] = byte.Parse(this.txtServiceYears.Text.Trim()); dr["EnableMonths"] = byte.Parse(this.ddlEnableMonths.SelectedValue.ToString()); dr["Description"] = this.txtDescription.Text.Trim(); dr["AntiFakeDesc1"] = this.txtAntiFakeDesc1.Text.Trim(); dr["ImagePath1"] = this.txtImagePath1.Text.Trim(); dr["AntiFakeDesc2"] = this.txtAntiFakeDesc2.Text.Trim(); dr["ImagePath2"] = this.txtImagePath2.Text.Trim(); dr["AntiFakeDesc3"] = this.txtAntiFakeDesc3.Text.Trim(); dr["ImagePath3"] = this.txtImagePath3.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; dr["StopUserName"] = this.txtStopUserName.Text; if (this.txtStopDate.Text.Length > 0) dr["StopDate"] = this.txtStopDate.Text; if (ID.Length > 0) dal.Update(dr, ID); else { dal.Add(dr); //插入標籤數量 Js.BLL.Label.StyleDal sdal = new Js.BLL.Label.StyleDal(cnKey); sdal.InsertWarehousePagesByStyleID(this.txtStyleID.Text.Trim().ToUpper(), Session["User"].ToString()); } Response.Redirect("StyleView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtStyleID.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["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 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"] = 2; dr["EnterPriseID"] = Session["EnterPriseID"].ToString(); dr["EnterpriseName"] = Session["EnterpriseName"].ToString(); dr["ResumeID"] = this.txtResumeID.Text.Trim(); dr["ProductID"] = this.txtProductID.Text; dr["ProductName"] = this.txtProductName.Text; if (this.txtProduceDate.Text.Length > 0) dr["ProduceDate"] = DateTime.Parse(this.txtProduceDate.Text); dr["HasGarantee"] = this.ckbHasGarantee.Checked; if (this.txtProduceDate.Text.Length > 0) dr["GaranteeDate"] = DateTime.Parse(this.txtGaranteeDate.Text); dr["OfficalUrl"] = this.txtOfficalUrl.Text.Trim(); dr["ServicePhone"] = this.txtServicePhone.Text.Trim(); dr["Description"] = this.txtDescription.Text.Trim(); dr["ResumeOfficalUrl"] = this.txtResumeOfficalUrl.Text.Trim(); dr["EPResumeID"] = this.txtEPResumeID.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["BU_CheckUserName"] = ""; dr["EP_CheckUserName"] = ""; //dr["BU_CheckUserName"] = this.txtBU_CheckUserName.Text; //if (this.txtBU_CheckDate.Text.Length > 0) // dr["BU_CheckDate"] = this.txtBU_CheckDate.Text; //dr["EP_CheckUserName"] = this.txtEP_CheckUserName.Text; //if (this.txtEP_CheckDate.Text.Length > 0) // dr["EP_CheckDate"] = this.txtEP_CheckDate.Text; dr["StopUserName"] = this.txtStopUserName.Text; if (this.txtStopDate.Text.Length > 0) dr["StopDate"] = this.txtStopDate.Text; dr["UploadUserName"] = ""; dr["State"] = 0; if (FormID == "EP_ProductResumeNoCheck" && ID.Length > 0) //dal.Update(dr, this.txtEnterpriseID.Text, string.Format(" ResumeID='{0}'", this.txtResumeID.Text)); dal.Update(dr, this.txtResumeID.Text, string.Format(" EnterpriseID='{0}' and flag=2", this.txtEnterpriseID.Text)); else dal.Add(dr); Response.Redirect("ProductResumeView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtResumeID.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["EnterPriseID"] = Session["EnterPriseID"].ToString(); dr["EnterpriseName"] = Session["EnterpriseName"].ToString(); dr["PersonID"] = this.txtPersonID.Text; dr["DepartmentID"] = this.ddlDepartmentID.SelectedValue.ToString(); dr["PersonName"] = this.txtPersonName.Text; dr["PersonEName"] = this.txtPersonEName.Text.Trim(); //dr["IDNumber"] = this.txtIDNumber.Text.Trim(); //if (this.txtBirthday.Text.Length > 0) // dr["Birthday"] = this.txtBirthday.Text; dr["Post"] = this.txtPost.Text.Trim(); //dr["HomePhone"] = this.txtHomePhone.Text.Trim(); dr["CellPhone"] = this.txtCellPhone.Text.Trim(); dr["Email"] = this.txtEmail.Text.Trim(); //if (this.txtOnJobDate.Text.Length > 0) // dr["OnJobDate"] = this.txtOnJobDate.Text; //if (this.txtLeftJobDate.Text.Length > 0) // dr["LeftJobDate"] = this.txtLeftJobDate.Text; //dr["LinkMan"] = this.txtLinkMan.Text.Trim(); //dr["Relation"] = this.txtRelation.Text.Trim(); //dr["LinkPhone"] = this.txtLinkPhone.Text.Trim(); dr["ContactAddress"] = this.txtContactAddress.Text.Trim(); //dr["HomeAddress"] = this.txtHomeAddress.Text.Trim(); 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; dr["StopUserName"] = this.txtStopUserName.Text; if (this.txtStopDate.Text.Length > 0) dr["StopDate"] = this.txtStopDate.Text; if (ID.Length > 0) dal.Update(dr, ID, "EnterpriseID='" + this.txtEnterpriseID.Text + "'"); else dal.Add(dr); Response.Redirect("PersonView.aspx?FormID=" + Server.UrlEncode(FormID)+ "&ID=" + Server.UrlEncode(this.txtPersonID.Text)); }
protected void btnSave_Click(object sender, EventArgs e) { //BaseDal Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dt = dal.GetRecord("1=1"); string OrderCode = dt.Rows[0]["OrderCode"].ToString(); DataRow dr = dt.NewRow(); dr["OrderCode"] = this.txtOrderCode.Value; dr["ScheduleCode"] = this.txtScheduleCode.Value; dr["ProductionCode"] = this.txtProductionCode.Value; dr["InStockCode"] = this.txtInStockCode.Value; dr["InvalidLabelCode"] = this.txtInvalidLabelCode.Value; dr["OutStockCode"] = this.txtDeliverCode.Value; dr["ReturnLabelCode"] = this.txtReturnLabelCode.Value; dr["TransferCode"] = this.txtTransferCode.Value; dr["EnableLabelNoCode"] = this.txtEnableLabelNoCode.Value; dr["LabelNoActionCode"] = this.txtLabelNoActionCode.Value; dr["BatchActionCode"] = this.txtBatchActionCode.Value; dr["LabelRegisterCode"] = this.txtLabelRegisterCode.Value; dr["BatchRegisterCode"] = this.txtBatchRegisterCode.Value; dr["PercentDecimalDigits"] = this.ddlPercentDecimalDigits.SelectedValue; int ServiceYears; int.TryParse(this.txtServiceYears.Text.Trim(), out ServiceYears); this.txtServiceYears.Text = ServiceYears.ToString(); dr["ServiceYears"] = ServiceYears; dr["EnableMonths"] = this.ddlEnableMonths.Text; if (this.txtClearDate.Text.Length > 0) dr["ClearDate"] = this.txtClearDate.Text; if (this.txtCloseDate.Text.Length > 0) dr["CloseDate"] = this.txtCloseDate.Text; dr["LastModifyUserName"] = Session["User"].ToString(); if (this.txtLastModifyDate.Text.Length > 0) dr["LastModifyDate"] = DateTime.Now; if (OrderCode.Length > 0) dal.Update(dr, OrderCode); else dal.Add(dr); //BindData(); this.btnEdit.Enabled = true; this.btnSave.Enabled = false; this.btnCancel.Enabled = false; InitialCtl(); }
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;//旗標 dr["BillID"] = this.txtBillID.Text;//單號 if (this.txtBillDate.Text.Length > 0) dr["BillDate"] = this.txtBillDate.DateValue;//日期 dr["EnterpriseID"] = this.txtEnterpriseID.Text;//企業用戶編號 dr["EnterpriseName"] = this.txtEnterpriseName.Text;//企業用戶名稱 dr["ProduceBillID"] = this.txtProduceBillID.Text;//單號 dr["OrderBillID"] = this.txtOrderBillID.Text;//訂單單號 dr["OrderSubID"] = 0;// int.Parse(this.txtOrderSubID.Text);//訂單序號 dr["StyleID"] = this.txtStyleID.Text;//款式編號 dr["LabelMode"] = this.txtLabelMode.Text;//標籤模式 dr["RemainQty"] = 0;// int.Parse(this.txtRemainQty.Text);//保留數量 dr["RemainStartNo"] = this.txtRemainStartNo.Text;//保留起始序號 dr["RemainEndNo"] = this.txtRemainEndNo.Text;//保留終止序號 dr["QtyTotal"] = int.Parse(this.txtQtyTotal.Text);//入庫張數合計 dr["LabelReels"] = int.Parse(this.txtLabelReels.Text);//標籤卷數合計 dr["IsNoDone"] = this.ckbIsNoDone.Checked;//序號產生 dr["IsCheckImage"] = this.ckbIsCheckImage.Checked;//圖檔檢查 dr["IsConfirmBad"] = false;// this.ckbIsConfirmBad.Checked;//壞品確認 dr["IsImportImage"] = this.ckbIsImportImage.Checked;//圖檔匯入 dr["IsInvalidBad"] = this.ckbIsInvalidBad.Checked;//壞品作廢 dr["InvalidBillID"] = this.txtInvalidBillID.Text;//作廢單號 dr["LabelFrom"] = this.RadioButton4.Checked;//入庫狀況 dr["Memo"] = this.txtMemo.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.txtEP_CheckDate.Text.Length > 0) dr["EP_CheckDate"] = this.txtEP_CheckDate.Text;//建檔日期 //dr["EP_CheckUserName"] = this.txtEP_CheckUserName.Text;//營運覆核 if (this.txtBU_CheckDate.Text.Length > 0) dr["BU_CheckDate"] = this.txtBU_CheckDate.Text;//營運覆核日期 dr["BU_CheckUserName"] = this.txtBU_CheckUserName.Text;//營運覆核用戶 if (ID.Length > 0) dal.Update(dr, ID); else dal.Add(dr); Response.Redirect("StockInView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtBillID.Text)); }
protected void btnSave_Click(object sender, EventArgs e) { //BaseDal Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); DataTable dt = dal.GetRecord("1=1"); string CompanyNo = dt.Rows[0]["CompanyNo"].ToString(); DataRow dr = dt.NewRow(); dr["CompanyNo"] = this.txtCompanyNo.Text; dr["CompanyName"] = this.txtCompanyName.Text; dr["UnionID"] = this.txtUnionID.Text.Trim(); dr["President"] = this.txtPresident.Text.Trim(); dr["Phone"] = this.txtPhone.Text; dr["Fax"] = this.txtFax.Text; dr["RegisterAddress"] = this.txtRegisterAddress.Text.Trim(); dr["WebUrl"] = this.txtWebUrl.Text.Trim(); dr["EnglishName"] = this.txtEnglishName.Text.Trim(); dr["EnglishAddress"] = this.txtEnglishAddress.Text.Trim(); if (this.txtCreateDate.Text.Length>0) { dr["CreateUserName"] = this.txtCreateUserName.Text; dr["CreateDate"] = this.txtCreateDate.Text; } else { dr["CreateUserName"] = Session["User"].ToString(); dr["CreateDate"] = DateTime.Now.ToString(Js.Com.User.strDateFormat); } dr["LastModifyUserName"] = Session["User"].ToString(); dr["LastModifyDate"] = DateTime.Now.ToString(Js.Com.User.strDateFormat); if (CompanyNo.Length > 0) dal.Update(dr, CompanyNo); else dal.Add(dr); BindData(); this.btnEdit.Enabled = true; this.btnSave.Enabled = false; this.btnCancel.Enabled = false; InitialCtl(); }
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)); }
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, ""); }