Beispiel #1
0
        public static void UpdateVouchDtl(VouchDtl vouchdtl)
        {
            String        connectionString = DataManager.OraConnString();
            SqlConnection sqlCon           = new SqlConnection(connectionString);
            string        query            = " update gl_trans_dtl set line_no='" + vouchdtl.LineNo + "',gl_coa_code='" + vouchdtl.GlCoaCode + "', " +
                                             " value_date=convert(datetime,case '" + vouchdtl.ValueDate + "' when '' then null else '" + vouchdtl.ValueDate + "' end ,103),particulars='" + vouchdtl.Particulars + "', " +
                                             " acc_type='" + vouchdtl.AccType + "',amount_dr=" + vouchdtl.AmountDr.Replace(",", "") + ", " +
                                             " amount_cr=" + vouchdtl.AmountCr.Replace(",", "") + ",book_name='" + vouchdtl.BookName + "' where " +
                                             " vch_sys_no= convert(numeric, case '" + vouchdtl.VchSysNo + "' when ''  then null else '" + vouchdtl.VchSysNo + "' end)";

            DataManager.ExecuteNonQuery(connectionString, query);
        }
Beispiel #2
0
        public static void CreateVouchDtl(VouchDtl vouchdtl)
        {
            String        connectionString = DataManager.OraConnString();
            SqlConnection sqlCon           = new SqlConnection(connectionString);
            string        query            = " insert into gl_trans_dtl(vch_sys_no,line_no,gl_coa_code,value_date,particulars, " +
                                             " acc_type,amount_dr,amount_cr,status,book_name) values (convert(numeric,'" + vouchdtl.VchSysNo + "'), " +
                                             "  '" + vouchdtl.LineNo + "',  '" + vouchdtl.GlCoaCode + "', convert(datetime,nullif('" + vouchdtl.ValueDate + "',''),103), " +
                                             "  '" + vouchdtl.Particulars + "', '" + vouchdtl.AccType + "', convert(decimal(13,2),nullif('" + vouchdtl.AmountDr.Replace(",", "") + "','')), " +
                                             "  convert(decimal(13,2),nullif('" + vouchdtl.AmountCr.Replace(",", "") + "','')), '" + vouchdtl.Status + "',  '" + vouchdtl.BookName + "')";

            DataManager.ExecuteNonQuery(connectionString, query);
        }