public static void UpdateVouchMst(VouchMst vouchmst) { string connectionString = DataManager.OraConnString(); SqlConnection sqlCon = new SqlConnection(connectionString); string query = " update gl_trans_mst set fin_mon='" + vouchmst.FinMon + "',value_date=convert(datetime,nullif('" + vouchmst.ValueDate + "',''),103), " + " vch_ref_no='" + vouchmst.VchRefNo + "',ref_file_no='" + vouchmst.RefFileNo + "', " + " volume_no= '" + vouchmst.VolumeNo + "',serial_no= '" + vouchmst.SerialNo + "', " + " trans_type='" + vouchmst.TransType + "',vch_code='" + vouchmst.VchCode + "',particulars='" + vouchmst.Particulars + "', " + " control_amt=convert(decimal(13,2),nullif('" + vouchmst.ControlAmt.Replace(",", "") + "','')),book_name='" + vouchmst.BookName + "', " + " payee='" + vouchmst.Payee + "',check_no='" + vouchmst.CheckNo + "', " + " cheq_date=convert(datetime,nullif('" + vouchmst.CheqDate + "',''),103),cheq_amnt=convert(decimal(13,2),nullif('" + vouchmst.CheqAmnt + "','')), " + " money_rpt_no='" + vouchmst.MoneyRptNo + "',money_rpt_date=convert(datetime, nullif('" + vouchmst.MoneyRptDate + "',''),103), " + " status='" + vouchmst.Status + "',update_user='******', update_date=convert(datetime, nullif('" + vouchmst.UpdateDate + "',''),103), " + " autho_user='******', autho_date=convert(datetime,nullif('" + vouchmst.AuthoDate + "',''),103),autho_user_type='" + vouchmst.AuthoUserType + "' " + " where vch_sys_no=convert(numeric,nullif('" + vouchmst.VchSysNo + "',''))"; DataManager.ExecuteNonQuery(connectionString, query); }
public static void CreateVouchMst(VouchMst vouchmst) { String connectionString = DataManager.OraConnString(); SqlConnection sqlCon = new SqlConnection(connectionString); string query = " insert into gl_trans_mst(vch_sys_no,fin_mon,value_date,vch_ref_no," + " ref_file_no,volume_no,serial_no,vch_code,trans_type,particulars,control_amt,book_name,payee,check_no,cheq_date," + " cheq_amnt,money_rpt_no,money_rpt_date,status,entry_user,entry_date,AUTHO_USER_TYPE) values (convert(numeric, case '" + vouchmst.VchSysNo + "' when '' then null else '" + vouchmst.VchSysNo + "' end), " + " '" + vouchmst.FinMon + "', convert(datetime, nullif( '" + vouchmst.ValueDate + "',''), 103),'" + vouchmst.VchRefNo + "', " + " '" + vouchmst.RefFileNo + "', '" + vouchmst.VolumeNo + "', '" + vouchmst.SerialNo + "','" + vouchmst.VchCode + "', " + " '" + vouchmst.TransType + "','" + vouchmst.Particulars + "', " + " convert(decimal(13,2),nullif('" + vouchmst.ControlAmt.Replace(",", "") + "','') ) ,'" + vouchmst.BookName + "','" + vouchmst.Payee + "', " + " '" + vouchmst.CheckNo + "', convert(datetime,nullif( '" + vouchmst.CheqDate + "',''),103), convert(decimal(13,2),nullif('" + vouchmst.CheqAmnt.Replace(",", "") + "','')), " + " '" + vouchmst.MoneyRptNo + "', convert(datetime,nullif( '" + vouchmst.MoneyRptDate + "',''),103),'" + vouchmst.Status + "', " + " '" + vouchmst.EntryUser.ToUpper() + "', convert (datetime, nullif('" + vouchmst.EntryDate + "',''),103),'" + vouchmst.AuthoUserType + "')"; DataManager.ExecuteNonQuery(connectionString, query); }