private String insert(Customer p) { String sql = "", chk = ""; if (p.Id.Equals("")) { p.Id = p.getGenID(); } p.Name = p.Name.Replace("''", "'"); //p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + cust.table + " (" + cust.pkField + "," + cust.Name + "," + cust.saleId + "," + cust.Active + "," + cust.thoId + ") " + "Values('" + p.Id + "','" + p.Name + "','" + p.saleId + "','" + p.Active + "','" + p.thoId + "')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.Id; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Customer"); } finally { } return(chk); }
private String insert(Sale p) { String sql = "", chk = ""; if (p.Id.Equals("")) { p.Id = p.getGenID(); } if (p.Limit1.Equals("")) { p.Limit1 = "0"; } p.Name = p.Name.Replace("''", "'"); p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + sale.table + " (" + sale.pkField + "," + sale.Name + "," + sale.Remark + "," + sale.Active + "," + sale.Code + "," + sale.Limit1 + "," + sale.statusDiscount + ") " + "Values('" + p.Id + "','" + p.Name + "','" + p.Remark + "','" + p.Active + "','" + p.Code + "'," + p.Limit1 + ",'" + p.statusDiscount + "')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.Id; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Sale"); } finally { } return(chk); }
private String insert(TRate p) { String sql = "", chk = ""; if (p.TRateId.Equals("")) { p.TRateId = p.getGenID(); } //p.Name = p.Name.Replace("''", "'"); //p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + tr.table + " (" + tr.pkField + "," + tr.Active + "," + tr.amount + "," + tr.limit1 + "," + tr.monthId + "," + tr.pay + "," + tr.periodId + "," + tr.RateDescription + "," + tr.RateId + "," + tr.yearId + ") " + "Values('" + p.TRateId + "','" + p.Active + "','" + p.amount + "','" + p.limit1 + "','" + p.monthId + "'," + p.pay + ",'" + p.periodId + ",'" + p.RateDescription + ",'" + p.RateId + ",'" + p.yearId + "')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.TRateId; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Thoodb"); } finally { } return(chk); }
private String insert(LottoTho p) { String sql = "", chk = ""; if (p.Id.Equals("")) { p.Id = p.getGenID(); } p.thoName = p.thoName.Replace("''", "'"); //p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + lTho.table + " (" + lTho.pkField + "," + lTho.Active + "," + lTho.Amount + "," + lTho.AmountPer + "," + lTho.monthId + "," + lTho.periodId + "," + lTho.rowNumber + "," + lTho.thoId + "," + lTho.thoName + "," + lTho.yearId + ") " + "Values('" + p.Id + "','" + p.Active + "','" + p.Amount + "','" + p.AmountPer + "','" + p.monthId + "','" + p.periodId + "','" + p.rowNumber + "','" + p.thoId + "','" + p.thoName + "','" + p.yearId + "')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.Id; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Rate"); } finally { } return(chk); }
private String insert(Rate p) { String sql = "", chk = ""; if (p.Id.Equals("")) { p.Id = p.getGenID(); } p.Description = p.Description.Replace("''", "'"); //p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + rate.table + " (" + rate.pkField + "," + rate.Description + "," + rate.rec + "," + rate.pay + "," + rate.limit1 + "," + rate.discount + "," + rate.thooId + "," + rate.Active + ") " + "Values('" + p.Id + "','" + p.Description + "','" + p.rec + "','" + p.pay + "','" + p.limit1 + "','" + p.discount + "','" + p.thooId + "','" + p.Active + "')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.Id; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Rate"); } finally { } return(chk); }
public String lockLotto(String sfId) { String sql = "", chk = ""; sql = "Update " + fl.table + " Set " + fl.fLock + "='1', " + fl.staffId + "='" + sfId + "'"; chk = conn.ExecuteNonQuery(sql); return(chk); }
private String insert(Thoo p) { String sql = "", chk = ""; if (p.Id.Equals("")) { p.Id = p.getGenID(); p.Color = selectMax(); } p.Name = p.Name.Replace("''", "'"); p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + tho.table + " (" + tho.pkField + "," + tho.Name + "," + tho.Remark + "," + tho.Active + "," + tho.Code + "," + tho.Limit1 + "," + tho.Color + "," + tho.Default + "," + tho.thooDefaultCnt + "," + tho.staffModiThooDefault + "," + tho.dateModiThooDefault + ") " + "Values('" + p.Id + "','" + p.Name + "','" + p.Remark + "','" + p.Active + "','" + p.Code + "'," + p.Limit1 + "," + p.Color + ",'0',0,'','')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.Id; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Thoodb"); } finally { } return(chk); }
private String insert(Reward p) { String sql = "", chk = ""; if (p.Id.Equals("")) { p.Id = p.getGenID(); } //p.Name = p.Name.Replace("''", "'"); p.dateCreate = p.dateTimetoDB(); p.staffCreate = p.staffId; p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + rw.table + " (" + rw.pkField + "," + rw.dateReward + "," + rw.staffId + "," + rw.reward1 + "," + rw.monthId + "," + rw.periodId + "," + rw.rewardDown2 + "," + rw.rewardDown31 + "," + rw.Remark + "," + rw.dateCreate + "," + rw.dateModi + "," + rw.dateCancel + "," + rw.staffCreate + "," + rw.staffModi + "," + rw.staffCancel + "," + rw.yearId + "," + rw.rewardDown32 + "," + rw.rewardDown33 + "," + rw.rewardDown34 + ") " + "Values('" + p.Id + "','" + p.dateReward + "','" + p.staffId + "','" + p.reward1 + "','" + p.monthId + "','" + p.periodId + "','" + p.rewardDown2 + "','" + p.rewardDown31 + "','" + p.Remark + "','" + p.dateCreate + "',''," + "'','" + p.staffCreate + "',''," + "'','" + p.yearId + "','" + p.rewardDown32 + "','" + p.rewardDown33 + "','" + p.rewardDown34 + "')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.Id; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Reward"); } finally { } return(chk); }
private String insert(NumberLimit p) { String sql = "", chk = ""; if (p.Id.Equals("")) { p.Id = p.getGenID(); } p.dateCreate = p.dateGenDB; p.remark = p.remark.Replace("''", "'"); //p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + nl.table + " (" + nl.pkField + "," + nl.Active + "," + nl.dateCancel + "," + nl.dateCreate + "," + nl.dateModi + "," + nl.dateStart + "," + nl.monthId + "," + nl.number + "," + nl.periodId + "," + nl.remark + "," + nl.staffCancel + "," + nl.staffModi + "," + nl.StatusStart + "," + nl.yearId + "," + nl.yearLimitId + "," + nl.monthLimitId + "," + nl.periodLimitId + "," + nl.dateEnd + ") " + "Values('" + p.Id + "','" + p.Active + "','" + p.dateCancel + "'," + p.dateCreate + ",'" + p.dateModi + "','" + p.dateStart + "','" + p.monthId + "','" + p.number + "','" + p.periodId + "','" + p.remark + "','" + p.staffCancel + "','" + p.staffModi + "','" + p.StatusStart + "','" + p.yearId + "','" + p.yearLimitId + "','" + p.monthLimitId + "','" + p.periodLimitId + "','" + p.dateEnd + "')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.Id; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Customer"); } finally { } return(chk); }
private String insert(Image1 p) { String sql = "", chk = ""; if (p.Id.Equals("")) { p.Id = p.getGenID(); } p.dateCreate = p.dateGenDB; //p.Remark = p.Remark.Replace("''", "'"); sql = "Insert Into " + img.table + " (" + img.pkField + "," + img.custId + "," + img.pathFilename + "," + img.saleId + "," + img.staffId + "," + img.Active + "," + img.yearId + "," + img.monthId + "," + img.periodId + "," + img.statusInput + "," + img.FLock + "," + img.dateCreate + "," + img.dateInput + "," + img.staffInputId + "," + img.staffInputName + "," + img.rowNumber + "," + img.thooId + ") " + "Values('" + p.Id + "','" + p.custId + "','" + p.pathFilename + "','" + p.saleId + "','" + p.staffId + "','" + p.Active + "','" + p.yearId + "','" + p.monthId + "','" + p.periodId + "','" + "0','0'," + p.dateCreate + "," + "'','','','" + p.rowNumber + "','" + p.thooId + "')"; try { chk = conn.ExecuteNonQuery(sql); chk = p.Id; } catch (Exception ex) { MessageBox.Show("Error " + ex.ToString(), "insert Image1"); } finally { } return(chk); }