Exemple #1
0
        public UcInfo()
        {
            InitializeComponent();

            data = new DTO.NguonCungCap();
            isUpdate = false;

            if (Init())
            {
                RefreshData();
            }
            else
            {
                this.Visible = false;
            }
        }
Exemple #2
0
        public UcInfo(DTO.NguonCungCap data)
        {
            InitializeComponent();

            this.data = data;
            isUpdate = true;
            lbSelect.Text = Constant.DEFAULT_TITLE_EDIT;

            if (Init())
            {
                tbTen.Text = data.Ten;
                tbDiaChi.Text = data.DiaChi;
                tbDTDD.Text = data.DTDD;
                tbEmail.Text = data.Email;
                tbGhiChu.Text = data.GhiChu;
            }
            else
            {
                this.Visible = false;
            }
        }
Exemple #3
0
        public static bool Delete(NguonCungCap data)
        {
            try
            {
                if (data != null)
                {
                    data.DeleteFlag = true;
                    dbContext.SubmitChanges();

                    return true;
                }
            }
            catch
            {

            }

            CreateSQlConnection();

            return false;
        }
 partial void DeleteNguonCungCap(NguonCungCap instance);
 partial void UpdateNguonCungCap(NguonCungCap instance);
 partial void InsertNguonCungCap(NguonCungCap instance);
 public static bool Update(NguonCungCap data)
 {
     return NguonCungCapDao.Update(data);
 }
 public static bool Insert(NguonCungCap data)
 {
     return NguonCungCapDao.Insert(data);
 }
 public static bool Delete(NguonCungCap data)
 {
     return NguonCungCapDao.Delete(data);
 }
Exemple #10
0
        public static bool Update(NguonCungCap data)
        {
            try
            {
                if (data != null)
                {
                    dbContext.SubmitChanges();

                    return true;
                }

                return false;
            }
            catch
            {
                return false;
            }
        }
Exemple #11
0
        public static bool Insert(NguonCungCap data)
        {
            try
            {
                if (GetByName(data.Ten) != null)
                {
                    return false;
                }

                dbContext.NguonCungCaps.InsertOnSubmit(data);
                dbContext.SubmitChanges();

                return true;
            }
            catch
            {
                return false;
            }
        }