private void Load_ChiNhanh()
 {
     this.lb_ChiNhanh.DataSource     = ChiNhanhDAO.Get();
     this.lb_ChiNhanh.DataValueField = "ID";
     this.lb_ChiNhanh.DataTextField  = "Name";
     this.lb_ChiNhanh.DataBind();
 }
Exemple #2
0
 protected void lv_ThongTinSP_ItemInserting(object sender, ListViewInsertEventArgs e)
 {
     if (_objCheckPermision.Permission(_objCheckPermision.LayQuyen("strChiNhanh_Them")))
     {
         var t0  = new DAO.Branch();
         var txt = (e.Item.FindControl("txt_Name")) as TextBox;
         if (txt != null)
         {
             t0.Name = txt.Text;
         }
         txt = (e.Item.FindControl("txt_Name")) as TextBox;
         if (txt != null)
         {
             t0.Name = txt.Text;
         }
         ChiNhanhDAO.Insert(t0);
         lv_ThongTinSP.EditIndex = -1;
         BinList();
     }
     else
     {
         iRightAccess.Visible = false;
         ObjControl.LoadMyControl(idNotPermissionAccess, NotPermissControl);
     }
 }
Exemple #3
0
 private void Load()
 {
     this.HousesCollection   = NhaDAO.GetInstance().GetAllHouses();
     this.allAgencies        = ChiNhanhDAO.GetInstance().GetAllAgencies();
     this.allHouseOwners     = ChuNhaDAO.GetInstance().GetAllHousOwners();
     this.allStaffs          = NhanVienDAO.GetInstance().GetAllStaffs();
     this.allHouseCategories = LoaiNhaDAO.GetInstance().GetAllHouseCategories();
 }
        private void Load_ChiNhanh()
        {
            var ddl_ChiNhanhID = (DropDownList)this.lv_ThongTinSP.InsertItem.FindControl("ddl_ChiNhanhID");

            ddl_ChiNhanhID.DataSource     = ChiNhanhDAO.Get();
            ddl_ChiNhanhID.DataValueField = "ID";
            ddl_ChiNhanhID.DataTextField  = "Name";
            ddl_ChiNhanhID.DataBind();
        }
        private void DeleteExtendedClosingEventHandler(object sender, DialogClosingEventArgs eventArgs)
        {
            if (eventArgs.Parameter is bool parameter &&
                !parameter)
            {
                return;
            }

            ChiNhanhDAO.GetInstance().DeleteAgency(this.AgencyDetailViewModel.SelectedAgency);
            Load();
        }
        /* private async void ExecuteChangeSalaryDialog(object obj)
         * {
         *   this.ChangeAllSalaryByPercentDialogViewModel = new ChangeAllSalaryByPercentDialogViewModel();
         *
         *   var view = new ChangeAllSalaryByPercentDialog
         *   {
         *       DataContext = this.ChangeAllSalaryByPercentDialogViewModel
         *   };
         *
         *   //show the dialog
         *   var result = await DialogHost.Show(view, BaseMainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, ChangeSalryClosingEventHandler).ConfigureAwait(false);
         *
         *   //check the result...
         *   Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL"));
         * }
         *
         * private async void ExecuteDoCharityDialog(object obj)
         * {
         *   this.EachMonthCharityMoneyDialogViewModel = new EachMonthCharityMoneyDialogViewModel();
         *
         *   var view = new EachMonthCharityMoneyDialog()
         *   {
         *       DataContext = this.EachMonthCharityMoneyDialogViewModel
         *   };
         *
         *   //show the dialog
         *   var result = await DialogHost.Show(view, BaseMainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, DoCharityClosingEventHandler).ConfigureAwait(false);
         *
         *   //check the result...
         *   Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL"));
         * }
         */
        private void AddNewAgencyClosingEventHandler(object sender, DialogClosingEventArgs eventArgs)
        {
            if (eventArgs.Parameter is bool parameter &&
                !parameter)
            {
                return;
            }

            var agency = this.AgencyDetailViewModel.SelectedAgency;

            ChiNhanhDAO.GetInstance().AddNewAgency(agency);
            Load();
        }
