protected void ASPxCbSubmit_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { char[] charSeparators = new char[] { ',' }; string[] collection = e.Parameter.Split(charSeparators); string p = collection[0].ToString(); string code = collection[1].ToString(); string sql = "", strName; switch (p) { case "checkOld": sql = "select item_name from data_xk_oldbom where item_code='" + code + "'"; dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { e.Result = "noOldCode," + code;; } else { strName = dt.Rows[0][0].ToString(); e.Result = "oldCode," + strName; } break; } }
protected void ASPxCallback1_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { e.Result = ParseStringNumber(totalAsset.ToString()) + "||" + ParseStringNumber(totalLiability.ToString()) + "||" + ParseStringNumber(totalEquity.ToString()) + "||" + ParseStringNumber((totalLiability + totalEquity).ToString()); }
protected void CallbackTest_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { String index = e.Parameter; MFCustomer cus = (MFCustomer)GridCustomer.GetRow(int.Parse(index)); Session["CurrentParty"] = cus.Party.PartyID; }
protected void cbChequeNo_Callback(object sender, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { Cheque c = FindByChequeNo(iSabayaContext, e.Parameter); Payment payment = null; if (FindBankDepositByChequeID(c).Count > 0) { foreach (BankDeposit item in FindBankDepositByChequeID(c)) { payment = item; break; } } else if (FindBillPaymentByChequeID(c).Count > 0) { foreach (BillPayment item in FindBillPaymentByChequeID(c)) { payment = item; break; } } if (payment != null) { String amount4show = string.Format("เงินคงเหลือ : {0:n3}", payment.RemainingAmount(iSabayaContext).ToString()); e.Result = c.Amount.Amount.ToString() + ";" + payment.RemainingAmount(iSabayaContext).Amount.ToString() + ";" + amount4show + ";" + c.Bank.Code + ";" + c.Bank.OrganizationID; } else { e.Result = "new"; } }
protected void cb1_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { String input = e.Parameter; string[] inputs = input.Split(','); if (inputs[0] == "null") { e.Result = "กรุณาใส่ รหัสธนาคาร และ เลขที่บัญชี "; } else { int BankID = Convert.ToInt32(inputs[0]); String accountID = inputs[1]; BankAccount bankaccount = BankAccount.Find(iSabayaContext, BankID, accountID); if (bankaccount != null) { e.Result = bankaccount.Bank.CurrentName.ToString(this.LanguageCode) + " สาขา: " + bankaccount.Branch.CurrentName.ToString(this.LanguageCode) + " [" + bankaccount.AccountNo + "] " + bankaccount.AccountName.ToString(); } else { e.Result = "ไม่พบบัญชี!"; } } }
protected void cbSelectedChequeBatchItem_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { int index = int.Parse(e.Parameter); ChequeBatchItem vo = (ChequeBatchItem)gridChequeBatchItems.GetRow(index); Session["ctrls_ChequeBatchItemControl_SelectedChequeBatchItem"] = vo; }
protected void cb_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { String[] p = e.Parameter.Split('|'); Boolean active = Convert.ToBoolean(p[1]); // if e.isAllRecordsOnPage is true (perform batch update) if (p[0] == "null") { UnitOfWork uow = XpoHelper.GetNewUnitOfWork(); XPCollection <MyObject> collection = new XPCollection <MyObject>(uow); foreach (MyObject obj in collection) { obj.Active = active; } uow.Save(collection); uow.CommitChanges(); } else { MyObject obj = session.GetObjectByKey <MyObject>(Convert.ToInt32(p[0])); // get the record from the Session obj.Active = active; obj.Save(); } }
protected void ASPxCbSubmit_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { string collection = e.Parameter; try { if (collection == "Clear") { string strPCode = combPcode.Text.Trim().ToUpper(); if (strPCode == "") { e.Result = "Fail,请选择要清零的生产线!"; return; } else { string chSql = "update ms_over_mat set material_num=0 where gzdd='" + strPCode + "'"; DataTable dt = dc.GetTable(chSql); string Sql = "insert into ms_over_mat_log(material_code,material_num,log_time,gzdd,gys_code,bill_code,log_user,qadsite) values('SYSTEM','0',sysdate,'" + strPCode + "','SYSTEM','置所有零件数量为0','" + theUserCode + "','SYSTEM')"; DataTable dt1 = dc.GetTable(Sql); } e.Result = "OK,已将" + strPCode + "生产线的数量清零"; } } catch (Exception e1) { e.Result = "Fail,提交失败" + e1.Message + "!"; return; } setCondition(); }
protected void cbAddOldPayment_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { ISession session = PersistenceLayer.WebSessionManager.PersistenceSession; Cheque payment = ChequeTextBoxControl1.Cheque; if (payment == null) { throw new Exception(String.Format("Not found cheque no : {0} ", ChequeTextBoxControl1.TxtChequeNo)); } VOPaymethodGrid vo = new VOPaymethodGrid(); if (Helper.VoPaymentLines.Count == 0) { vo.LineNo = 1; } else { vo.LineNo = Helper.VoPaymentLines[Helper.VoPaymentLines.Count - 1].LineNo + 1; } decimal amountForThisTransaction = ChequeTextBoxControl1.UseAmount; payment.AmountForThisTransaction = amountForThisTransaction; vo.Cheque = payment; Helper.VoPaymentLines.Add(vo); }
protected void callback_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { UserControl ctrl = cbpTop.FindControl("topgrid") as UserControl; ASPxGridView grid1 = ctrl.FindControl("grid1") as ASPxGridView; e.Result = grid1.VisibleRowCount.ToString(); }
/*Callback from card search*/ protected void ASPxCallback1_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { ISession session = PersistenceLayer.WebSessionManager.PersistenceSession; TreeListNode identityCategory = ComboTLNCardType.SelectedNode; String identityNo = TextCardCode.Text; String type = (String)ComboIPartyType.SelectedItem.Value; if (type.Equals("O")) { } else if (type.Equals("P")) { Person person = Person.FindByPartyIdentity(iSabayaContext, identityCategory, identityNo); if (person != null) { Session[this.ID + "ctrls_CustomerControl_CurrentParty"] = person.PersonID; e.Result = person.FullName; } else { Session[this.ID + "ctrls_CustomerControl_CurrentParty"] = null; e.Result = ""; } } if (TextLostFocus != null) { TextLostFocus(this, EventArgs.Empty); } }
protected void callback_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { grid.DataBind(); Dictionary <int, string> dictionary = Session["layout"] as Dictionary <int, string>; if (dictionary != null) { if (grid.GetGroupedColumns().Count == 0) { Session["fields"] = string.Empty; Session["rowscount"] = 0; return; } dictionary.Clear(); for (int i = 0; i < grid.VisibleRowCount; i++) { if (grid.IsGroupRow(i) && grid.IsRowExpanded(i)) { dictionary[i] = "Saved"; } } Session["rowscount"] = grid.VisibleRowCount; ReadOnlyCollection <GridViewDataColumn> cols = grid.GetGroupedColumns() as ReadOnlyCollection <GridViewDataColumn>; StringBuilder sb = new StringBuilder(); foreach (GridViewDataColumn item in cols) { sb.Append(item.FieldName); sb.Append(';'); } sb.Remove(sb.Length - 1, 1); Session["fields"] = sb.ToString(); } }
/*Callback from name search*/ protected void likeCustomerNameCallback_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { IList <Employer> accounts = this.FindLikeByName(iSabayaContext.PersistencySession, txtFirstName.Text); Session[this.GetType().ToString() + "GridEmployer"] = GetVOEmployerList(accounts); GridCustomer.DataSource = Session[this.GetType().ToString() + "GridEmployer"]; GridCustomer.DataBind(); }
protected void cbTest_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { Session[this.GetType().ToString() + "GridEmployer"] = cboAccountNo.DataSource; cboAccountNo.ValueField = "EmployerID"; cboAccountNo.TextField = "OrganizationCode"; cboAccountNo.DataBind(); GridCustomer.DataSource = cboAccountNo.DataSource; GridCustomer.DataBind(); }
protected void OnCallback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { // DEMO System.Threading.Thread.Sleep(100); string text = e.Parameter; e.Result = GetValueByText(text); }
protected void cbFindEmployer_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { int id = int.Parse(e.Parameter); IList <Member> employees = this.FindByEmployer(iSabayaContext.PersistencySession, id); GridCustomer.DataSource = employees; GridCustomer.DataBind(); Session[this.GetType().ToString() + "GridEmployee"] = employees; }
protected void cbSendAcc_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { //String code = e.Parameter; //Member customer = Member.FindByEmployeeNo(iSabayaContext.PersistencySession, code); //if (customer != null) //{ // e.Result = customer.Name.ToString("th"); //} }
/*Callback from name search*/ protected void likeCustomerNameCallback_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { IList <Member> employees = this.FindLikeByName(ASPxRadioButtonList1.SelectedIndex, txtFirstName.Text); GridCustomer.DataSource = employees; GridCustomer.DataBind(); Session[this.GetType().ToString() + "GridEmployee"] = employees; }
/*Callback from name search*/ protected void likeCustomerNameCallback_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { IList <Employer> employers = Employer.ListEffectiveEmployers(iSabayaContext); cboAccountNo.DataSource = employers; cboAccountNo.ValueField = "EmployerID"; cboAccountNo.TextField = "OrganizationCode"; cboAccountNo.DataBind(); }
protected void cbAccountDirectDebit_Callback(object sender, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { string accountNo = bteDirectdebit.Text; Organization o = BankControl1.Organization; BankAccount ba = BankAccount.FindByAccountNoAndBankCode(iSabayaContext, accountNo, o); e.Result = (ba == null ? "ไม่พบบัญชี" : e.Result = ba.Bank.CurrentName.Name.ToString(this.LanguageCode) + ba.Branch.CurrentName.ToString(this.LanguageCode)); }
protected void cbSendAcc_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { String code = e.Parameter; MFCustomer customer = MFCustomer.FindByCustomerNo(iSabayaContext, code); if (customer != null) { e.Result = customer.FullName; } }
protected void cb_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { String[] p = e.Parameter.Split('|'); MyObject obj = session.GetObjectByKey <MyObject>(Convert.ToInt32(p[0])); // get the record from the Session obj.Active = Convert.ToBoolean(p[1]); obj.Save(); }
protected void ASPxCbSubmit_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { string PicUrl = e.Parameter; Response.Write("<script type='text/javascript'>window.open('Rmes/EpdDcec/epdProcessNote/epdPic.aspx?Pic=" + PicUrl + "');</script>"); //Response.Write("<script type='text/javascript'>location.href='../epdProcessNote/epdPic.aspx?Pic=" + PicUrl + "';</script>"); //Response.Write("<script>window.opener.location.href = '../epdProcessNote/epdProcessNote.aspx';</script>"); //window.open('/Rmes/EpdDcec/epdProcessNote/epdPic.aspx?Pic=' + Pics); //Response.Write("<script>window.opener.location.href = '../epdProcessNote/epdProcessNote.aspx';</script>"); }
protected void cbSelectedIndexChnage_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) {//var rowIndex = gridPassword.GetFocusedRowIndex(); if (e.Parameter.Length != 0) { int index = int.Parse(e.Parameter); MFAccount account = (MFAccount)gridAccountOutput.GetRow(index); Session[this.ID + "SelectedAccount"] = account; } }
protected void cbSendAcc_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { String code = e.Parameter; Employer customer = Employer.FindByEmployerNo(iSabayaContext, code); if (customer != null) { e.Result = customer.Name.ToString(iSabayaContext.CurrentLanguage.Code); } }
protected void cbSendAcc_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { String code = e.Parameter; MFAccount customer = MFAccount.FindByAccountNo(iSabayaContext, code); if (customer != null) { e.Result = customer.Name.ToString(this.LanguageCode); } }
protected void ASPxCbSubmit_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { string oFlag, pline, sn; char[] charSeparators = new char[] { ',' }; string[] collection = e.Parameter.Split(charSeparators); int cnt = collection.Length; oFlag = collection[0].ToString(); pline = collection[1].ToString(); if (oFlag == "ADD") { //获取流水号 List <string> s = new List <string>(); for (int i = 2; i < cnt; i++) { s.Add(collection[i].ToString()); } string[] s1 = s.ToArray(); for (int i = 0; i < s1.Length; i++) { sn = s1[i].ToString(); string inSqlTemp = "UPDATE DATA_SN_BOM_TEMP_SNTEMP SET FLAG = 'ADD' WHERE SN = '" + sn + "' AND PLINE_CODE = '" + pline + "' "; dc.ExeSql(inSqlTemp); } e.Result = "OK,增加成功!"; return; } if (oFlag == "DEL") { //获取流水号 List <string> s = new List <string>(); for (int i = 2; i < cnt; i++) { s.Add(collection[i].ToString()); } string[] s1 = s.ToArray(); //if (ASPxGridView3.Selection.Count == 0) //{ // e.Result = "Fail,请选择要增加的流水号!"; // return; //} for (int i = 0; i < s1.Length; i++) { sn = s1[i].ToString(); string inSqlTemp = "UPDATE DATA_SN_BOM_TEMP_SNTEMP SET FLAG = 'DEL' WHERE SN = '" + sn + "' AND PLINE_CODE = '" + pline + "' "; dc.ExeSql(inSqlTemp); } e.Result = "OK,增加成功!"; return; } }
protected void Callbacker_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { switch (e.Parameter) { case "Save": { Save(); break; } } }
protected void cbSelect_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { int rowIndex = int.Parse(e.Parameter); MFCustomer customer = (MFCustomer)GridCustomer.GetRow(rowIndex); if (customer != null) { Session[this.ID + this.GetType().ToString() + "SelectedRow"] = customer.CustomerID; txtMFCustomerNo.Text = customer.CustomerNo; e.Result = customer.CustomerNo; } }
protected void callback_SetDefaultDashboard_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { try { if (string.IsNullOrEmpty(e.Parameter)) { return; } MyBI.Me.Set_DashboardDefault(e.Parameter); } catch { } }