Пример #1
0
        void Delete_Contract()
        {
            try
            {
                c_row_select = dgrContract.SelectedIndex;
                Contract_Info _Contract_Info = (Contract_Info)dgrContract.SelectedItem;

                if (_Contract_Info == null)
                {
                    return;
                }

                MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn xóa hợp đồng này hay không?", "Thông báo", NoteBoxLevel.Question);
                if (MessageBoxResult.Yes == result)
                {
                    if (c_Contract_Controller.Contract_Delete(_Contract_Info.Contract_Id))
                    {
                        NoteBox.Show("Xóa dữ liệu thành công");
                        Search();
                        DBMemory.LoadFeeRender();
                    }
                }
                else
                {
                    DataGridHelper.NVSFocus(dgrContract, c_row_select, 0);
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Пример #2
0
        void Contract_Update()
        {
            try
            {
                c_row_select = dgrContract.SelectedIndex;
                Contract_Info _Contract_Info = (Contract_Info)dgrContract.SelectedItem;

                if (_Contract_Info == null)
                {
                    return;
                }
                Update_Contract_Insert_Renter _Update_Contract_Insert_Renter = new Update_Contract_Insert_Renter();
                _Update_Contract_Insert_Renter.c_Contract_Info = _Contract_Info;
                _Update_Contract_Insert_Renter.Owner           = Window.GetWindow(this);
                _Update_Contract_Insert_Renter.ShowDialog();
                if (_Update_Contract_Insert_Renter.c_id_insert != 0)
                {
                    Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
                    Search();
                    DBMemory.LoadFeeRender();
                    Mouse.OverrideCursor = null;
                }

                DataGridHelper.NVSFocus(dgrContract, c_row_select, 0);
            }
            catch (Exception ex)
            {
                Mouse.OverrideCursor = null;
                CommonData.log.Error(ex.ToString());
            }
        }
Пример #3
0
        void Delete_Contract()
        {
            try
            {
                c_row_select = dgrRenter.SelectedIndex;
                Customer_Info _Customer_Info = (Customer_Info)dgrRenter.SelectedItem;

                if (_Customer_Info == null)
                {
                    return;
                }

                if (c_Customer_Controller.Customer_Check_In_Contract(_Customer_Info.Customer_Id) == false)
                {
                    NoteBox.Show("Tồn tại khách hàng trong hợp đồng, không thể xóa", "", NoteBoxLevel.Error);
                    return;
                }

                MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn xóa khách hàng này hay không?", "Thông báo", NoteBoxLevel.Question);
                if (MessageBoxResult.Yes == result)
                {
                    if (c_Customer_Controller.Customer_Delete(_Customer_Info.Customer_Id))
                    {
                        NoteBox.Show("Xóa dữ liệu thành công");
                        Search();
                        DBMemory.LoadFeeRender();
                    }
                }
                else
                {
                    DataGridHelper.NVSFocus(dgrRenter, c_row_select, 0);
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Пример #4
0
        void Insert_Customer()
        {
            try
            {
                Customer_Insert _Customer_Insert = new Customer_Insert();
                _Customer_Insert.Owner = Window.GetWindow(this);
                _Customer_Insert.ShowDialog();

                if (_Customer_Insert.c_id_insert != 0)
                {
                    Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;

                    Search();

                    DBMemory.LoadFeeRender();

                    for (int i = 0; i < c_lst.Count; i++)
                    {
                        Customer_Info ui = (Customer_Info)c_lst[i];
                        if (ui.Customer_Id == _Customer_Insert.c_id_insert)
                        {
                            c_row_select = i;
                            _Customer_Insert.c_id_insert = 0;
                            break;
                        }
                    }
                }

                Mouse.OverrideCursor = null;
                DataGridHelper.NVSFocus(dgrRenter, c_row_select, 0);
            }
            catch (Exception ex)
            {
                Mouse.OverrideCursor = null;
                CommonData.log.Error(ex.ToString());
            }
        }