Exemple #7
0
        protected void lv_ThongTinSP_ItemDeleting(object sender, ListViewDeleteEventArgs e)
        {
            if (_objCheckPermision.Permission(_objCheckPermision.LayQuyen("strChiNhanh_Xoa")))
            {
                var hdf = (lv_ThongTinSP.Items[e.ItemIndex].FindControl("hfID")) as HiddenField;

                if (hdf != null)
                {
                    ChiNhanhDAO.Delete(Int32.Parse(hdf.Value));
                    lv_ThongTinSP.EditIndex = -1;
                    BinList();
                }
            }
            else
            {
                iRightAccess.Visible = false;
                ObjControl.LoadMyControl(idNotPermissionAccess, NotPermissControl);
            }
        }
        private async void ExecuteEditAgencyCommand(int agencyId)
        {
            this.ModifiedAgency = ChiNhanhDAO.GetInstance().GetAgencyById(agencyId);

            this.AgencyDetailViewModel = new AgencyDetailViewModel
            {
                SelectedAgency = this.ModifiedAgency
            };

            var view = new AgencyDetailDialog
            {
                DataContext = this.AgencyDetailViewModel
            };

            //show the dialog
            var result = await DialogHost.Show(view, BaseMainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, EditAgencyClosingEventHandler).ConfigureAwait(false);

            //check the result...
            Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL"));
        }
        private async void ExecuteDeleteAgencyCommand(int agencyId)
        {
            this.ModifiedAgency = ChiNhanhDAO.GetInstance().GetAgencyById(agencyId);

            var okeCancelDialogViewModel = new OkCancelDialogViewModel
            {
                Message = "Xóa chi nhánh này?"
            };

            var view = new OkCancelDialogControl
            {
                DataContext = okeCancelDialogViewModel
            };

            //show the dialog
            var result = await DialogHost.Show(view, BaseMainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, DeleteExtendedClosingEventHandler).ConfigureAwait(false);

            //check the result...
            Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL"));
        }
Exemple #10
0
 protected void lbtnUpdate_Click(object sender, EventArgs e)
 {
     if (_objCheckPermision.Permission(_objCheckPermision.LayQuyen("strChiNhanh_Sua")))
     {
         try
         {
             foreach (ListViewDataItem lvit in lv_ThongTinSP.Items)
             {
                 string chiNhanhID;
                 if (((HiddenField)lvit.FindControl("hfID")).Value != "")
                 {
                     chiNhanhID = ((HiddenField)lvit.FindControl("hfID")).Value;
                 }
                 else
                 {
                     ltr_Notice.Text = ObjComm.ShowNotice(
                         false, "Cập nhật thông tin thất bại.\nLỗi trong quá trình nhận dạng chi nhánh");
                     return;
                 }
                 DAO.Branch t0 = ChiNhanhDAO.Get(Int32.Parse(chiNhanhID));
                 t0.Name = ((TextBox)lvit.FindControl("txt_Name")).Text;
                 t0.Name = ((TextBox)lvit.FindControl("txt_Name")).Text;
                 ChiNhanhDAO.Update();
             }
             ltr_Notice.Text = ObjComm.ShowNotice(true, "Cập nhật thông tin thành công!");
         }
         catch (Exception ex)
         {
             ltr_Notice.Text = ObjComm.ShowNotice(
                 false, "Cập nhật thông tin thất bại. Chi tiết lỗi: " + ex.Message);
         }
     }
     else
     {
         ObjComm.wr(
             "<script language='javascript'>alert('Bạn không có quyền thực hiện chức năng này.');location.href='tin-tuc';</script>");
     }
 }
 private void Load()
 {
     this.CustomersCollection = KhachHangDAO.GetInstance().GetAllCustomers();
     this.allAgencies         = ChiNhanhDAO.GetInstance().GetAllAgencies();
 }
Exemple #12
0
 private void BinList()
 {
     lv_ThongTinSP.DataSource = ChiNhanhDAO.Get();
     lv_ThongTinSP.DataBind();
 }
Exemple #13
0
 private void Load()
 {
     this.allStaffs   = NhanVienDAO.GetInstance().GetAllStaffs();
     this.allAgencies = ChiNhanhDAO.GetInstance().GetAllAgencies();
 }
 private void Load()
 {
     this.AgenciesCollection = ChiNhanhDAO.GetInstance().GetAllAgencies();
 }