protected void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { if (Request.QueryString["no"] != null) { string repId = Request.QueryString["no"].ToString(); try { for (int i = 0; i < list.Count; i++) { string docId = list[i].docId; string sql = string.Format("SELECT ChgCode,ChgDes, Currency, ExRate,Qty,Price, Unit, MinAmt, Rmk,GstType,Gst,Amt FROM SeaQuoteDet1 where SequenceId='{0}'", docId); DataTable tab = C2.Manager.ORManager.GetDataSet(sql).Tables[0]; if (tab.Rows.Count == 1) { string chgCode = SafeValue.SafeString(tab.Rows[0]["ChgCode"], ""); string chgDes = SafeValue.SafeString(tab.Rows[0]["ChgDes"], ""); decimal price = SafeValue.SafeDecimal(tab.Rows[0]["Price"], 0); decimal qty = SafeValue.SafeDecimal(tab.Rows[0]["Qty"], 1); decimal minAmt = SafeValue.SafeDecimal(tab.Rows[0]["MinAmt"], 0); string currency = tab.Rows[0]["Currency"].ToString(); decimal exRate = SafeValue.SafeDecimal(tab.Rows[0]["ExRate"], 1); string unit = tab.Rows[0]["Unit"].ToString(); string rmk = tab.Rows[0]["Rmk"].ToString(); decimal amt = SafeValue.SafeDecimal(tab.Rows[0]["Amt"], 0); decimal gst = SafeValue.SafeDecimal(tab.Rows[0]["Gst"], 0); string gstType = tab.Rows[0]["GstType"].ToString(); C2.SeaQuoteDet1 repDet = new SeaQuoteDet1(); repDet.ChgCode = chgCode; repDet.ChgDes = chgDes; repDet.Currency = currency; repDet.ExRate = exRate; repDet.FclLclInd = "Fcl"; repDet.MinAmt = minAmt; repDet.Price = price; repDet.QuoteId = repId; repDet.Qty = qty; repDet.GstType = gstType; repDet.Gst = gst; repDet.Amt = amt; string sql_detCnt = "select max(QuoteLineNo) from SeaQuoteDet1 where QuoteId='" + repId + "'"; int lineNo = SafeValue.SafeInt(Manager.ORManager.ExecuteScalar(sql_detCnt), 0) + 1; repDet.QuoteLineNo = lineNo; repDet.Rmk = rmk; repDet.Unit = unit; repDet.GroupTitle = ""; C2.Manager.ORManager.StartTracking(repDet, Wilson.ORMapper.InitialState.Inserted); C2.Manager.ORManager.PersistChanges(repDet); } } e.Result = ""; } catch { } } else { e.Result = "Please keyin select party "; } }
private void contCfsStatusChange(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e, int rowIndex, string CfsStatus) { if (rowIndex < 0) { e.Result = "Save Error"; return; } ASPxLabel lb_id = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lb_Id") as ASPxLabel; string res = "Save Error"; if (lb_id != null) { string sql = string.Format(@"update Job_Process set ProcessStatus=@StatusCode,DateProcess=getdate() where Id=@Oid"); List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>(); list.Add(new ConnectSql_mb.cmdParameters("@Oid", lb_id.Text, SqlDbType.Int)); list.Add(new ConnectSql_mb.cmdParameters("@StatusCode", CfsStatus, SqlDbType.NVarChar, 100)); if (ConnectSql_mb.ExecuteNonQuery(sql, list).status) { res = "Save successful!"; } } e.Result = res; }
protected void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { if (Request.QueryString["no"] != null) { string soNo = Request.QueryString["no"].ToString(); try { for (int i = 0; i < list.Count; i++) { string doDetId = list[i].doDetId; int qty1 = list[i].qty1; int qty2 = list[i].qty2; int qty3 = list[i].qty3; string toLoc = list[i].toLoc; string fromWh = list[i].fromWh; string toWh = list[i].toWh; Transfer(soNo, doDetId, qty1, qty2, qty3, toLoc, fromWh, toWh); } e.Result = "Success"; } catch { } } else { e.Result = "Please keyin select party "; } }
protected void grid_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string paras = e.Parameters; string[] ar = paras.Split('_'); if (ar.Length >= 2) { if (ar[0].Equals("Saveline")) { #region ASPxGridView grid = sender as ASPxGridView; int rowIndex = SafeValue.SafeInt(ar[1], -1); ASPxLabel lbl_Id = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_Id") as ASPxLabel; ASPxLabel lbl_JobNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobNo") as ASPxLabel; ASPxComboBox txt_ContNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "cbbContainer") as ASPxComboBox; ASPxLabel lbl_ContIndex = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_ContIndex") as ASPxLabel; ASPxDateEdit date_ScheduleDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleDate") as ASPxDateEdit; ASPxTextBox txt_SealNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "txt_SealNo") as ASPxTextBox; ASPxComboBox cbbContType = this.grid.FindRowCellTemplateControl(rowIndex, null, "cbbContType") as ASPxComboBox; ASPxDateEdit date_CustomsClearDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_CustomsClearDate") as ASPxDateEdit; ASPxComboBox cmb_CustomsClearStatus = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsClearStatus") as ASPxComboBox; ASPxComboBox cmb_CustomsVerifyInd = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsVerifyInd") as ASPxComboBox; ASPxDateEdit date_CustomsVerifyDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_CustomsVerifyDate") as ASPxDateEdit; ASPxMemo memo_CustomsRemark = this.grid.FindRowCellTemplateControl(rowIndex, null, "memo_CustomsRemark") as ASPxMemo; ASPxDateEdit date_ValiDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ValiDate") as ASPxDateEdit; ASPxDateEdit date_ScheduleStartDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleStartDate") as ASPxDateEdit; ASPxDateEdit date_BillingDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_BillingDate") as ASPxDateEdit; ASPxDateEdit date_DispatchDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_DispatchDate") as ASPxDateEdit; ASPxDateEdit date_EtaDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_EtaDate") as ASPxDateEdit; e.Result = update_cont(SafeValue.SafeInt(lbl_Id.Text, 0), lbl_JobNo.Text, txt_ContNo.Text, txt_SealNo.Text, cbbContType.Text, date_ScheduleDate.Date, lbl_ContIndex.Text, cmb_CustomsClearStatus.Text, date_CustomsClearDate.Date, cmb_CustomsVerifyInd.Text, date_CustomsVerifyDate.Date, memo_CustomsRemark.Text, date_ValiDate.Date, date_ScheduleStartDate.Date, date_BillingDate.Date, date_DispatchDate.Date, date_EtaDate.Date); #endregion } if (ar[0].Equals("Ediline")) { #region ASPxGridView grid = sender as ASPxGridView; int rowIndex = SafeValue.SafeInt(ar[1], -1); ASPxLabel lbl_JobId = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobId") as ASPxLabel; ASPxComboBox cmb_CustomsClearStatus = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsClearStatus") as ASPxComboBox; ASPxComboBox cmb_CustomsVerifyInd = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsVerifyInd") as ASPxComboBox; if (SafeValue.SafeString(cmb_CustomsClearStatus.Value) == "Y") { e.Result = C2.Edi_Freight.DoOne(lbl_JobId.Text); DateTime now = DateTime.Now; string userId = HttpContext.Current.User.Identity.Name; Session["Export_" + now.ToString("yyyyMMdd") + userId] = null; } else { e.Result = "Edi Error! Pls confirm the Customs Clear Status"; } #endregion } } }
private void contCfsStatusChange(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e, int rowIndex, string CfsStatus) { if (rowIndex < 0) { e.Result = "Save Error"; return; } ASPxLabel lb_id = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lb_Id") as ASPxLabel; ASPxDateEdit txt_search_dateFrom = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_search_dateFrom") as ASPxDateEdit; ASPxTextBox date_ScheduleStartTime = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleStartTime") as ASPxTextBox; string res = "Save Error"; if (lb_id != null) { string sql0 = ""; string sql = string.Format(@"update CTM_JobDet2 set BookingDate=@BookingDate where Id=@Oid", sql0); List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>(); list.Add(new ConnectSql_mb.cmdParameters("@Oid", lb_id.Text, SqlDbType.Int)); list.Add(new ConnectSql_mb.cmdParameters("@BookingDate", txt_search_dateFrom.Date.ToString("yyyy-MM-dd"), SqlDbType.DateTime)); if (ConnectSql_mb.ExecuteNonQuery(sql, list).status) { res = "Save successful!"; //C2.CtmJobDet1.contWarehouseStatusChanged(SafeValue.SafeInt(lb_id.Text, 0)); } } e.Result = res; }
protected void grid_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { if (Request.QueryString["id"] != null) { int invId = SafeValue.SafeInt(Request.QueryString["id"], 0); int index = SafeValue.SafeInt(C2.Manager.ORManager.ExecuteScalar(string.Format("Select max(QuoteLineNo) FROM AirQuoteDet1 where QuoteId='{0}'", invId)), 1); for (int i = 0; i < list.Count; i++) { try { index++; int sequenceId = list[i].docId; string sql = string.Format(@"SELECT ChgCode, Currency,ExRate, Price, Unit, MinAmt, Rmk, Qty, Amt, GstType, Gst, GroupTitle, ChgDes FROM AirQuoteDet1 where SequenceId='{0}' order by QuoteLineNo", sequenceId); DataTable tab = C2.Manager.ORManager.GetDataSet(sql).Tables[0]; if (tab.Rows.Count == 1) { string chgCode = tab.Rows[0]["ChgCode"].ToString(); string chgDes = tab.Rows[0]["ChgDes"].ToString(); string currencyDes = tab.Rows[0]["Currency"].ToString(); decimal exRate = SafeValue.SafeDecimal(tab.Rows[0]["ExRate"], 1); decimal price = SafeValue.SafeDecimal(tab.Rows[0]["Price"], 0); string unit = tab.Rows[0]["Unit"].ToString(); decimal minAmt = SafeValue.SafeDecimal(tab.Rows[0]["MinAmt"], 0); decimal amt = SafeValue.SafeDecimal(tab.Rows[0]["Amt"], 0); string rmk = tab.Rows[0]["Rmk"].ToString(); decimal qty = SafeValue.SafeDecimal(tab.Rows[0]["Qty"], 1); decimal gst = SafeValue.SafeDecimal(tab.Rows[0]["Gst"], 0); string gstType = tab.Rows[0]["GstType"].ToString(); string groupTitle = SafeValue.SafeString(tab.Rows[0]["GroupTitle"], ""); AirQuoteDet1 det = new AirQuoteDet1(); det.Amt = amt; det.ChgCode = chgCode; det.ChgDes = chgDes; det.Currency = currencyDes; det.ExRate = exRate; det.GroupTitle = groupTitle; det.Gst = gst; det.GstType = gstType; det.MinAmt = minAmt; det.Price = price; det.Qty = qty; det.QuoteId = invId.ToString(); det.QuoteLineNo = index; det.Rmk = rmk; det.Unit = unit; C2.Manager.ORManager.StartTracking(det, Wilson.ORMapper.InitialState.Inserted); C2.Manager.ORManager.PersistChanges(det); } } catch { } } } else { e.Result = "Error, Pls refresh your invoice"; } }
protected void grid_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { if (Request.QueryString["Job"] != null && Request.QueryString["Sn"] != null) { string job = Request.QueryString["Job"].ToString(); string inv = Request.QueryString["Sn"].ToString(); for (int m = 0; m < list.Count; m++) { int id = list[m].docId; string sql = string.Format("select * from Ctm_Attachment where Id='{0}'", id); DataTable dt = D.List(sql); DataRow dr = dt.Rows[0]; C2.SeaAttachment photo = new C2.SeaAttachment(); photo.JobClass = "IV"; //Request.QueryString["Type"].ToString(); photo.FileName = S.Text(dr["FileName"]); photo.RefNo = inv; photo.JobNo = job; photo.FileNote = ""; photo.FileType = S.Text(dr["FileType"]); photo.FilePath = S.Text(dr["FilePath"]).Replace("http://tsl.cargoerp.com/Photos/", ""); photo.CreateBy = HttpContext.Current.User.Identity.Name; photo.CreateDateTime = DateTime.Now.ToLocalTime(); Manager.ORManager.StartTracking(photo, Wilson.ORMapper.InitialState.Inserted); Manager.ORManager.PersistChanges(photo); } } else { e.Result = "Error, Pls refresh your invoice"; } }
private string Save_Inline(int i, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { ASPxTextBox txt_Id = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "txt_Id") as ASPxTextBox; ASPxTextBox txt_ContNo = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContNo"], "txt_ContNo") as ASPxTextBox; ASPxComboBox cbbContType = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContType"], "cbbContType") as ASPxComboBox; ASPxSpinEdit spin_Price = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Price"], "spin_Price") as ASPxSpinEdit; ASPxTextBox txt_Unit = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Unit"], "txt_Unit") as ASPxTextBox; ASPxSpinEdit spin_Qty = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Qty"], "spin_Qty") as ASPxSpinEdit; ASPxSpinEdit spin_LineIndex = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["LineIndex"], "spin_LineIndex") as ASPxSpinEdit; ASPxComboBox cbb_ChgCode = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ChgCode"], "cbb_ChgCode") as ASPxComboBox; ASPxTextBox txt_ChgCodeDe = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ChgCodeDe"], "txt_ChgCodeDe") as ASPxTextBox; ASPxMemo txt_Remark = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Remark"], "txt_Remark") as ASPxMemo; ASPxTextBox txt_GroupBy = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["GroupBy"], "txt_GroupBy") as ASPxTextBox; int id = SafeValue.SafeInt(txt_Id.Text, 0); string contNo = ""; string contType = ""; decimal price = SafeValue.SafeDecimal(spin_Price.Value); decimal qty = SafeValue.SafeDecimal(spin_Qty.Value); string unit = SafeValue.SafeString(txt_Unit.Text); string code = SafeValue.SafeString(cbb_ChgCode.Text); string des = SafeValue.SafeString(txt_ChgCodeDe.Text); int lineIndex = SafeValue.SafeInt(spin_LineIndex.Value, 0); string remark = SafeValue.SafeString(txt_Remark.Text); decimal locAmt = SafeValue.ChinaRound(qty * SafeValue.SafeDecimal(price, 0), 2); string groupBy = SafeValue.SafeString(txt_GroupBy.Text); string sql = string.Format(@"update job_cost set ContNo='{0}',ContType='{1}',Price={2},Qty={3},LocAmt={4},Unit='{6}',ChgCode='{7}',ChgCodeDes='{8}',LineIndex={9},Remark='{10}',GroupBy='{11}' where Id={5}", contNo, contType, price, qty, locAmt, id, unit, code, des, lineIndex, remark, groupBy); ConnectSql.ExecuteSql(sql); return("Success"); }
private void contCfsStatusChange(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e, int rowIndex, string CfsStatus) { if (rowIndex < 0) { e.Result = "Save Error"; return; } ASPxLabel lb_id = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lb_Id") as ASPxLabel; ASPxDateEdit txt_search_dateFrom = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_search_dateFrom") as ASPxDateEdit; ASPxTextBox date_ScheduleStartTime = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleStartTime") as ASPxTextBox; ASPxLabel lb_StatusCode = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lb_StatusCode") as ASPxLabel; ASPxLabel lbl_JobNo = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lbl_JobNo") as ASPxLabel; ASPxLabel lbl_TripCode = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lbl_TripCode") as ASPxLabel; string res = "Save Error"; string StatusCode = ""; if (lb_id != null) { string sql0 = ""; if (CfsStatus == "Started") { sql0 = ",WarehouseStartDate=getdate()"; } if (CfsStatus == "Completed") { //sql0 = ",WarehouseEndDate=getdate(), StatusCode=@StatusCode"; sql0 = ",WarehouseEndDate=getdate()"; //if (lbl_TripCode.Text.Contains("WGR")) // StatusCode = "LCL-MT"; //if (lbl_TripCode.Text.Contains("WDO")) // StatusCode = "LCL-LD"; } if (CfsStatus == "Scheduled") { if (txt_search_dateFrom.Date > new DateTime(1900, 1, 1)) { //sql0 = ",WarehouseScheduleDate=@ScheduleStartDate,StatusCode=@StatusCode"; sql0 = ",WarehouseScheduleDate=@ScheduleStartDate"; StatusCode = lb_StatusCode.Text; } } string sql = string.Format(@"update CTM_JobDet2 set WarehouseStatus=@ContStatus{0} where Id=@Oid", sql0); List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>(); list.Add(new ConnectSql_mb.cmdParameters("@Oid", lb_id.Text, SqlDbType.Int)); list.Add(new ConnectSql_mb.cmdParameters("@ContStatus", CfsStatus, SqlDbType.NVarChar, 100)); list.Add(new ConnectSql_mb.cmdParameters("@StatusCode", StatusCode, SqlDbType.NVarChar, 100)); list.Add(new ConnectSql_mb.cmdParameters("@ScheduleStartDate", txt_search_dateFrom.Date.ToString("yyyy-MM-dd"), SqlDbType.DateTime)); list.Add(new ConnectSql_mb.cmdParameters("@ScheduleStartTime", date_ScheduleStartTime.Text, SqlDbType.NVarChar)); if (ConnectSql_mb.ExecuteNonQuery(sql, list).status) { res = "Save successful!"; //C2.CtmJobDet1.contWarehouseStatusChanged(SafeValue.SafeInt(lb_id.Text, 0)); } } e.Result = res; }
private void Update_Inline(DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string billType = SafeValue.SafeString(cbb_BillType.Value); string client = SafeValue.SafeString(Request.QueryString["client"]); string jobNo = SafeValue.SafeString(Request.QueryString["no"]); string sql = string.Format(@"select Price,ChgCode,ContType from job_rate where BillType='{0}' and ClientId='{1}'", billType, client); DataTable tab_dt = ConnectSql_mb.GetDataTable(sql); for (int i = 0; i < tab_dt.Rows.Count; i++) { #region string chgCode = SafeValue.SafeString(tab_dt.Rows[i]["ChgCode"]); string contType = SafeValue.SafeString(tab_dt.Rows[i]["ContType"]); decimal price = SafeValue.SafeDecimal(tab_dt.Rows[i]["Price"]); string sql_cost = ""; if (contType == "20HD" || contType == "40HD") { sql_cost = string.Format(@"select Id from job_cost where JobNo='{0}' and ChgCode='{1}' and ContType='{2}'", jobNo, chgCode, contType); } else if ((contType != "20HD" || contType != "40HD") && contType.Length > 0) { if (contType.Substring(0, 2) == "20") { sql_cost = string.Format(@"select Id from job_cost where JobNo='{0}' and ChgCode='{1}' and ContType!='20HD'", jobNo, chgCode); } if (contType.Substring(0, 2) == "40") { sql_cost = string.Format(@"select Id from job_cost where JobNo='{0}' and ChgCode='{1}' and ContType!='40HD'", jobNo, chgCode); } } else { sql_cost = string.Format(@"select Id from job_cost where JobNo='{0}' and ChgCode='{1}'", jobNo, chgCode); } DataTable dt_cost = ConnectSql.GetTab(sql_cost); for (int a = 0; a < dt_cost.Rows.Count; a++) { int id = SafeValue.SafeInt(dt_cost.Rows[a]["Id"], 0); List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>(); sql = string.Format(@"update job_cost set Price=@Price,LocAmt=1*@Price where Id=@Id"); #region list list = new List <ConnectSql_mb.cmdParameters>(); list.Add(new ConnectSql_mb.cmdParameters("@Id", id, SqlDbType.Int)); list.Add(new ConnectSql_mb.cmdParameters("@Price", price, SqlDbType.Decimal)); if (ConnectSql_mb.ExecuteNonQuery(sql, list).status) { e.Result = "Save Success"; } else { e.Result = "Save Error"; } #endregion } #endregion } }
protected void grid_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string paras = e.Parameters; string[] ar = paras.Split('_'); if (ar.Length >= 2) { if (ar[0].Equals("Saveline")) { #region ASPxGridView grid = sender as ASPxGridView; int rowIndex = SafeValue.SafeInt(ar[1], -1); ASPxLabel lbl_Id = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_Id") as ASPxLabel; ASPxLabel lbl_JobNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobNo") as ASPxLabel; ASPxComboBox txt_ContNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "cbbContainer") as ASPxComboBox; ASPxLabel lbl_ContIndex = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_ContIndex") as ASPxLabel; ASPxDateEdit date_ValiDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ValiDate") as ASPxDateEdit; ASPxDateEdit date_ScheduleStartDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleStartDate") as ASPxDateEdit; ASPxDateEdit date_ScheduleDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleDate") as ASPxDateEdit; ASPxTextBox txt_SealNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "txt_SealNo") as ASPxTextBox; ASPxComboBox cbbContType = this.grid.FindRowCellTemplateControl(rowIndex, null, "cbbContType") as ASPxComboBox; ASPxDateEdit date_CustomsClearDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_CustomsClearDate") as ASPxDateEdit; ASPxComboBox cmb_CustomsClearStatus = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsClearStatus") as ASPxComboBox; ASPxComboBox cmb_CustomsVerifyInd = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsVerifyInd") as ASPxComboBox; ASPxDateEdit date_CustomsVerifyDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_CustomsVerifyDate") as ASPxDateEdit; ASPxMemo memo_CustomsRemark = this.grid.FindRowCellTemplateControl(rowIndex, null, "memo_CustomsRemark") as ASPxMemo; e.Result = update_cont(SafeValue.SafeInt(lbl_Id.Text, 0), lbl_JobNo.Text, txt_ContNo.Text, txt_SealNo.Text, cbbContType.Text, date_ScheduleDate.Date, lbl_ContIndex.Text, cmb_CustomsClearStatus.Text, date_CustomsClearDate.Date, cmb_CustomsVerifyInd.Text, date_CustomsVerifyDate.Date, memo_CustomsRemark.Text, date_ValiDate.Date, date_ScheduleStartDate.Date); #endregion } if (ar[0].Equals("Ediline")) { #region EDI ASPxGridView grid = sender as ASPxGridView; int rowIndex = SafeValue.SafeInt(ar[1], -1); ASPxLabel lbl_JobId = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobId") as ASPxLabel; ASPxLabel lbl_JobNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobNo") as ASPxLabel; string sql = string.Format(@"select count(*) from ctm_jobdet1 where JobNo='{0}' and (CustomsClearStatus='NO' or CustomsClearStatus is null) and CustomsClearDate<'19000101'", lbl_JobNo.Text); int n = SafeValue.SafeInt(ConnectSql_mb.ExecuteScalar(sql), 0); if (n == 0) { e.Result = C2.Edi_Freight.DoOne(lbl_JobId.Text); DateTime now = DateTime.Now; string userId = HttpContext.Current.User.Identity.Name; } else { e.Result = "Edi Error! Pls confirm the Customs Clear Status"; } #endregion } } }
protected void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string s = e.Parameters; string value = SafeValue.SafeString(e.Result); if (s == "Save") { CreateSO(value); } }
private void Update_Inline(DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e, int rowIndex) { if (rowIndex < 0) { e.Result = "Save Error"; return; } #region ASPxTextBox txt_cntId = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_cntId") as ASPxTextBox; ASPxSpinEdit spin_fee1 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "spin_fee1") as ASPxSpinEdit; ASPxTextBox txt_feeNote1 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_feeNote1") as ASPxTextBox; ASPxSpinEdit spin_fee3 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "spin_fee3") as ASPxSpinEdit; ASPxTextBox txt_feeNote3 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_feeNote3") as ASPxTextBox; ASPxSpinEdit spin_fee5 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "spin_fee5") as ASPxSpinEdit; ASPxTextBox txt_feeNote5 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_feeNote5") as ASPxTextBox; ASPxSpinEdit spin_fee6 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "spin_fee6") as ASPxSpinEdit; ASPxTextBox txt_feeNote6 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_feeNote6") as ASPxTextBox; ASPxSpinEdit spin_fee12 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "spin_fee12") as ASPxSpinEdit; ASPxTextBox txt_feeNote12 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_feeNote12") as ASPxTextBox; ASPxSpinEdit spin_fee13 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "spin_fee13") as ASPxSpinEdit; ASPxTextBox txt_feeNote13 = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_feeNote13") as ASPxTextBox; #endregion List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>(); string sql = string.Format(@"update CTM_JobDet1 set Fee1=@Fee1,FeeNote1=@FeeNote1,Fee3=@Fee3,FeeNote3=@FeeNote3,Fee5=@Fee5,FeeNote5=@FeeNote5,Fee6=@Fee6,FeeNote6=@FeeNote6,Fee12=@Fee12,FeeNote12=@FeeNote12,Fee13=@Fee13,FeeNote13=@FeeNote13 where Id=@Id"); #region list list = new List <ConnectSql_mb.cmdParameters>(); list.Add(new ConnectSql_mb.cmdParameters("@Id", txt_cntId.Text, SqlDbType.Int)); list.Add(new ConnectSql_mb.cmdParameters("@Fee1", SafeValue.SafeDecimal(spin_fee1.Value, 0), SqlDbType.Decimal)); list.Add(new ConnectSql_mb.cmdParameters("@Fee3", SafeValue.SafeDecimal(spin_fee3.Value), SqlDbType.Decimal)); list.Add(new ConnectSql_mb.cmdParameters("@Fee5", SafeValue.SafeDecimal(spin_fee5.Value), SqlDbType.Decimal)); list.Add(new ConnectSql_mb.cmdParameters("@Fee6", SafeValue.SafeDecimal(spin_fee6.Value), SqlDbType.Decimal)); list.Add(new ConnectSql_mb.cmdParameters("@Fee12", SafeValue.SafeDecimal(spin_fee12.Value), SqlDbType.Decimal)); list.Add(new ConnectSql_mb.cmdParameters("@Fee13", SafeValue.SafeDecimal(spin_fee13.Value), SqlDbType.Decimal)); list.Add(new ConnectSql_mb.cmdParameters("@FeeNote1", SafeValue.SafeString(txt_feeNote1.Text), SqlDbType.NVarChar)); list.Add(new ConnectSql_mb.cmdParameters("@FeeNote3", SafeValue.SafeString(txt_feeNote3.Text), SqlDbType.NVarChar)); list.Add(new ConnectSql_mb.cmdParameters("@FeeNote5", SafeValue.SafeString(txt_feeNote5.Text), SqlDbType.NVarChar)); list.Add(new ConnectSql_mb.cmdParameters("@FeeNote6", SafeValue.SafeString(txt_feeNote6.Text), SqlDbType.NVarChar)); list.Add(new ConnectSql_mb.cmdParameters("@FeeNote12", SafeValue.SafeString(txt_feeNote12.Text), SqlDbType.NVarChar)); list.Add(new ConnectSql_mb.cmdParameters("@FeeNote13", SafeValue.SafeString(txt_feeNote13.Text), SqlDbType.NVarChar)); #endregion if (ConnectSql_mb.ExecuteNonQuery(sql, list).status) { e.Result = "Save Success"; } else { e.Result = "Save Error"; } }
protected void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { int rowIndex = int.Parse(e.Parameters); string itemCode = ASPxGridView1.GetRowValues(rowIndex, "ITEM_CODE") as string; string itemQTY = ASPxGridView1.GetRowValues(rowIndex, "ITEM_QTY").ToString(); string resourceStore = ASPxGridView1.GetRowValues(rowIndex, "STORE_CODE") as string; string result = itemCode + "," + itemQTY + "," + resourceStore; e.Result = result; }
public void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string s = e.Parameters; string[] s1 = s.Split('|'); string type1 = s1[0]; int rowIndex = int.Parse(s1[1]); //string sn="",xmdm="",fdjxl="",xmmc="",RunValue="",sj1="",sj2="",zdmc=""; ASPxGridView atl1 = (ASPxGridView)sender; int count1 = atl1.Selection.Count; List <object> aa = atl1.GetSelectedFieldValues("SN"); string xmdm = ASPxGridView1.GetRowValues(rowIndex, "DETECT_CODE").ToString(); string fdjxl = ASPxGridView1.GetRowValues(rowIndex, "PRODUCT_SERIES").ToString(); string xmmc = ASPxGridView1.GetRowValues(rowIndex, "DETECT_NAME").ToString(); string RunValue = ASPxGridView1.GetRowValues(rowIndex, "WORK_TIME").ToString(); string sj1 = ASPxGridView1.GetRowValues(rowIndex, "DETECT_VALUE").ToString(); string sj2 = ASPxGridView1.GetRowValues(rowIndex, "DETECT_VALUE").ToString(); string zdmc = ASPxGridView1.GetRowValues(rowIndex, "STATION_NAME").ToString(); string sn = ASPxGridView1.GetRowValues(rowIndex, "SN").ToString(); string rmesid = ASPxGridView1.GetRowValues(rowIndex, "RMES_ID").ToString(); switch (type1) { case "Treated": for (int i = 0; i < count1; i++) { //取消确认 string sql7 = " update DATA_SN_DETECT_QUERY set USER_ID='" + theUserId + "',DETECT_TIME=SYSDATE, DETECT_FLAG='N' WHERE SN ='" + aa[i] + "'"; dc.ExeSql(sql7); } break; case "Untreated": for (int i = 0; i < count1; i++) { //进行确认 string sql6 = "UPDATE DATA_SN_DETECT_QUERY SET USER_ID='" + theUserId + "',DETECT_TIME=SYSDATE,DETECT_FLAG='Y' where SN = '" + aa[i] + "' "; dc.ExeSql(sql6); } break; default: break; } ASPxGridView1.JSProperties.Add("cpCallbackName", "refresh"); }
protected void grd_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string trxNo = e.Parameters; if (trxNo.Length > 2 && (trxNo.Substring(0, 2) == "BP")) { string doctype = trxNo.Substring(2, 3); string docnos = trxNo.Substring(5); string ret = DoBatch(docnos, doctype); e.Result = ret; } }
protected void grid_Price_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { ASPxTextBox txt_DoNo = grid_Price.FindEditFormTemplateControl("txt_DoNo") as ASPxTextBox; string s = e.Parameters; if (s == "Save") { #region Save SavePrice(); e.Result = "Save"; #endregion } }
protected void grid_Transport_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string temp = e.Parameters; string[] ar = temp.Split('_'); if (ar.Length == 3) { if (ar[0] == "UpdateInlineStatus") { contCfsStatusChange(sender, e, SafeValue.SafeInt(ar[1], -1), ar[2]); } } }
protected void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string s = e.Parameters; if (s == "ClosePeriod") { e.Result = AccClose.ClosePeriod(true); } else if (s == "OpenPeriod") { e.Result = AccClose.OpenPeriod(true); } }
public void ASPxGridView1_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string s = e.Parameters; string[] s1 = s.Split('|'); string type1 = s1[0]; int rowIndex = int.Parse(s1[1]); string sql = ""; string rmesid, planseq, begindate, plinecode1; try { rmesid = gridMaterial.GetRowValues(rowIndex, "ITEM_CODE").ToString(); planseq = gridMaterial.GetRowValues(rowIndex, "NEWPART").ToString(); begindate = gridMaterial.GetRowValues(rowIndex, "ITEM_QTY").ToString(); plinecode1 = gridMaterial.GetRowValues(rowIndex, "LOCATION_CODE") as string; } catch { e.Result = "Fail,缺少关键值!"; return; } return; switch (type1) { case "Up": sql = "select max(plan_seq) from data_plan where begin_date=to_date('" + begindate + "','yyyy-mm-dd') and plan_seq<'" + planseq + "' and pline_code='" + plinecode1 + "' and plan_type='A'"; dc.setTheSql(sql); string planseq1 = dc.GetTable().Rows[0][0].ToString(); if (dc.GetTable().Rows.Count == 0 || planseq1 == "") { e.Result = "Fail,当前已最小序!"; break; } sql = "update data_plan set plan_seq='" + planseq + "' where plan_seq='" + planseq1 + "' and begin_date=to_date('" + begindate + "','yyyy-mm-dd') and pline_code='" + plinecode1 + "' and plan_type='A' "; dc.ExeSql(sql); sql = "update data_plan set plan_seq='" + planseq1 + "' where rmes_id='" + rmesid + "' "; dc.ExeSql(sql); //e.Result = "OK,上调成功!"; break; default: break; } }
protected void grid_Transport_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string pars = e.Parameters; string[] ar = pars.Split('_'); if (ar.Length >= 2) { if (ar[0].Equals("UpdateInline")) { Update_Inline(e, SafeValue.SafeInt(ar[1], -1)); } if (ar[0].Equals("CreateInvline")) { Create_Invoice(e, SafeValue.SafeInt(ar[1], -1)); } } }
protected void grid_Price_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { ASPxTextBox txt_DoNo = grid_Price.FindEditFormTemplateControl("txt_DoNo") as ASPxTextBox; string s = e.Parameters; if (s == "Save") { #region Save //if (txt_DoNo.Text.Length > 4) //{ // SavePrice(); // e.Result = "";//update old one //} //else // e.Result = SavePrice();// new one #endregion } }
protected void grid_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { if (Request.QueryString["id"] != null && Request.QueryString["typ"] != null) { string ItvRec = Request.QueryString["typ"].ToString(); int mastId = SafeValue.SafeInt(Request.QueryString["id"], 0); for (int i = 0; i < list.Count; i++) { try { int detId = list[i].detId; string sql = ""; sql = string.Format(@"select Id from Hr_Person where Id='{0}'", detId); DataTable tab = C2.Manager.ORManager.GetDataSet(sql).Tables[0]; if (tab.Rows.Count == 1) { Wilson.ORMapper.OPathQuery query = new Wilson.ORMapper.OPathQuery(typeof(HrPerson), "Id='" + detId + "'"); HrPerson person = C2.Manager.ORManager.GetObject(query) as HrPerson; string newItvRecId = "<" + mastId + ">"; if (ItvRec.ToLower() == "recruitment" && !person.RecruitId.Contains(newItvRecId)) { person.RecruitId = person.RecruitId + newItvRecId; } if (ItvRec.ToLower() == "interview" && !person.InterviewId.Contains(newItvRecId)) { person.InterviewId = person.InterviewId + newItvRecId; } C2.Manager.ORManager.StartTracking(person, Wilson.ORMapper.InitialState.Updated); C2.Manager.ORManager.PersistChanges(person); } } catch { } } } else { e.Result = "Error, Pls refresh your Interview and Recruitment"; } }
protected void grid_Transport_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string pars = e.Parameters; string[] ar = pars.Split('_'); if (ar.Length >= 2) { if (ar[0].Equals("CreateInvline")) { int rowIndex = SafeValue.SafeInt(ar[1], -1); ASPxLabel lbl_JobNo = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lbl_JobNo") as ASPxLabel; ASPxLabel lbl_ClientId = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lbl_ClientId") as ASPxLabel; TextBox txt_cntId = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_cntId") as TextBox; ASPxLabel lbl_JobType = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lbl_JobType") as ASPxLabel; e.Result = lbl_JobNo.Text + "_" + lbl_JobType.Text + "_" + lbl_ClientId.Text; } } }
protected void grid_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { if (Request.QueryString["mId"] != null) { int mastId = SafeValue.SafeInt(Request.QueryString["mId"], 0); for (int i = 0; i < list.Count; i++) { try { int detId = list[i].detId; string des = list[i].des; decimal amt = list[i].amt; string sql = string.Format("SELECT PayItem FROM Hr_Quote where Id='{0}'", detId); DataTable tab = C2.Manager.ORManager.GetDataSet(sql).Tables[0]; if (tab.Rows.Count == 1) { HrPayrollDet rollDet = new HrPayrollDet(); string chgCode = SafeValue.SafeString(tab.Rows[0]["PayItem"], ""); rollDet.PayrollId = mastId; rollDet.ChgCode = chgCode; rollDet.Description = des; rollDet.Amt = amt; C2.Manager.ORManager.StartTracking(rollDet, Wilson.ORMapper.InitialState.Inserted); C2.Manager.ORManager.PersistChanges(rollDet); } UpdateMaster(mastId); } catch { } } } else { e.Result = "Error, Pls refresh your Interview and Recruitment"; } }
protected void grid_Issue_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { ASPxPageControl pageControl = this.grid_Issue.FindEditFormTemplateControl("pageControl_Hbl") as ASPxPageControl; ASPxTextBox txt_DoNo = grid_Issue.FindEditFormTemplateControl("txt_DoNo") as ASPxTextBox; ASPxButtonEdit txt_WareHouseId = grid_Issue.FindEditFormTemplateControl("txt_WareHouseId") as ASPxButtonEdit; ASPxButtonEdit txt_CustomerId = grid_Issue.FindEditFormTemplateControl("txt_CustomerId") as ASPxButtonEdit; string s = e.Parameters; if (s == "Save") { #region Save //if (txt_CustomerId.Text.Trim() == "") //{ // e.Result = "Fail! Please enter the Customer"; // return; //} //ASPxComboBox doStatus = grid_Issue.FindEditFormTemplateControl("cmb_Status") as ASPxComboBox; //if (doStatus.Text == "Job Confirmation") //{ // //check purchase price and sell price // string sql = string.Format(@"select count(SequenceId) from Cost where RefNo='{0}'", txt_DoNo.Text); // if (SafeValue.SafeInt(ConnectSql.ExecuteScalar(sql), 0) == 0) // { // e.Result = "Fail!No Costing"; // return; // } //} if (txt_DoNo.Text.Length > 4) { SaveJob(); e.Result = "";//update old one } else { e.Result = SaveJob();// new one } #endregion } }
public void ASPxGridView2_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string s = e.Parameters; string[] s1 = s.Split('|'); string type1 = s1[0]; int rowIndex = int.Parse(s1[1]); string rmesid = ASPxGridView2.GetRowValues(rowIndex, "RMES_ID").ToString(); switch (type1) { case "Treated2": string sql = "update DATA_SN_BOM_TEMP set CONFIRM_FLAG='N' where rmes_id='" + rmesid + "'"; dc.ExeSql(sql); string sql2 = "delete from DATA_SN_BOM where rmes_id = '" + rmesid + "' "; dc.ExeSql(sql2); break; case "Untreated2": string sql4 = "insert into DATA_SN_BOM select * from DATA_SN_BOM_TEMP WHERE RMES_ID= '" + rmesid + "'"; dc.ExeSql(sql4); string sql5 = "delete from DATA_SN_BOM_TEMP where rmes_id = '" + rmesid + "' "; dc.ExeSql(sql5); break; default: break; } }
protected void grid_Issue_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { ASPxPageControl pageControl = this.grid_Issue.FindEditFormTemplateControl("pageControl_Hbl") as ASPxPageControl; ASPxTextBox txt_DoNo = grid_Issue.FindEditFormTemplateControl("txt_DoNo") as ASPxTextBox; ASPxButtonEdit txt_WareHouseId = grid_Issue.FindEditFormTemplateControl("txt_WareHouseId") as ASPxButtonEdit; ASPxButtonEdit txt_CustomerId = grid_Issue.FindEditFormTemplateControl("txt_CustomerId") as ASPxButtonEdit; string s = e.Parameters; if (s == "Save") { #region Save if (txt_CustomerId.Text.Trim() == "") { e.Result = "Fail! Please enter the Customer"; return; } else { e.Result = SaveJob(); } #endregion } }
protected void grid_Transport_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string temp = e.Parameters; string[] ar = temp.Split('_'); if (ar.Length == 3) { if (ar[0] == "UpdateInlineStatus") { contCfsStatusChange(sender, e, SafeValue.SafeInt(ar[1], -1), ar[2]); } } if (temp == "OK") { if (list.Count > 0) { string sql = " "; List <ConnectSql_mb.cmdParameters> list_cmd = new List <ConnectSql_mb.cmdParameters>(); for (int i = 0; i < list.Count; i++) { int _id = list[i].id; DateTime _date = list[i].date; string _time = list[i].time; string sql_part = string.Format(@"update CTM_JobDet2 set WarehouseScheduleDate='{1}',FromTime='{2}',WarehouseStatus='Scheduled' where Id={0}", _id, _date, _time); sql = sql + sql_part; } if (sql.Length > 0) { int res = ConnectSql_mb.ExecuteNonQuery(sql); if (res > 0) { e.Result = "Success"; } } } } }
protected void grid_Issue_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { ASPxPageControl pageControl = this.grid_Issue.FindEditFormTemplateControl("pageControl_Hbl") as ASPxPageControl; ASPxTextBox txt_DoNo = grid_Issue.FindEditFormTemplateControl("txt_DoNo") as ASPxTextBox; ASPxButtonEdit txt_WareHouseId = grid_Issue.FindEditFormTemplateControl("txt_WareHouseId") as ASPxButtonEdit; ASPxButtonEdit txt_CustomerId = grid_Issue.FindEditFormTemplateControl("txt_CustomerId") as ASPxButtonEdit; string s = e.Parameters; if (s == "Save") { #region Save if (txt_DoNo.Text.Length > 4) { SaveJob(); e.Result = "";//update old one } else { e.Result = SaveJob();// new one } #endregion } }