Пример #1
0
        public int sp_XuLy_ChiTietHoaDonNhap(Entities.ChiTietHoaDonNhap ddh)
        {
            int Trave = 0;

            try
            {
                Sql = new Constants.Sql();
                string sql = Sql.sp_XuLy_ChiTietHoaDonNhap;
                conn = new Connection();
                cn   = conn.openConnection();
                ha   = new Constants.ChiTietHoaDonNhap();
                cmd  = new SqlCommand(sql, cn);
                cmd.Parameters.Add(ha.HanhDong, SqlDbType.NVarChar, 20).Value     = ddh.Hanhdong;
                cmd.Parameters.Add(ha.MaHoaDonNhap, SqlDbType.NVarChar, 20).Value = ddh.MaHoaDonNhap;
                cmd.Parameters.Add(ha.MaHangHoa, SqlDbType.NVarChar).Value        = ddh.MaHangHoa;
                cmd.Parameters.Add(ha.SoLuong, SqlDbType.Int).Value                 = ddh.SoLuong;
                cmd.Parameters.Add(ha.DonGia, SqlDbType.Float, 20).Value            = ddh.DonGia;
                cmd.Parameters.Add(ha.Thue, SqlDbType.Float, 20).Value              = ddh.Thue;
                cmd.Parameters.Add(ha.PhanTramChietKhau, SqlDbType.Float, 20).Value = ddh.PhanTramChietKhau;
                cmd.Parameters.Add(ha.GhiChu, SqlDbType.NVarChar).Value             = ddh.GhiChu;
                cmd.Parameters.Add(ha.Deleted, SqlDbType.Bit).Value                 = ddh.Deleted;
                Trave = cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            { string s = ex.Message.ToString(); }
            finally
            {
                cmd.Connection.Dispose();
                cn.Close();
                conn.closeConnection();
            }
            return(Trave);
        }
Пример #2
0
 public int sp_XuLy_ChiTietHoaDonNhap(Entities.ChiTietHoaDonNhap ddh)
 {
     int Trave = 0;
     try
     {
         Sql = new Constants.Sql();
         string sql = Sql.sp_XuLy_ChiTietHoaDonNhap;
         conn = new Connection();
         cn = conn.openConnection();
         ha = new Constants.ChiTietHoaDonNhap();
         cmd = new SqlCommand(sql, cn);
         cmd.Parameters.Add(ha.HanhDong, SqlDbType.NVarChar, 20).Value = ddh.Hanhdong;
         cmd.Parameters.Add(ha.MaHoaDonNhap, SqlDbType.NVarChar, 20).Value = ddh.MaHoaDonNhap;
         cmd.Parameters.Add(ha.MaHangHoa, SqlDbType.NVarChar).Value = ddh.MaHangHoa;
         cmd.Parameters.Add(ha.SoLuong, SqlDbType.Int).Value = ddh.SoLuong;
         cmd.Parameters.Add(ha.DonGia, SqlDbType.Float, 20).Value = ddh.DonGia;
         cmd.Parameters.Add(ha.Thue, SqlDbType.Float, 20).Value = ddh.Thue;
         cmd.Parameters.Add(ha.PhanTramChietKhau, SqlDbType.Float, 20).Value = ddh.PhanTramChietKhau;
         cmd.Parameters.Add(ha.GhiChu, SqlDbType.NVarChar).Value = ddh.GhiChu;
         cmd.Parameters.Add(ha.Deleted, SqlDbType.Bit).Value = ddh.Deleted;
         Trave = cmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     { string s = ex.Message.ToString(); }
     finally
     {
         cmd.Connection.Dispose();
         cn.Close();
         conn.closeConnection();
     }
     return Trave;
 }