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;
                }
            }
        }
Exemple #2
0
        internal void Delete(DMListInfor dmListInfor)
        {
            //CreateCommonCommand(Declare.StoreProcedureNamespace.spKhaiBaoDelete);
            //Parameters.AddWithValue("@TblName", dmListInfor.TblName);
            //ExecuteNoneQuery();

            ExecuteCommand(Declare.StoreProcedureNamespace.spKhaiBaoDelete, dmListInfor.TblName);
        }
Exemple #3
0
        //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);
        }
Exemple #6
0
        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>();
        }
Exemple #7
0
        internal bool IsSync(string tableName)
        {
            DMListInfor dmListInfor = GetDoiTuongByIdInfo(tableName);

            if (dmListInfor == null)
            {
                return(false);
            }
            return(dmListInfor.OnlyPOS == 0);
        }
Exemple #8
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));
        }
Exemple #9
0
        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);
        }
Exemple #10
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());
 }
Exemple #13
0
 public static List <DMListInfor> Search(DMListInfor match)
 {
     return(DmListDAO.Instance.Search(match));
 }
Exemple #14
0
 internal static bool Kiemtra(DMListInfor match)
 {
     return(DmListDAO.Instance.Exist(match));
 }
Exemple #15
0
 public static void Delete(DMListInfor dmListInfor)
 {
     DmListDAO.Instance.Delete(dmListInfor);
 }
Exemple #16
0
 internal static void Update(DMListInfor dmListInfor)
 {
     DmListDAO.Instance.Update(dmListInfor);
 }
Exemple #17
0
 internal static void Insert(DMListInfor dmListInfor)
 {
     DmListDAO.Instance.Insert(dmListInfor);
 }