Ejemplo n.º 1
0
        public void Insert_Update_Delete(Cls_LoaiKhachHang_DTA LoaiKH_Data, string sThucThi)
        {
            sConn.Open();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SP_LoaiKhachHang";
            cmd.Connection  = this.sConn;
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@MaLoaiKH", SqlDbType.Char);
            cmd.Parameters["@MaLoaiKH"].Value = LoaiKH_Data.MaLoaiKH;

            cmd.Parameters.Add("@TenLoaiKH", SqlDbType.NVarChar);
            cmd.Parameters["@TenLoaiKH"].Value = LoaiKH_Data.TenLoaiKH;

            cmd.Parameters.Add("@SoLuong", SqlDbType.Int);
            cmd.Parameters["@SoLuong"].Value = LoaiKH_Data.SoLuong;

            cmd.Parameters.Add("@sqlTemp", SqlDbType.NVarChar);
            if (sThucThi == "Insert" || sThucThi == "Delete" || sThucThi == "Update")
            {
                cmd.Parameters["@sqlTemp"].Value = sThucThi;
            }
            cmd.ExecuteNonQuery();

            sConn.Close();
        }
Ejemplo n.º 2
0
 public void Insert_Update_Delete(Cls_LoaiKhachHang_DTA LoaiKH_Data, string sThucThi)
 {
     LoaiKH_Bus.Insert_Update_Delete(LoaiKH_Data, sThucThi);
 }