void ucSaleSearchToBill_EventChoose(DataRow currentrow) { Result res = new Result(); try { tabMain.SelectedTabPageIndex = 1; if (currentrow == null) { MessageBox.Show("Борлуулалт хийгдээгүй байна."); } else { string BatchNo = Static.ToStr(currentrow["batchno"]); ucBill.SalesNo = Static.ToStr(currentrow["salesno"]); string lname = Static.ToStr(currentrow["lastname"]); string fname = Static.ToStr(currentrow["firstname"]); ucBill._billno = Static.ToStr(currentrow["PAYMENTNO"]); _core.MainForm_HeaderSet(0, null, fname); _core.MainForm_HeaderSet(1, null, lname); _core.MainForm_HeaderSet(2, null, Static.ToStr(currentrow["salesno"])); res = _core.RemoteObject.Connection.Call(_core.RemoteObject.User.UserNo, 211, 510017, 510017, new object[] { BatchNo }); if (ISM.Template.FormUtility.ValidateQuery(res)) { ucBill._changeAmount = Static.ToDecimal(res.Data.Tables[0].Rows[0]["CHARGEAMOUNT"]); ucBill.sumamount = Static.ToDecimal(res.Data.Tables[0].Rows[0]["TOTALAMOUNT"]); ucBill.vat = Static.ToDecimal(res.Data.Tables[0].Rows[0]["VAT"]); ucBill._paydamount = Static.ToDecimal(res.Data.Tables[0].Rows[0]["SALESAMOUNT"]) + Static.ToDecimal(res.Data.Tables[0].Rows[0]["CHARGEAMOUNT"]); } ucBill.refresh(BatchNo); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void SubMenu_TagDel() { Result res = null; DataRow r = gridView2.GetFocusedDataRow(); if (r == null) { res = new Result(6060011, "Таг сонгогдоогүй байна."); goto OnExit; } string serialno = Static.ToStr(r["SERIALNO"]); string confirm = string.Format("[{0}] дугаартай тагыг жагсаалтаас хасах уу?", serialno); if (ISM.Template.FormUtility.ValidateConfirm(confirm)) { _core.MainForm_HeaderSet(0, null, ""); _core.MainForm_HeaderSet(1, null, ""); _core.MainForm_HeaderSet(2, null, ""); _core.MainForm_HeaderSet(3, null, ""); _serialno = ""; _custno = ""; _custname = ""; _salesno = ""; r.Delete(); r.Table.AcceptChanges(); gridControl1.DataSource = null; } OnExit: ISM.Template.FormUtility.ValidateQuery(res); }
public Result ReadRecord(string pledgeno) { Result res = null; try { #region Validation #endregion #region Prepare parameters object[] param = new object[] { pledgeno }; #endregion #region Call server if (_core != null && _core.RemoteObject != null) { res = _core.RemoteObject.Connection.Call(_core.RemoteObject.User.UserNo, 601, 601004, 601003, param); if (res.ResultNo != 0) { goto OnExit; } #region Pledge main details DataTable d1 = res.Data.Tables[0]; if (d1.Rows.Count > 0) { _pledgecustno = Static.ToDecimal(d1.Rows[0]["custno"]); _doctype = Static.ToInt(d1.Rows[0]["doctype"]); _docno = Static.ToStr(d1.Rows[0]["docno"]); _custname = Static.ToStr(d1.Rows[0]["custname"]); _contactno = Static.ToStr(d1.Rows[0]["contact"]); _memo = Static.ToStr(d1.Rows[0]["memo"]); _status = Static.ToInt(d1.Rows[0]["status"]); _core.MainForm_HeaderSet(0, "Барьцаа №", pledgeno); _core.MainForm_HeaderSet(1, "Төрөл", GetDocTypeName(_doctype)); _core.MainForm_HeaderSet(2, "Дугаар", _docno); _core.MainForm_HeaderSet(3, "Овог нэр", _custname); _core.MainForm_HeaderSet(4, "Утас", _contactno); if (_status == 0) { _userno = Static.ToInt(d1.Rows[0]["holduser"]); _udate = Static.ToDateTime(d1.Rows[0]["holddate"]); txtStatus.ForeColor = Color.Red; txtStatus.EditValue = string.Format("БАРЬЦААЛСАН ({0})", _udate.ToString("MM/dd HH:mm")); } else { _userno = Static.ToInt(d1.Rows[0]["unholduser"]); _udate = Static.ToDateTime(d1.Rows[0]["unholddate"]); txtStatus.ForeColor = Color.Green; txtStatus.EditValue = string.Format("ЧӨЛӨӨЛСӨН ({0})", _udate.ToString("MM/dd HH:mm")); } DataTable dtUser = null; ISM.Template.DictUtility.Get(_core.RemoteObject, "USERS", 601003, ref dtUser); cboUser.EditValue = _userno; ISM.Template.FormUtility.LookUpEdit_SetList(ref cboUser, dtUser, "USERNO", "USERFNAME"); } #endregion #region Pledge customers _custs = res.Data.Tables[1]; BuildCustList(_custs); #endregion #region Pledge rent items _rents = res.Data.Tables[2]; BuildRentList(_rents, 0); #endregion } else { res = new Result(601900, "Internal Error: Remote object not set."); } #endregion } catch (Exception ex) { res = new Result(601901, ex.ToString()); } OnExit: //ISM.Template.FormUtility.ValidateQuery(res); Alert(res, "Барьцаа хайх"); return(res); }
public void SubMenu_Search() { tabMain.SelectedTabPageIndex = 0; _fname = null; _lname = null; _custno = null; _batchno = null; _salesno = null; _serialno = null; _core.MainForm_HeaderSet(0, null, ""); _core.MainForm_HeaderSet(1, null, ""); _core.MainForm_HeaderSet(2, null, ""); _core.MainForm_HeaderSet(3, null, ""); _core.MainForm_HeaderSet(4, null, ""); _core.MainForm_HeaderSet(5, null, ""); }