private void initConfig() { loBilg = new List <OldSpecialItem>(); sitm = new OldSpecialItem(); sitm.SID = "SID"; sitm.SName = "SName"; sitm.Price = "Price"; sitm.W1GID = "W1GID"; sitm.W2GID = "W2GID"; sitm.W3GID = "W3GID"; sitm.W4GID = "W4GID"; sitm.isActive = "isActive"; sitm.BillGroupID = "BillGroupID"; sitm.active = "active"; sitm.item_code = "item_code"; sitm.date_cancel = "date_cancel"; sitm.date_create = "date_create"; sitm.date_modi = "date_modi"; sitm.user_cancel = "user_cancel"; sitm.user_create = "user_create"; sitm.user_modi = "user_modi"; sitm.table = "SpecialItem"; sitm.pkField = "SID"; }
public String update(OldSpecialItem p, String userId) { String re = ""; String sql = ""; chkNull(p); sql = "Update " + sitm.table + " Set " + " " + sitm.SName + " = '" + p.SName.Replace("'", "''") + "'" + "," + sitm.Price + "= '" + p.Price + "'" + "," + sitm.W1GID + "= '" + p.W1GID + "'" + "," + sitm.W2GID + "= '" + p.W2GID + "'" + "," + sitm.W3GID + "= '" + p.W3GID + "'" + "," + sitm.W4GID + "= '" + p.W4GID + "'" + "," + sitm.BillGroupID + "= '" + p.BillGroupID + "'" + "Where " + sitm.pkField + "='" + p.SID + "'"; try { re = conn.ExecuteNonQuery(conn.conn, sql); } catch (Exception ex) { sql = ex.Message + " " + ex.InnerException; } return(re); }
public String insert(OldSpecialItem p, String userId) { String re = ""; String sql = ""; p.active = "1"; //p.ssdata_id = ""; int chk = 0; chkNull(p); //lbReq.form_a_id = "form_a_id"; //p.req_code = genReqDoc(); sql = "Insert Into " + sitm.table + " Set " + " " + sitm.SName + " = '" + p.SName.Replace("'", "''") + "'" + "," + sitm.Price + "= '" + p.Price + "'" + "," + sitm.W1GID + "= '" + p.W1GID + "'" + "," + sitm.W2GID + "= '" + p.W2GID + "'" + "," + sitm.W3GID + "= '" + p.W3GID + "'" + "," + sitm.W4GID + "= '" + p.W4GID + "'" + "," + sitm.isActive + "= '1'" + "," + sitm.active + "= '1'" + "," + sitm.BillGroupID + "= '" + p.BillGroupID + "'" + ""; try { re = conn.ExecuteNonQuery(conn.conn, sql); } catch (Exception ex) { sql = ex.Message + " " + ex.InnerException; } return(re); }
private void chkNull(OldSpecialItem p) { long 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.prefix_id = int.TryParse(p.prefix_id, out chk) ? chk.ToString() : "0"; //p.posi_id = int.TryParse(p.posi_id, out chk) ? chk.ToString() : "0"; //p.posi_id = int.TryParse(p.posi_id, out chk) ? chk.ToString() : "0"; p.SName = p.SName == null ? "" : p.SName; //p.EUsage = p.EUsage == null ? "" : p.EUsage; //p.TUsage = p.TUsage == null ? "" : p.TUsage; //p.UnitType = p.UnitType == null ? "" : p.UnitType; //p.UnitType = p.UnitType == null ? "" : p.UnitType; //p.Alert = p.Alert == null ? "0" : p.Alert; //p.QTY = p.QTY == null ? "0" : p.QTY; //p.PendingQTY = p.PendingQTY == null ? "0" : p.PendingQTY; //p.Price = p.Price.Equals("") ? "0" : p.Price; p.W1GID = long.TryParse(p.W1GID, out chk) ? chk.ToString() : "0"; p.W2GID = long.TryParse(p.W2GID, out chk) ? chk.ToString() : "0"; p.W3GID = long.TryParse(p.W3GID, out chk) ? chk.ToString() : "0"; p.W4GID = long.TryParse(p.W4GID, out chk) ? chk.ToString() : "0"; p.BillGroupID = long.TryParse(p.BillGroupID, out chk) ? chk.ToString() : "0"; p.Price = Decimal.TryParse(p.Price, out chk1) ? chk1.ToString() : "0"; //p.QTY = Decimal.TryParse(p.QTY, out chk1) ? chk1.ToString() : "0"; //p.user_cancel = p.user_cancel == null ? "" : p.user_cancel; }
private void initConfig() { sitm = new OldSpecialItem(); fEdit = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular); fEditB = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Bold); C1ThemeController.ApplicationTheme = ic.iniC.themeApplication; theme1.Theme = C1ThemeController.ApplicationTheme; theme1.SetTheme(sB, "BeigeOne"); foreach (Control c in panel2.Controls) { theme1.SetTheme(c, "Office2013Red"); } bg = txtDocGroupSubName.BackColor; fc = txtDocGroupSubName.ForeColor; ff = txtDocGroupSubName.Font; ic.ivfDB.obilgDB.setCboGroupType(cboDocGroupName, ""); txtPasswordVoid.KeyUp += TxtPasswordVoid_KeyUp; btnNew.Click += BtnNew_Click; btnEdit.Click += BtnEdit_Click; btnSave.Click += BtnSave_Click; initGrfPosi(); setGrfPosi(); setControlEnable(false); setFocusColor(); sB1.Text = ""; btnVoid.Hide(); txtPasswordVoid.Hide(); stt = new C1SuperTooltip(); sep = new C1SuperErrorProvider(); }
private void setControl(String posiId) { sitm = ic.ivfDB.oSItmDB.selectByPk1(posiId); ic.setC1Combo(cboDocGroupName, sitm.BillGroupID); txtID.Value = sitm.SID; txtDocGroupSubName.Value = sitm.SName; txtPrice.Value = sitm.Price; }
public OldSpecialItem selectByPk1(String pttId) { OldSpecialItem labi1 = new OldSpecialItem(); DataTable dt = new DataTable(); String sql = "select sitm.* " + "From " + sitm.table + " sitm " + "Where sitm." + sitm.pkField + " ='" + pttId + "' "; dt = conn.selectData(conn.conn, sql); labi1 = setSpecialItem(dt); return(labi1); }
private OldSpecialItem setSpecialItem1(OldSpecialItem stf1) { stf1.SID = ""; stf1.SName = ""; stf1.Price = ""; stf1.W1GID = ""; stf1.W2GID = ""; stf1.W3GID = ""; stf1.W4GID = ""; stf1.isActive = ""; stf1.BillGroupID = ""; stf1.active = ""; stf1.item_code = ""; return(stf1); }
public String insertSpecialItem(OldSpecialItem p, String userId) { String re = ""; if (p.SID.Equals("")) { re = insert(p, ""); } else { re = update(p, ""); } return(re); }
public void getlCreditCardAccount() { //lDept = new List<Position>(); loBilg.Clear(); DataTable dt = new DataTable(); dt = selectAll(); foreach (DataRow row in dt.Rows) { OldSpecialItem itm1 = new OldSpecialItem(); itm1.SID = row[sitm.SID].ToString(); itm1.SName = row[sitm.SName].ToString(); itm1.BillGroupID = row[sitm.BillGroupID].ToString(); loBilg.Add(itm1); } }
public OldSpecialItem setSpecialItem(DataTable dt) { OldSpecialItem sitm1 = new OldSpecialItem(); if (dt.Rows.Count > 0) { sitm1.SID = dt.Rows[0][sitm.SID].ToString(); sitm1.SName = dt.Rows[0][sitm.SName].ToString(); sitm1.Price = dt.Rows[0][sitm.Price].ToString(); sitm1.W1GID = dt.Rows[0][sitm.W1GID].ToString(); sitm1.W2GID = dt.Rows[0][sitm.W2GID].ToString(); sitm1.W3GID = dt.Rows[0][sitm.W3GID].ToString(); sitm1.W4GID = dt.Rows[0][sitm.W4GID].ToString(); sitm1.isActive = dt.Rows[0][sitm.isActive].ToString(); sitm1.BillGroupID = dt.Rows[0][sitm.BillGroupID].ToString(); sitm1.active = dt.Rows[0][sitm.active].ToString(); sitm1.item_code = dt.Rows[0][sitm.item_code].ToString(); } else { setSpecialItem1(sitm1); } return(sitm1); }