Пример #1
0
 public void DeleteBatch(DataRow[] rowUpdate)
 {
     DataAccess objDataAccess = new DataAccess();
     using (SqlCommand sqlCmd = new SqlCommand())
     {
         sqlCmd.CommandType = CommandType.StoredProcedure;
         sqlCmd.CommandText = "DeleteLoaiCuaHang";
         sqlCmd.Parameters.Add("@LoaiCuaHangID", SqlDbType.Int).SourceColumn = "LoaiCuaHangID";
         objDataAccess.UpdateBatch(rowUpdate, sqlCmd, dtTblMapping);
     }
 }
Пример #2
0
        public void UpdateBatch(ref DataRow[] rowUpdate)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "UpdateCuaHang";
                   		sqlCmd.Parameters.Add("@CuaHangID",SqlDbType.Int).SourceColumn = "CuaHangID";

                       sqlCmd.Parameters.Add("@TenCuaHang",SqlDbType.NVarChar,100).SourceColumn = "TenCuaHang";

                       sqlCmd.Parameters.Add("@GioiThieu",SqlDbType.NVarChar,4000).SourceColumn = "GioiThieu";

                   		sqlCmd.Parameters.Add("@NguoiDungID",SqlDbType.Int).SourceColumn = "NguoiDungID";

                       sqlCmd.Parameters.Add("@Email",SqlDbType.NVarChar,50).SourceColumn = "Email";

                       sqlCmd.Parameters.Add("@Anh",SqlDbType.NVarChar,100).SourceColumn = "Anh";

                       sqlCmd.Parameters.Add("@DienThoaiDiDong",SqlDbType.NVarChar,50).SourceColumn = "DienThoaiDiDong";

                       sqlCmd.Parameters.Add("@DienThoaiCoDinh",SqlDbType.NVarChar,50).SourceColumn = "DienThoaiCoDinh";

                       sqlCmd.Parameters.Add("@ThongTinLienHe",SqlDbType.NVarChar,4000).SourceColumn = "ThongTinLienHe";

                       sqlCmd.Parameters.Add("@DiaChi",SqlDbType.NVarChar,200).SourceColumn = "DiaChi";

                       sqlCmd.Parameters.Add("@Website",SqlDbType.NVarChar,200).SourceColumn = "Website";

                       sqlCmd.Parameters.Add("@Fax",SqlDbType.NVarChar,50).SourceColumn = "Fax";

                       sqlCmd.Parameters.Add("@YM",SqlDbType.NVarChar,50).SourceColumn = "YM";

                   		sqlCmd.Parameters.Add("@KichHoat",SqlDbType.Bit).SourceColumn = "KichHoat";

                   		sqlCmd.Parameters.Add("@SapXep",SqlDbType.Int).SourceColumn = "SapXep";

                       sqlCmd.Parameters.Add("@Bak1",SqlDbType.NVarChar,50).SourceColumn = "Bak1";

                       sqlCmd.Parameters.Add("@Bak2",SqlDbType.NVarChar,1000).SourceColumn = "Bak2";

                   		sqlCmd.Parameters.Add("@Bak3",SqlDbType.Int).SourceColumn = "Bak3";

                   		sqlCmd.Parameters.Add("@Bak4",SqlDbType.Int).SourceColumn = "Bak4";

                   		sqlCmd.Parameters.Add("@Bak5",SqlDbType.Bit).SourceColumn = "Bak5";

                       sqlCmd.Parameters.Add("@bak6",SqlDbType.NVarChar,50).SourceColumn = "bak6";

                       sqlCmd.Parameters.Add("@bak7",SqlDbType.NVarChar,1000).SourceColumn = "bak7";

                       sqlCmd.Parameters.Add("@bak8",SqlDbType.NVarChar,1000).SourceColumn = "bak8";

                   		sqlCmd.Parameters.Add("@Bak9",SqlDbType.Int).SourceColumn = "Bak9";

                   		sqlCmd.Parameters.Add("@BaoDam",SqlDbType.TinyInt).SourceColumn = "BaoDam";

                   		sqlCmd.Parameters.Add("@LoaiCuaHang",SqlDbType.TinyInt).SourceColumn = "LoaiCuaHang";

                   		sqlCmd.Parameters.Add("@LoaiCuaHangID",SqlDbType.Int).SourceColumn = "LoaiCuaHangID";

                objDataAccess.UpdateBatch(ref rowUpdate, sqlCmd, dtTblMapping);
            }
        }
Пример #3
0
        public void UpdateBatch(ref DataRow[] rowUpdate)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "UpdateLoaiCuaHang";
                   		sqlCmd.Parameters.Add("@LoaiCuaHangID",SqlDbType.Int).SourceColumn = "LoaiCuaHangID";

                       sqlCmd.Parameters.Add("@TenLoaiCuaHang",SqlDbType.NVarChar,100).SourceColumn = "TenLoaiCuaHang";

                       sqlCmd.Parameters.Add("@Mota",SqlDbType.NVarChar,200).SourceColumn = "Mota";

                objDataAccess.UpdateBatch(ref rowUpdate, sqlCmd, dtTblMapping);
            }
        }
Пример #4
0
        public void InsertBatch(ref DataRow[] rowInsert)
        {
            DataAccess objDataAccess = new DataAccess();
            using (SqlCommand sqlCmd = new SqlCommand())
            {
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.CommandText = "InsertLoaiCuaHang_Ref";
                sqlCmd.Parameters.Add("@LoaiCuaHangID", SqlDbType.Int ).SourceColumn = "LoaiCuaHangID";
                sqlCmd.Parameters["@LoaiCuaHangID"].Direction = ParameterDirection.Output;
                       sqlCmd.Parameters.Add("@TenLoaiCuaHang",SqlDbType.NVarChar,4).SourceColumn = "TenLoaiCuaHang";

                       sqlCmd.Parameters.Add("@Mota",SqlDbType.NVarChar,100).SourceColumn = "Mota";

                objDataAccess.UpdateBatch(ref rowInsert, sqlCmd, dtTblMapping);
            }
        }