Example #1
0
 public int Insert(frmIn inv)
 {
     return(base.ExecNonQuery("INSERT INTO " +
                              "Invoice(CusID, EmpID, Date,Totalprice,Payment, PaymentVerify, Balance) " +
                              "VALUES(@CusID, @EmpID, @Date, @Totalprice, @Payment, @PaymentVerify, @Balance)",
                              GetParameter(inv)));
 }
Example #2
0
 public object InsertScalar(frmIn inv)
 {
     return(base.ExecScalar("INSERT INTO " +
                            "Invoice(CusID, EmpID, Date,Totalprice,Payment, PaymentVerify, Balance) " +
                            "OUTPUT INSERTED.InvoiceNo VALUES(@CusID, @EmpID, @Date, @Totalprice, @Payment, @PaymentVerify, @Balance)",
                            GetParameter(inv)));
 }
Example #3
0
        private frmIn GetInv()
        {
            frmIn Inv = new frmIn();

            Inv.inid          = Convert.ToInt32(txtInvID.Text);
            Inv.incode        = txtInvCode.Text;
            Inv.date          = dateTimePicker1.Text;
            Inv.totalprice    = float.Parse(txtTotal.Text);
            Inv.payment       = float.Parse(txtPayment.Text);
            Inv.paymentverify = int.Parse(txtPaymentVerify.Text);
            Inv.balance       = float.Parse(txtBalance.Text);
            return(Inv);
        }
Example #4
0
        public SqlParameter[] GetParameter(frmIn Inv)
        {
            SqlParameter[] param = new SqlParameter[9];
            param[0] = new SqlParameter("InvoiceNo", Inv.inid);
            param[1] = new SqlParameter("InvoiceCode", Inv.incode);
            param[2] = new SqlParameter("CusID", Inv.cusid);
            param[3] = new SqlParameter("EmpID", Inv.empid);
            param[4] = new SqlParameter("Date", Inv.date + " " + DateTime.Now.TimeOfDay);
            param[5] = new SqlParameter("Totalprice", Inv.totalprice);
            param[6] = new SqlParameter("Payment", Inv.payment);
            param[7] = new SqlParameter("PaymentVerify", Inv.paymentverify);
            param[8] = new SqlParameter("Balance", Inv.balance);

            return(param);
        }
Example #5
0
 public int Update(frmIn inv)
 {
     return(base.ExecNonQuery("UPDATE Product " +
                              "SET CusID=@CusID, EmpID=@EmpID, Date=@Date, Totalprice=@Totalprice, Payment=@Payment, PaymentVerify=@PaymentVerify, Balance=@Balance WHERE InvoiceNo=@InvoiceNo", GetParameter(inv)));
 }