public void TestListDM03_MaListDMHasExistedOnUpdate() { try { TestListDM05_InsertSuccess(); List <DMListInfor> list = KhaiBaoDMDataProvider.GetListKhaiBaoInfo(); DMListInfor infor = list.Find(delegate(DMListInfor match) { return(match.TblName == "tbl_dm_1"); }); frmDM_ListDM frm = new frmDM_ListDM(); frm.isAdd = true; frm.TblName = infor.TblName; frmChiTiet_ListDM frmChiTietListDM = new frmChiTiet_ListDM(frm); frmChiTietListDM.SetInput("Danh mục 1", "fgh", 1); frmChiTietListDM.TestSave(); Assert.AreEqual("Khong chay dong nay", String.Empty); } catch (Exception ex) { if (ex.GetType() != typeof(AssertFailedException)) { Assert.AreEqual(ex.Message, "Tên bảng đã tồn tại trong hệ thống !"); } else { throw; } } }
internal void Delete(DMListInfor dmListInfor) { //CreateCommonCommand(Declare.StoreProcedureNamespace.spKhaiBaoDelete); //Parameters.AddWithValue("@TblName", dmListInfor.TblName); //ExecuteNoneQuery(); ExecuteCommand(Declare.StoreProcedureNamespace.spKhaiBaoDelete, dmListInfor.TblName); }
//public List<DMSanPhamPairInfo> GetListSanPhamCBOInfo() //{ // return GetListAll<DMSanPhamPairInfo>(Declare.StoreProcedureNamespace.spSanPhamSelectPair, Declare.TableNamespace.DmSanPham); //} internal void Update(DMListInfor dmListInfor) { //CreateCommonCommand(Declare.StoreProcedureNamespace.spKhaiBaoUpdate); //SetParams(dmListInfor); //ExecuteNoneQuery(); ExecuteCommand(Declare.StoreProcedureNamespace.spKhaiBaoUpdate, ParseToParams <DMListInfor>(dmListInfor)); }
private void ucActions1_OnDelete(object obj) { DMListInfor khaibao = new DMListInfor(); khaibao.TblName = txtTenBang.Text.Trim(); KhaiBaoDMDataProvider.Delete(khaibao); MessageBox.Show("Xóa Thành Công", "Thông Báo"); dgvListDM.DataSource = KhaiBaoDMDataProvider.GetListKhaiBaoInfo(); }
private DMListInfor getinfor() { DMListInfor khaiBaoDMInfo = new DMListInfor(); khaiBaoDMInfo.Name = txtTenDanhMuc.Text; khaiBaoDMInfo.TblName = txtTenBang.Text; khaiBaoDMInfo.OnlyPOS = Convert.ToInt32(chkSuDung.Checked); return(khaiBaoDMInfo); }
internal List <DMListInfor> Search(DMListInfor dmListInfor) { return(GetListCommand <DMListInfor>(Declare.StoreProcedureNamespace.spKhaiBaoSearch, dmListInfor.TblName, dmListInfor.Name)); //CreateCommand(Declare.StoreProcedureNamespace.spKhaiBaoSearch, dmListInfor.TblName, dmListInfor.Name); //return FillToList<DMListInfor>(); }
internal bool IsSync(string tableName) { DMListInfor dmListInfor = GetDoiTuongByIdInfo(tableName); if (dmListInfor == null) { return(false); } return(dmListInfor.OnlyPOS == 0); }
internal void Insert(DMListInfor dmListInfor) { //CreateCommonCommand(Declare.StoreProcedureNamespace.spKhaiBaoInsert); //SetParams(dmListInfor); //Parameters["@IdDoiTuong"].Direction = ParameterDirection.Output; //ExecuteNoneQuery(); //return Convert.ToInt32(Parameters["@IdDoiTuong"].Value.ToString()); ExecuteCommand(Declare.StoreProcedureNamespace.spKhaiBaoInsert, ParseToParams <DMListInfor>(dmListInfor)); }
internal bool Exist(DMListInfor dmListInfor) { //CreateCommand(Declare.StoreProcedureNamespace.spKhaiBaoExist); //Parameters.AddWithValue("@Count", 0).Direction = ParameterDirection.Output; //Parameters.AddWithValue("@TblName", dmListInfor.TblName); //ExecuteNoneQuery(); //object result = ExecuteScalar(Declare.StoreProcedureNamespace.spKhaiBaoExist, 0, dmListInfor.TblName); //return Convert.ToInt32(result) == 1; return(GetObjectCommand <int>(Declare.StoreProcedureNamespace.spKhaiBaoExist, dmListInfor.TblName) > 0); }
private void Loaddata() { if (frmDMList.isAdd) { Reset(); } else { txtTenBang.Enabled = false; dm = KhaiBaoDMDataProvider.GetListDMInfoFromOid(frmDMList.TblName); txtTenBang.Text = dm.TblName; txtTenDanhMuc.Text = dm.Name; chkSuDung.Checked = dm.OnlyPOS == 1; txtTenBang.Focus(); } }
public void TestListDM07_DeleteSuccess() { TestListDM05_InsertSuccess(); List <DMListInfor> list = KhaiBaoDMDataProvider.GetListKhaiBaoInfo(); DMListInfor infor = list.Find(delegate(DMListInfor match) { return(match.TblName == "tbl_dm_1"); }); frmDM_ListDM frm = new frmDM_ListDM(); frm.isAdd = false; frm.TblName = infor.TblName; frmChiTiet_ListDM frmChiTietListDM = new frmChiTiet_ListDM(frm); frmChiTietListDM.TestDelete(); list = KhaiBaoDMDataProvider.GetListKhaiBaoInfo(); infor = list.Find(delegate(DMListInfor match) { return(match.TblName == "tbl_dm_1"); }); Assert.AreEqual(infor, null); }
private bool Exist(DMListInfor khaiBaoDMInfo) { return(khaiBaoDMInfo.TblName.ToLower() == txtTenBang.Text.Trim().ToLower()); }
public static List <DMListInfor> Search(DMListInfor match) { return(DmListDAO.Instance.Search(match)); }
internal static bool Kiemtra(DMListInfor match) { return(DmListDAO.Instance.Exist(match)); }
public static void Delete(DMListInfor dmListInfor) { DmListDAO.Instance.Delete(dmListInfor); }
internal static void Update(DMListInfor dmListInfor) { DmListDAO.Instance.Update(dmListInfor); }
internal static void Insert(DMListInfor dmListInfor) { DmListDAO.Instance.Insert(dmListInfor); }