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

            ExecuteCommand(Declare.StoreProcedureNamespace.spKhaiBaoDelete, dmListInfor.TblName);
        }
示例#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));
        }
示例#4
0
        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();
        }
示例#5
0
        private DMListInfor getinfor()
        {
            DMListInfor khaiBaoDMInfo = new DMListInfor();

            khaiBaoDMInfo.Name    = txtTenDanhMuc.Text;
            khaiBaoDMInfo.TblName = txtTenBang.Text;
            khaiBaoDMInfo.OnlyPOS = Convert.ToInt32(chkSuDung.Checked);
            return(khaiBaoDMInfo);
        }
示例#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>();
        }
示例#7
0
        internal bool IsSync(string tableName)
        {
            DMListInfor dmListInfor = GetDoiTuongByIdInfo(tableName);

            if (dmListInfor == null)
            {
                return(false);
            }
            return(dmListInfor.OnlyPOS == 0);
        }
示例#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));
        }
示例#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);
        }
示例#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);
        }
示例#12
0
 private bool Exist(DMListInfor khaiBaoDMInfo)
 {
     return(khaiBaoDMInfo.TblName.ToLower() == txtTenBang.Text.Trim().ToLower());
 }
示例#13
0
 public static List <DMListInfor> Search(DMListInfor match)
 {
     return(DmListDAO.Instance.Search(match));
 }
示例#14
0
 internal static bool Kiemtra(DMListInfor match)
 {
     return(DmListDAO.Instance.Exist(match));
 }
示例#15
0
 public static void Delete(DMListInfor dmListInfor)
 {
     DmListDAO.Instance.Delete(dmListInfor);
 }
示例#16
0
 internal static void Update(DMListInfor dmListInfor)
 {
     DmListDAO.Instance.Update(dmListInfor);
 }
示例#17
0
 internal static void Insert(DMListInfor dmListInfor)
 {
     DmListDAO.Instance.Insert(dmListInfor);
 }