private void initConfig() { jim = new JobImport(); expnpd = new ExpensesPayDetail(); ecc = new ExpensesClearCash(); erf = new ExpensesRefund(); xC.xtDB.stfDB.setCboStaff(cboStaff, userId); xC.setCboYear(cboYear); jim = xC.manDB.jimDB.selectByPk1(jobId); ecc = xC.accDB.eccDB.selectByPk1(eccDoc); txtJobCode.Value = jim.job_import_code; DateTime erfDate = DateTime.Now; txtErfDate.Value = erfDate.Year.ToString() + "-" + erfDate.ToString("MM-dd"); btnSave.Click += BtnSave_Click; initGrfErf(); setGrfErf(); setControlEcc(eccDoc); if (!eccDoc.Equals("")) { grfErf.Enabled = false; } }
public String insert(ExpensesClearCash p, String userId) { String re = ""; String sql = ""; p.active = "0"; // ให้ insert ไปก่อน แล้วค่อย update active = 1 อีกที p.status_appv = "0"; p.status_doc = "0"; int chk = 0; chkNull(p); //p.prefix_id = int.TryParse(p.prefix_id, out chk) ? chk.ToString() : "0"; //p.dept_id = int.TryParse(p.dept_id, out chk) ? chk.ToString() : "0"; sql = "Insert Into " + ecc.table + "(" + ecc.expenses_pay_detail_id + "," + ecc.expenses_draw_id + "," + ecc.job_id + "," + ecc.date_create + "," + ecc.date_modi + "," + ecc.date_cancel + "," + ecc.user_create + "," + ecc.user_modi + "," + ecc.user_cancel + "," + ecc.active + "," + ecc.remark + ", " + ecc.job_code + "," + ecc.expenses_draw_detail_id + "," + ecc.staff_id + "," + ecc.ecc_doc + "," + ecc.item_id + "," + ecc.expense_clear_cash_date + "," + ecc.item_name_t + "," + ecc.pay_amount + "," + ecc.unit_id + "," + ecc.unit_name_t + "," + ecc.vat + "," + ecc.total + "," + //ecc.receipt_date + "," + ecc.receipt_no + "," + ecc.receipt_date + "," + ecc.pay_date + "," + ecc.price + "," + ecc.pay_to_cus_name_t + "," + ecc.pay_to_cus_addr + "," + ecc.pay_to_cus_tax + "," + ecc.pay_to_cus_id + "," + ecc.pay_staff_id + "," + ecc.row1 + "," + ecc.item_code + "," + ecc.status_appv + "," + ecc.status_doc + "," + ecc.appv_staff_id + "," + ecc.doc_staff_id + "," + ecc.erc_doc + " " + ") " + "Values ('" + p.expenses_pay_detail_id + "','" + p.expenses_draw_id.Replace("'", "''") + "','" + p.job_id.Replace("'", "''") + "'," + "'" + p.date_create + "','" + p.date_modi + "','" + p.date_cancel + "'," + "'" + userId + "','" + p.user_modi + "','" + p.user_cancel + "'," + "'" + p.active + "','" + p.remark.Replace("'", "''") + "','" + p.job_code + "'," + "'" + p.expenses_draw_detail_id + "','" + p.staff_id.Replace("'", "''") + "','" + p.ecc_doc.Replace("'", "''") + "'," + "'" + p.item_id + "','" + p.expense_clear_cash_date.Replace("'", "''") + "','" + p.item_name_t.Replace("'", "''") + "'," + "'" + p.pay_amount + "','" + p.unit_id + "','" + p.unit_name_t.Replace("'", "''") + "'," + "'" + p.vat + "','" + p.total + "'," + //p.receipt_date + "'," + "'" + p.receipt_no + "','" + p.receipt_date + "','" + p.pay_date + "'," + "'" + p.price + "','" + p.pay_to_cus_name_t.Replace("'", "''") + "','" + p.pay_to_cus_addr.Replace("'", "''") + "'," + "'" + p.pay_to_cus_tax + "','" + p.pay_to_cus_id + "','" + p.pay_staff_id + "'," + "'" + p.row1 + "','" + p.item_code + "','" + p.status_appv + "'," + "'" + p.status_doc + "','" + p.appv_staff_id + "','" + p.doc_staff_id + "'," + "'" + p.erc_doc + "' " + ")"; try { re = conn.ExecuteNonQuery(conn.conn, sql); } catch (Exception ex) { sql = ex.Message + " " + ex.InnerException; } return(re); }
public String update(ExpensesClearCash p, String userId) { String re = ""; String sql = ""; int chk = 0; chkNull(p); sql = "Update " + ecc.table + " Set " + " " + ecc.expenses_pay_detail_id + " = '" + p.expenses_pay_detail_id + "'" + "," + ecc.job_id + " = '" + p.job_id.Replace("'", "''") + "'" + "," + ecc.job_code + " = '" + p.job_code.Replace("'", "''") + "'" + "," + ecc.remark + " = '" + p.remark.Replace("'", "''") + "'" + "," + ecc.date_modi + " = now()" + "," + ecc.user_modi + " = '" + userId + "' " + "," + ecc.expenses_draw_detail_id + " = '" + p.expenses_draw_detail_id + "' " + "," + ecc.staff_id + " = '" + p.staff_id + "' " + "," + ecc.expenses_draw_id + " = '" + p.expenses_draw_id + "' " + "," + ecc.ecc_doc + " = '" + p.ecc_doc + "' " + "," + ecc.item_id + " = '" + p.item_id + "' " + "," + ecc.expense_clear_cash_date + " = '" + p.expense_clear_cash_date + "' " + "," + ecc.item_name_t + " = '" + p.item_name_t.Replace("'", "''") + "' " + "," + ecc.pay_amount + " = '" + p.pay_amount + "' " + "," + ecc.unit_id + " = '" + p.unit_id + "' " + "," + ecc.unit_name_t + " = '" + p.unit_name_t.Replace("'", "''") + "' " + "," + ecc.vat + " = '" + p.vat + "' " + "," + ecc.pay_date + " = '" + p.pay_date + "' " + "," + ecc.qty + " = '" + p.qty + "' " + "," + ecc.price + " = '" + p.price + "' " + "," + ecc.total + " = '" + p.total + "' " + "," + ecc.receipt_date + " = '" + p.receipt_date + "' " + "," + ecc.receipt_no + " = '" + p.receipt_no + "' " + "," + ecc.pay_to_cus_name_t + " = '" + p.pay_to_cus_name_t.Replace("'", "''") + "' " + "," + ecc.pay_to_cus_addr + " = '" + p.pay_to_cus_addr.Replace("'", "''") + "' " + "," + ecc.pay_to_cus_id + " = '" + p.pay_to_cus_id + "' " + "," + ecc.pay_staff_id + " = '" + p.pay_staff_id + "' " + "," + ecc.pay_to_cus_tax + " = '" + p.pay_to_cus_tax + "' " + "," + ecc.item_code + " = '" + p.item_code + "' " + "," + ecc.row1 + " = '" + p.row1 + "' " + "Where " + ecc.pkField + "='" + p.expense_clear_cash_id + "'" ; try { re = conn.ExecuteNonQuery(conn.conn, sql); } catch (Exception ex) { sql = ex.Message + " " + ex.InnerException; } return(re); }
private void initConfig() { ecc = new ExpensesClearCash(); ecc.expense_clear_cash_id = "expense_clear_cash_id"; ecc.expenses_pay_detail_id = "expenses_pay_detail_id"; ecc.job_id = "job_id"; ecc.job_code = "job_code"; ecc.expenses_draw_detail_id = "expenses_draw_detail_id"; ecc.staff_id = "staff_id"; ecc.active = "active"; ecc.date_create = "date_create"; ecc.date_modi = "date_modi"; ecc.date_cancel = "date_cancel"; ecc.user_create = "user_create"; ecc.user_modi = "user_modi"; ecc.user_cancel = "user_cancel"; ecc.expenses_draw_id = "expenses_draw_id"; ecc.remark = "remark"; ecc.ecc_doc = "ecc_doc"; ecc.expense_clear_cash_date = "expense_clear_cash_date"; ecc.item_id = "item_id"; ecc.item_name_t = "item_name_t"; ecc.pay_amount = "pay_amount"; ecc.pay_date = "pay_date"; ecc.qty = "qty"; ecc.price = "price"; ecc.unit_id = "unit_id"; ecc.unit_name_t = "unit_name_t"; ecc.vat = "vat"; ecc.total = "total"; ecc.receipt_date = "receipt_date"; ecc.receipt_no = "receipt_no"; ecc.pay_to_cus_id = "pay_to_cus_id"; ecc.pay_to_cus_name_t = "pay_to_cus_name_t"; ecc.pay_to_cus_addr = "pay_to_cus_addr"; ecc.pay_to_cus_tax = "pay_to_cus_tax"; ecc.pay_staff_id = "pay_staff_id"; ecc.row1 = "row1"; ecc.item_code = "item_code"; ecc.status_appv = "status_appv"; ecc.status_doc = "status_doc"; ecc.appv_staff_id = "appv_staff_id"; ecc.doc_staff_id = "doc_staff_id"; ecc.erc_doc = "erc_doc"; ecc.table = "t_expenses_clear_cash"; ecc.pkField = "expense_clear_cash_id"; lecc = new List <ExpensesClearCash>(); }
private void chkNull(ExpensesClearCash p) { int chk = 0; Decimal chk1 = 0; p.date_modi = p.date_modi == null ? "" : p.date_modi; p.date_cancel = p.date_cancel == null ? "" : p.date_cancel; p.user_create = p.user_create == null ? "" : p.user_create; p.user_modi = p.user_modi == null ? "" : p.user_modi; p.user_cancel = p.user_cancel == null ? "" : p.user_cancel; //p.expenses_pay_detail_id = p.expenses_pay_detail_id == null ? "" : p.expenses_pay_detail_id; p.job_code = p.job_code == null ? "" : p.job_code; //p.expenses_draw_detail_id = p.expenses_draw_detail_id == null ? "" : p.expenses_draw_detail_id; p.remark = p.remark == null ? "" : p.remark; p.erc_doc = p.erc_doc == null ? "" : p.erc_doc; p.ecc_doc = p.ecc_doc == null ? "0" : p.ecc_doc; p.expense_clear_cash_date = p.expense_clear_cash_date == null ? "0" : p.expense_clear_cash_date; p.item_name_t = p.item_name_t == null ? "" : p.item_name_t; p.pay_date = p.pay_date == null ? "" : p.pay_date; p.receipt_no = p.receipt_no == null ? "" : p.receipt_no; p.qty = p.qty == null ? "" : p.qty; p.unit_name_t = p.unit_name_t == null ? "0" : p.unit_name_t; p.total = p.total == null ? "0" : p.total; p.receipt_date = p.receipt_date == null ? "" : p.receipt_date; p.pay_to_cus_name_t = p.pay_to_cus_name_t == null ? "" : p.pay_to_cus_name_t; p.pay_to_cus_addr = p.pay_to_cus_addr == null ? "" : p.pay_to_cus_addr; p.pay_to_cus_tax = p.pay_to_cus_tax == null ? "" : p.pay_to_cus_tax; p.item_code = p.item_code == null ? "" : p.item_code; p.status_appv = p.status_appv == null ? "0" : p.status_appv; p.status_doc = p.status_doc == null ? "0" : p.status_doc; p.job_id = int.TryParse(p.job_id, out chk) ? chk.ToString() : "0"; p.staff_id = int.TryParse(p.staff_id, out chk) ? chk.ToString() : "0"; p.pay_to_cus_id = int.TryParse(p.pay_to_cus_id, out chk) ? chk.ToString() : "0"; p.item_id = int.TryParse(p.item_id, out chk) ? chk.ToString() : "0"; p.unit_id = int.TryParse(p.unit_id, out chk) ? chk.ToString() : "0"; p.expenses_pay_detail_id = int.TryParse(p.expenses_pay_detail_id, out chk) ? chk.ToString() : "0"; p.expenses_draw_detail_id = int.TryParse(p.expenses_draw_detail_id, out chk) ? chk.ToString() : "0"; p.expenses_draw_id = int.TryParse(p.expenses_draw_id, out chk) ? chk.ToString() : "0"; p.pay_staff_id = int.TryParse(p.pay_staff_id, out chk) ? chk.ToString() : "0"; p.row1 = int.TryParse(p.row1, out chk) ? chk.ToString() : "0"; p.appv_staff_id = int.TryParse(p.appv_staff_id, out chk) ? chk.ToString() : "0"; p.doc_staff_id = int.TryParse(p.doc_staff_id, out chk) ? chk.ToString() : "0"; p.total = Decimal.TryParse(p.total, out chk1) ? chk1.ToString() : "0"; p.qty = Decimal.TryParse(p.qty, out chk1) ? chk1.ToString() : "0"; p.price = Decimal.TryParse(p.price, out chk1) ? chk1.ToString() : "0"; p.vat = Decimal.TryParse(p.vat, out chk1) ? chk1.ToString() : "0"; p.pay_amount = Decimal.TryParse(p.pay_amount, out chk1) ? chk1.ToString() : "0"; p.vat = Decimal.TryParse(p.vat, out chk1) ? chk1.ToString() : "0"; }
private Boolean setEcc() { Boolean chk = true; ecc = new ExpensesClearCash(); if (txtId.Text.Equals("")) { } ecc = xC.accDB.eccDB.selectByPk1(txtId.Text); ecc.expense_clear_cash_id = txtId.Text; ecc.expenses_pay_detail_id = txtPdId.Text; ecc.job_id = txtJobId.Text; ecc.job_code = txtJobCode.Text; ecc.expenses_draw_detail_id = txtddId.Text; ecc.staff_id = txtStfId.Text; ecc.active = "1"; ecc.date_create = ""; ecc.date_modi = ""; ecc.date_cancel = ""; ecc.user_create = ""; ecc.user_modi = ""; ecc.user_cancel = ""; ecc.expenses_draw_id = ""; ecc.remark = txtRemark.Text; ecc.ecc_doc = ""; ecc.expense_clear_cash_date = ""; ecc.item_id = txtItmId.Text; ecc.item_name_t = txtItmNameT.Text; ecc.pay_amount = txtPayAmt.Text.Replace("$", "").Replace(",", ""); ecc.pay_date = ""; ecc.qty = ""; ecc.price = ""; ecc.unit_id = ""; ecc.unit_name_t = ""; ecc.vat = ""; ecc.total = ""; ecc.receipt_date = xC.datetoDB(txtReceiptDate.Text); ecc.receipt_no = txtReceiptNo.Text; ecc.pay_to_cus_id = ""; ecc.pay_to_cus_name_t = ""; ecc.pay_to_cus_addr = ""; ecc.pay_to_cus_tax = ""; ecc.pay_staff_id = txtStfId.Text; ecc.row1 = txtRow.Text; ecc.item_code = txtItmCode.Text; ecc.pay_to_cus_name_t = txtPayCusNameT.Text; ecc.pay_to_cus_id = txtPayCusId.Text; return(chk); }
public ExpensesClearCash selectByEccDoc(String copId) { ExpensesClearCash cop1 = new ExpensesClearCash(); DataTable dt = new DataTable(); String sql = "select expC.* " + "From " + ecc.table + " expC " + //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " + "Where expC." + ecc.ecc_doc + " ='" + copId + "' "; dt = conn.selectData(conn.conn, sql); cop1 = setExpenseClearCash(dt); return(cop1); }
private void initConfig() { jim = new JobImport(); ecc = new ExpensesClearCash(); xC.setCboYear(cboYear); chkAppvWait.Checked = true; initGrfEcc(); initGrfEccD(); initGrPd(); initGrDd(); initGrfRefund(); setGrfEcc(); }
private void initConfig() { String appName = ""; appName = System.AppDomain.CurrentDomain.FriendlyName; appName = appName.ToLower().Replace(".exe", ""); if (System.IO.File.Exists(Environment.CurrentDirectory + "\\" + appName + ".ini")) { appName = Environment.CurrentDirectory + "\\" + appName + ".ini"; } else { appName = Environment.CurrentDirectory + "\\" + Application.ProductName + ".ini"; } iniF = new IniFile(appName); iniC = new InitConfig(); user = new Staff(); GetConfig(); conn = new ConnectDB(iniC); xtDB = new XtrimDB(conn); sCus = new Customer(); sImp = new Customer(); sFwd = new Customer(); sEtt = new EntryType(); sPol = new PortOfLoading(); sPvl = new Privilege(); sUgw = new UnitGw(); sUtp = new UnitPackage(); sTmn = new Terminal(); sSoap = new StringSOAP(); sStf = new Staff(); sCot = new Country(); sPti = new PortImport(); sIct = new IncoTerms(); sTpm = new TermPayment(); sInsr = new Customer(); sCurr = new Currency(); sTrkCop = new Customer(); sAddr = new Address(); sConY = new Customer(); sItm = new Items(); sEcc = new ExpensesClearCash(); ftpC = new FtpClient(iniC.hostFTP, iniC.userFTP, iniC.passFTP); cTxtFocus = ColorTranslator.FromHtml(iniC.txtFocus); regEmail = new Regex(@"^([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$"); }
private void setControlEcc(String eccDoc) { ecc = xC.accDB.eccDB.selectToRefundByEccDoc(eccDoc); txtId.Value = ""; jobId = ecc.job_id; this.eccDoc = ecc.ecc_doc; pdid = ecc.expenses_pay_detail_id; txtRefund.Value = ecc.pay_amount; DateTime erfDate = DateTime.Now; txtErfDate.Value = erfDate.Year.ToString() + "-" + erfDate.ToString("MM-dd"); txtDesc.Value = ""; txtRemark.Value = ""; }
private void setControl(String eccId) { ExpensesClearCash ecc = new ExpensesClearCash(); ExpensesPayDetail pd = new ExpensesPayDetail(); ecc = xC.accDB.eccDB.selectByPk1(eccId); pd = xC.accDB.expnpdDB.selectByPk1(ecc.expenses_pay_detail_id); txtID.Value = ecc.expense_clear_cash_id; txtEccDoc.Value = ecc.ecc_doc; txtItmNameT.Value = ecc.item_name_t; txtReceiptNo.Value = ecc.receipt_no; txtReceiptDate.Value = ecc.receipt_date; txtRow.Value = ecc.row1; txtItmNamePd.Value = pd.item_name_t; }
public String insertExpenseReceiptCash(ExpensesClearCash p, String userId) { String re = ""; if (p.expense_clear_cash_id.Equals("")) { re = insert(p, userId); } else { re = update(p, userId); } return(re); }
private void setControl(String id) { Items itm = new Items(); expnpd = new ExpensesPayDetail(); ecc = new ExpensesClearCash(); JobImport jim = new JobImport(); ecc = xC.accDB.eccDB.selectByPk1(id); expnpd = xC.accDB.expnpdDB.selectByPk1(pdid); if (ecc.expense_clear_cash_id.Equals("")) { jim = xC.manDB.jimDB.selectByJobCode(jobcode); } txtItmNamePd.Value = itmPd; txtId.Value = ecc.expense_clear_cash_id; txtJobId.Value = ecc.job_id.Equals("") ? jim.job_import_id : ecc.job_id; txtJobCode.Value = ecc.job_code.Equals("") ? jobcode : ecc.job_code; txtPdId.Value = ecc.expenses_pay_detail_id.Equals("") ? pdid : ecc.expenses_pay_detail_id; txtStfId.Value = ecc.staff_id.Equals("") ? xC.userId : ecc.staff_id; txtddId.Value = ecc.expenses_draw_detail_id.Equals("") ? expnpd.expenses_draw_detail_id : ecc.expenses_draw_detail_id; //txtdid.Value = ecc.expenses_draw_id.Equals("") ? jim.job_import_id : ecc.expenses_draw_id; int row = 0, chk = 0; if (int.TryParse(rowno, out chk)) { txtRow.Value = chk; } else { txtRow.Value = ecc.row1; } //chk++; txtReceiptNo.Value = ecc.receipt_no; txtReceiptDate.Value = ecc.receipt_date; txtItmId.Value = ecc.item_id; txtItmCode.Value = ecc.item_code; txtItmNameT.Value = ecc.item_name_t; txtPayAmt.Value = ecc.pay_amount; txtPayCusId.Value = ecc.pay_to_cus_id; txtPayCusNameT.Value = ecc.pay_to_cus_name_t; //txtItmCode.Value = ecc.item_code; setImages(txtId.Text); }
private void initConfig() { jim = new JobImport(); ecc = new ExpensesClearCash(); xC.setCboYear(cboYear); xC.xtDB.stfDB.setCboStaff(cboStaff, ""); chkAppvWait.Checked = true; cboStaff.SelectedItemChanged += CboStaff_SelectedItemChanged; btnRefund.Click += BtnRefund_Click; btnDNew.Click += BtnDNew_Click; btnCal.Click += BtnCal_Click; btnSave.Click += BtnSave_Click; initGrfEcc(); initGrPd(); }
public void getlexpnC() { //lDept = new List<Department>(); DataTable dt = new DataTable(); dt = selectAll(); foreach (DataRow row in dt.Rows) { ExpensesClearCash curr1 = new ExpensesClearCash(); curr1.expense_clear_cash_id = row[ecc.expense_clear_cash_id].ToString(); curr1.expenses_pay_detail_id = row[ecc.expenses_pay_detail_id].ToString(); curr1.expenses_draw_id = row[ecc.expenses_draw_id].ToString(); curr1.job_code = row[ecc.job_code].ToString(); lecc.Add(curr1); } }
private void initConfig() { C1ThemeController.ApplicationTheme = xC.iniC.themeApplication; theme1.Theme = C1ThemeController.ApplicationTheme; theme1.SetTheme(sB, "BeigeOne"); theme1.SetTheme(panel1, "VS2013Light"); ecc = new ExpensesClearCash(); setControl(tableId); btnImages.Click += BtnImages_Click; btnSave.Click += BtnSave_Click; foreach (Control c in panel1.Controls) { theme1.SetTheme(c, "VS2013Light"); } }
private void initConfig() { jim = new JobImport(); expnpd = new ExpensesPayDetail(); ecc = new ExpensesClearCash(); erf = new ExpensesRefund(); xC.xtDB.stfDB.setCboStaff(cboStaff, userId); jim = xC.manDB.jimDB.selectByPk1(jobId); ecc = xC.accDB.eccDB.selectByPk1(erfId); txtJobCode.Value = jim.job_import_code; DateTime erfDate = DateTime.Now; txtErfDate.Value = erfDate.Year.ToString() + "-" + erfDate.ToString("MM-dd"); btnSave.Click += BtnSave_Click; setControl(erfId); }
private void setControl(String id) { txtId.Value = id; Items itm = new Items(); expndd = new ExpensesDrawDatail(); ecc = new ExpensesClearCash(); ecc = xC.accDB.eccDB.selectByPk1(id); expndd = xC.accDB.expnddDB.selectByPk1(ecc.expenses_draw_detail_id); itm = xC.iniDB.itmDB.selectByPk1(expndd.item_id); txtTableId.Value = expndd.expenses_draw_detail_id; txtItmNameT1.Value = expndd.item_name_t; txtRcpAmt.Value = expndd.receipt_amount; txtRcpNum.Value = expndd.receipt_no; txtRcpDate.Value = expndd.receipt_date; txtItmCode.Value = itm.item_code; txtItmNameT.Value = expndd.item_name_t; setImages(txtId.Text); }
private void initConfig() { C1ThemeController.ApplicationTheme = xC.iniC.themeApplication; theme1.Theme = C1ThemeController.ApplicationTheme; theme1.SetTheme(sB, "BeigeOne"); theme1.SetTheme(panel1, "VS2013Light"); ecc = new ExpensesClearCash(); expnpd = new ExpensesPayDetail(); btnSave.Click += BtnSave_Click; txtItmNameT.KeyUp += TxtItmNameT_KeyUp; txtPayCusNameT.KeyUp += TxtPayCusNameT_KeyUp; setControl(eccid); foreach (Control c in panel1.Controls) { theme1.SetTheme(c, "VS2013Light"); } }
public ExpensesClearCash selectToRefundByEccDoc(String copId) { ExpensesClearCash cop1 = new ExpensesClearCash(); DataTable dt = new DataTable(); String sql = "select * " + "From " + ecc.table + " " + //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " + "Where " + ecc.ecc_doc + " ='" + copId + "' "; dt = conn.selectData(conn.conn, sql); cop1 = setExpenseClearCash(dt); sql = "Select sum(" + ecc.pay_amount + ") as " + ecc.pay_amount + " " + "From " + ecc.table + " " + "Where " + ecc.ecc_doc + " ='" + copId + "' "; dt.Clear(); dt = conn.selectData(conn.conn, sql); String re = ""; Decimal chk = 0; re = dt.Rows[0][ecc.pay_amount].ToString(); Decimal.TryParse(re, out chk); cop1.pay_amount = chk.ToString(); return(cop1); }
public ExpensesClearCash setExpenseClearCash(DataTable dt) { ExpensesClearCash ecc1 = new ExpensesClearCash(); if (dt.Rows.Count > 0) { ecc1.expense_clear_cash_id = dt.Rows[0][ecc.expense_clear_cash_id].ToString(); ecc1.expenses_pay_detail_id = dt.Rows[0][ecc.expenses_pay_detail_id].ToString(); ecc1.job_id = dt.Rows[0][ecc.job_id].ToString(); ecc1.job_code = dt.Rows[0][ecc.job_code].ToString(); ecc1.active = dt.Rows[0][ecc.active].ToString(); ecc1.date_cancel = dt.Rows[0][ecc.date_cancel].ToString(); ecc1.date_create = dt.Rows[0][ecc.date_create].ToString(); ecc1.date_modi = dt.Rows[0][ecc.date_modi].ToString(); ecc1.user_cancel = dt.Rows[0][ecc.user_cancel].ToString(); ecc1.user_create = dt.Rows[0][ecc.user_create].ToString(); ecc1.user_modi = dt.Rows[0][ecc.user_modi].ToString(); ecc1.ecc_doc = dt.Rows[0][ecc.ecc_doc].ToString(); ecc1.remark = dt.Rows[0][ecc.remark].ToString(); ecc1.expenses_draw_detail_id = dt.Rows[0][ecc.expenses_draw_detail_id].ToString(); ecc1.staff_id = dt.Rows[0][ecc.staff_id].ToString(); ecc1.expenses_draw_id = dt.Rows[0][ecc.expenses_draw_id].ToString(); ecc1.expense_clear_cash_date = dt.Rows[0][ecc.expense_clear_cash_date].ToString(); ecc1.item_id = dt.Rows[0][ecc.item_id].ToString(); ecc1.item_name_t = dt.Rows[0][ecc.item_name_t].ToString(); ecc1.pay_amount = dt.Rows[0][ecc.pay_amount].ToString(); ecc1.unit_id = dt.Rows[0][ecc.unit_id].ToString(); ecc1.unit_name_t = dt.Rows[0][ecc.unit_name_t].ToString(); ecc1.vat = dt.Rows[0][ecc.vat].ToString(); ecc1.total = dt.Rows[0][ecc.total].ToString(); ecc1.receipt_date = dt.Rows[0][ecc.receipt_date].ToString(); ecc1.receipt_no = dt.Rows[0][ecc.receipt_no].ToString(); ecc1.price = dt.Rows[0][ecc.price].ToString(); ecc1.qty = dt.Rows[0][ecc.qty].ToString(); ecc1.pay_date = dt.Rows[0][ecc.pay_date].ToString(); ecc1.pay_to_cus_id = dt.Rows[0][ecc.pay_to_cus_id].ToString(); ecc1.pay_to_cus_name_t = dt.Rows[0][ecc.pay_to_cus_name_t].ToString(); ecc1.pay_to_cus_addr = dt.Rows[0][ecc.pay_to_cus_addr].ToString(); ecc1.pay_to_cus_tax = dt.Rows[0][ecc.pay_to_cus_tax].ToString(); ecc1.pay_staff_id = dt.Rows[0][ecc.pay_staff_id].ToString(); ecc1.row1 = dt.Rows[0][ecc.row1].ToString(); ecc1.item_code = dt.Rows[0][ecc.item_code].ToString(); ecc1.status_appv = dt.Rows[0][ecc.status_appv].ToString(); ecc1.status_doc = dt.Rows[0][ecc.status_doc].ToString(); ecc1.appv_staff_id = dt.Rows[0][ecc.appv_staff_id].ToString(); ecc1.doc_staff_id = dt.Rows[0][ecc.doc_staff_id].ToString(); ecc1.erc_doc = dt.Rows[0][ecc.erc_doc].ToString(); } else { ecc1.expense_clear_cash_id = ""; ecc1.expenses_pay_detail_id = ""; ecc1.job_id = ""; ecc1.job_code = ""; ecc1.expenses_draw_detail_id = ""; ecc1.staff_id = ""; ecc1.active = ""; ecc1.date_create = ""; ecc1.date_modi = ""; ecc1.date_cancel = ""; ecc1.user_create = ""; ecc1.user_modi = ""; ecc1.user_cancel = ""; ecc1.expenses_draw_id = ""; ecc1.remark = ""; ecc1.ecc_doc = ""; ecc1.expense_clear_cash_date = ""; ecc1.item_id = ""; ecc1.item_name_t = ""; ecc1.pay_amount = ""; ecc1.pay_date = ""; ecc1.qty = ""; ecc1.unit_id = ""; ecc1.unit_name_t = ""; ecc1.vat = ""; ecc1.total = ""; ecc1.receipt_date = ""; ecc1.receipt_no = ""; ecc1.price = ""; ecc1.pay_to_cus_name_t = ""; ecc1.pay_to_cus_id = ""; ecc1.pay_to_cus_addr = ""; ecc1.pay_to_cus_tax = ""; ecc1.pay_staff_id = ""; ecc1.row1 = ""; ecc1.item_code = ""; ecc1.status_appv = ""; ecc1.status_doc = ""; ecc1.appv_staff_id = ""; ecc1.doc_staff_id = ""; ecc1.erc_doc = ""; } return(ecc1); }