void LoadData()
        {
            try
            {
                //List<Estate_Object_Info> _lst = _Estate_Object_Controller.Estate_Object_GetCbo((decimal)Enum_Contract_Type.Tenant);

                //cboChose_Estate_Object.ItemsSource = _lst;
                //cboChose_Estate_Object.DisplayMemberPath = "Estate_Name";
                //cboChose_Estate_Object.SelectedValuePath = "Estate_Id";
                //cboChose_Estate_Object.SelectedIndex = 0;

                List <AllCode_Info> _lst_Currency = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "CURENCY");
                cboCurrency.ItemsSource       = _lst_Currency;
                cboCurrency.DisplayMemberPath = "Content";
                cboCurrency.SelectedValuePath = "CdValue";
                cboCurrency.SelectedIndex     = 0;

                List <AllCode_Info> _lst_Term = DBMemory.AllCode_GetBy_CdNameCdType("FEE", "TERM");
                cboTerm.ItemsSource       = _lst_Term;
                cboTerm.DisplayMemberPath = "Content";
                cboTerm.SelectedValuePath = "CdValue";
                cboTerm.SelectedIndex     = 0;

                txtContract_Code.Text = "SIVN/HDMG/OW_";
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
Example #2
0
        private void frmChose_Estate_Object_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                AllCode_Info _AllCode_Info = new AllCode_Info();
                _AllCode_Info.Content = CommonData.c_All_Content;
                _AllCode_Info.CdValue = CommonData.c_All_Value;

                List <AllCode_Info> _lst_c_Status = DBMemory.AllCode_GetBy_CdNameCdType("ESTATE", "STATUS");
                _lst_c_Status.Insert(0, _AllCode_Info);
                cboStatus.ItemsSource       = _lst_c_Status;
                cboStatus.DisplayMemberPath = "Content";
                cboStatus.SelectedValuePath = "CdValue";
                cboStatus.SelectedIndex     = 0;

                List <AllCode_Info> _lst_c_type = DBMemory.AllCode_GetBy_CdNameCdType("ESTATE", "TYPE");
                _lst_c_type.Insert(0, _AllCode_Info);
                cboType.ItemsSource       = _lst_c_type;
                cboType.DisplayMemberPath = "Content";
                cboType.SelectedValuePath = "CdValue";
                cboType.SelectedIndex     = 0;

                //c_lst = c_Estate_Object_Controller.Estate_Object_GetAll();
                //dgrEstate.ItemsSource = c_lst;
                //DataGridHelper.NVSFocus(dgrEstate, 0, 0);
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
        void LoadCombobox()
        {
            try
            {
                AllCode_Info _AllCode_Info = new AllCode_Info();
                _AllCode_Info.Content = CommonData.c_All_Content;
                _AllCode_Info.CdValue = CommonData.c_All_Value;

                List <AllCode_Info> _lst_c_Status = DBMemory.AllCode_GetBy_CdNameCdType("ESTATE", "STATUS");
                _lst_c_Status.Insert(0, _AllCode_Info);
                cboStatus.ItemsSource       = _lst_c_Status;
                cboStatus.DisplayMemberPath = "Content";
                cboStatus.SelectedValuePath = "CdValue";
                cboStatus.SelectedIndex     = 0;

                List <AllCode_Info> _lst_c_type = DBMemory.AllCode_GetBy_CdNameCdType("ESTATE", "TYPE");
                _lst_c_type.Insert(0, _AllCode_Info);
                cboType.ItemsSource       = _lst_c_type;
                cboType.DisplayMemberPath = "Content";
                cboType.SelectedValuePath = "CdValue";
                cboType.SelectedIndex     = 0;
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #4
0
        void LoadCombobox()
        {
            try
            {
                AllCode_Info _AllCode_Info = new AllCode_Info();
                _AllCode_Info.Content = CommonData.c_All_Content;
                _AllCode_Info.CdValue = CommonData.c_All_Value;

                AllCode_Info _AllCode_Info1 = new AllCode_Info();
                _AllCode_Info1.Content = "HĐ sắp hết hạn (thông báo)";
                _AllCode_Info1.CdValue = ((decimal)Enum_Contract_Status.Den_Han_Thong_Bao).ToString();

                List <AllCode_Info> _lst_c_Status = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "STATUS");
                _lst_c_Status.Insert(0, _AllCode_Info);
                _lst_c_Status.Add(_AllCode_Info1);

                cboStatus.ItemsSource       = _lst_c_Status;
                cboStatus.DisplayMemberPath = "Content";
                cboStatus.SelectedValuePath = "CdValue";
                cboStatus.SelectedIndex     = 0;
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #5
0
 void LoadData()
 {
     try
     {
         List <AllCode_Info> _lst_Currency = DBMemory.AllCode_GetBy_CdNameCdType("CUSTOMER", "TYPE");
         cboType.ItemsSource       = _lst_Currency;
         cboType.DisplayMemberPath = "Content";
         cboType.SelectedValuePath = "CdValue";
         cboType.SelectedIndex     = 0;
     }
     catch (Exception ex)
     {
         ErrorLog.log.Error(ex.ToString());
     }
 }
        void LoadData()
        {
            try
            {
                //List<Estate_Object_Info> _lst = _Estate_Object_Controller.Estate_Object_GetCbo((decimal)Enum_Contract_Type.Renter);

                //cboChose_Estate_Object.ItemsSource = _lst;
                //cboChose_Estate_Object.DisplayMemberPath = "Estate_Name";
                //cboChose_Estate_Object.SelectedValuePath = "Estate_Id";
                //cboChose_Estate_Object.SelectedIndex = 0;

                List <AllCode_Info> _lst_Currency = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "CURENCY");
                cboCurrency.ItemsSource       = _lst_Currency;
                cboCurrency.DisplayMemberPath = "Content";
                cboCurrency.SelectedValuePath = "CdValue";
                cboCurrency.SelectedIndex     = 0;

                //decimal _contract_id = _Contract_Controller.Get_Max_Contract_Id();
                //string _str_contract_id = "";
                ////00001
                //if (_contract_id < 10)
                //{
                //    _str_contract_id = "0000" + _contract_id.ToString();
                //}
                //else if (_contract_id <= 99)
                //{
                //    _str_contract_id = "000" + _contract_id.ToString();
                //}
                //else if (_contract_id <= 999)
                //{
                //    _str_contract_id = "00" + _contract_id.ToString();
                //}
                //else if (_contract_id <= 9999)
                //{
                //    _str_contract_id = "0" + _contract_id.ToString();
                //}
                //else
                //{
                //    _str_contract_id = _contract_id.ToString();
                //}

                txtContract_Code.Text = "SIVN/HDMG_";
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
Example #7
0
        void LoadCombobox()
        {
            try
            {
                AllCode_Info _AllCode_Info = new AllCode_Info();
                _AllCode_Info.Content = CommonData.c_All_Content;
                _AllCode_Info.CdValue = CommonData.c_All_Value;

                List <AllCode_Info> _lst_PayStatus = DBMemory.AllCode_GetBy_CdNameCdType("FEE", "STATUS");
                _lst_PayStatus.Insert(0, _AllCode_Info);
                cboStatusPay.ItemsSource       = _lst_PayStatus;
                cboStatusPay.DisplayMemberPath = "Content";
                cboStatusPay.SelectedValuePath = "CdValue";
                cboStatusPay.SelectedIndex     = 0;

                List <AllCode_Info> _lst_c_Status = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "STATUS");
                _lst_c_Status.Insert(0, _AllCode_Info);
                cboStatus.ItemsSource       = _lst_c_Status;
                cboStatus.DisplayMemberPath = "Content";
                cboStatus.SelectedValuePath = "CdValue";
                cboStatus.SelectedIndex     = 0;

                Building_Info _Building_Info_All = new Building_Info();
                _Building_Info_All.Building_Id   = -1;
                _Building_Info_All.Building_Name = CommonData.c_All_Content;

                BuildingController   _BuildingController = new BuildingController();
                List <Building_Info> _lst_B = _BuildingController.Building_GetAll();
                _lst_B.Insert(0, _Building_Info_All);
                cboBuilding.ItemsSource       = _lst_B;
                cboBuilding.DisplayMemberPath = "Building_Name";
                cboBuilding.SelectedValuePath = "Building_Id";
                cboBuilding.SelectedIndex     = 0;

                //List<Contract_Info> _lst_contract = new List<Contract_Info>();
                //_lst_contract = c_Contract_Controller.Contract_GetBy_Type((decimal)Enum_Contract_Type.Renter);
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #8
0
        void LoadCombobox()
        {
            try
            {
                List <AllCode_Info> _lst_Status = DBMemory.AllCode_GetBy_CdNameCdType("ESTATE", "STATUS");
                cboStatus.ItemsSource       = _lst_Status;
                cboStatus.DisplayMemberPath = "Content";
                cboStatus.SelectedValuePath = "CdValue";
                cboStatus.SelectedIndex     = 0;

                List <AllCode_Info> _lst_Type = DBMemory.AllCode_GetBy_CdNameCdType("ESTATE", "TYPE");
                cboType.ItemsSource       = _lst_Type;
                cboType.DisplayMemberPath = "Content";
                cboType.SelectedValuePath = "CdValue";
                cboType.SelectedIndex     = 0;
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
Example #9
0
        void LoadCombobox()
        {
            try
            {
                AllCode_Info _AllCode_Info = new AllCode_Info();
                _AllCode_Info.Content = CommonData.c_All_Content;
                _AllCode_Info.CdValue = CommonData.c_All_Value;

                List <AllCode_Info> _lst_c_Status = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "STATUS");
                _lst_c_Status.Insert(0, _AllCode_Info);
                cboStatus.ItemsSource       = _lst_c_Status;
                cboStatus.DisplayMemberPath = "Content";
                cboStatus.SelectedValuePath = "CdValue";
                cboStatus.SelectedIndex     = 0;


                Building_Info _Building_Info_All = new Building_Info();
                _Building_Info_All.Building_Id   = -1;
                _Building_Info_All.Building_Name = CommonData.c_All_Content;

                BuildingController   _BuildingController = new BuildingController();
                List <Building_Info> _lst_B = _BuildingController.Building_GetAll();
                _lst_B.Insert(0, _Building_Info_All);
                cboBuilding.ItemsSource       = _lst_B;
                cboBuilding.DisplayMemberPath = "Building_Name";
                cboBuilding.SelectedValuePath = "Building_Id";
                cboBuilding.SelectedIndex     = 0;

                List <Contract_Info> _lst_contract = new List <Contract_Info>();
                _lst_contract = c_Contract_Controller.Contract_GetBy_Type((decimal)Enum_Contract_Type.Tenant);

                //dangtq sửa lại
                System.Data.DataTable temp = Common.ConvertData.ConvertToDatatable <Contract_Info>(_lst_contract);
                CommonFunction.NVS_BindTextboxComplete(txtCode, temp, "Contract_Code");
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #10
0
        void LoadData()
        {
            try
            {
                List <AllCode_Info> _lst_Currency = DBMemory.AllCode_GetBy_CdNameCdType("CUSTOMER", "TYPE");
                cboType.ItemsSource       = _lst_Currency;
                cboType.DisplayMemberPath = "Content";
                cboType.SelectedValuePath = "CdValue";
                cboType.SelectedIndex     = 0;

                txtCustomer_Name.Text = c_Customer_Info.Customer_Name;
                txtAddress.Text       = c_Customer_Info.Address;
                txtPhone.Text         = c_Customer_Info.Phone;
                txtFax.Text           = c_Customer_Info.Fax;
                txtTaxCode.Text       = c_Customer_Info.Tax_Code;
                txtIdentity_Card.Text = c_Customer_Info.Identity_Card;

                cboType.SelectedValue = c_Customer_Info.Is_Person;
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
Example #11
0
        void LoadData()
        {
            try
            {
                List <AllCode_Info> _lst_C_T = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "STATUS");

                cboStatus.ItemsSource       = _lst_C_T;
                cboStatus.DisplayMemberPath = "Content";
                cboStatus.SelectedValuePath = "CdValue";

                List <AllCode_Info> _lst_Currency = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "CURENCY");
                cboCurrency.ItemsSource       = _lst_Currency;
                cboCurrency.DisplayMemberPath = "Content";
                cboCurrency.SelectedValuePath = "CdValue";

                Estate_Object_Info _Estate_Object_Info = _Estate_Object_Controller.Estate_Object_GetById(c_Contract_Info.Estate_Id, (decimal)Enum_Contract_Type.Renter);
                lbl_Estate_Name.Content      = _Estate_Object_Info.Estate_Name;
                lbl_Estate_Code.Content      = _Estate_Object_Info.Estate_Code;
                lbl_Estate_Type_Name.Content = _Estate_Object_Info.Estate_Type_Name;
                lbl_Estate_Area.Content      = _Estate_Object_Info.Area;
                lbl_Address.Content          = _Estate_Object_Info.Address;

                Customer_Info _Customer_Info = c_Customer_Controller.Customer_GetById(c_Contract_Info.Object_Id);
                if (_Customer_Info != null)
                {
                    txtRenter_Name.Text   = _Customer_Info.Customer_Name;
                    txtAddress.Text       = _Customer_Info.Address;
                    txtPhone.Text         = _Customer_Info.Phone;
                    txtFax.Text           = _Customer_Info.Fax;
                    txtRepresentive.Text  = c_Contract_Info.Representive;
                    txtUsers.Text         = c_Contract_Info.Users;
                    txtTaxCode.Text       = _Customer_Info.Tax_Code;
                    txtIdentity_Card.Text = _Customer_Info.Identity_Card;
                }

                txtContract_Code.Text     = c_Contract_Info.Contract_Code;
                txtContract_Name.Text     = c_Contract_Info.Contract_Name;
                dpContractDate.Text       = c_Contract_Info.Contract_Date.ToString("dd/MM/yyyy");
                txtPrice.Text             = c_Contract_Info.Price.ToString("#,##0.#");
                cboCurrency.SelectedValue = c_Contract_Info.Currency;

                #region Fee VND
                if (c_Contract_Info.Currency == (decimal)Enum_Contract_Currency.USD)
                {
                    if (c_Contract_Info.Status == (decimal)Enum_Contract_Status.Gia_Han)
                    {
                        lblThanhTien_Extend.Visibility = Visibility.Visible;
                        txtFee_Vnd_Extend.Visibility   = Visibility.Visible;
                        lblVND_Extend.Visibility       = Visibility.Visible;

                        lblThanhTien.Visibility = Visibility.Collapsed;
                        txtFee_Vnd.Visibility   = Visibility.Collapsed;
                        lblVND.Visibility       = Visibility.Collapsed;
                    }
                    else
                    {
                        lblThanhTien.Visibility = Visibility.Visible;
                        txtFee_Vnd.Visibility   = Visibility.Visible;
                        lblVND.Visibility       = Visibility.Visible;

                        lblThanhTien_Extend.Visibility = Visibility.Collapsed;
                        txtFee_Vnd_Extend.Visibility   = Visibility.Collapsed;
                        lblVND_Extend.Visibility       = Visibility.Collapsed;
                    }
                }
                else
                {
                    lblThanhTien.Visibility = Visibility.Collapsed;
                    txtFee_Vnd.Visibility   = Visibility.Collapsed;
                    lblVND.Visibility       = Visibility.Collapsed;

                    lblThanhTien_Extend.Visibility = Visibility.Collapsed;
                    txtFee_Vnd_Extend.Visibility   = Visibility.Collapsed;
                    lblVND_Extend.Visibility       = Visibility.Collapsed;
                }
                #endregion

                dpFromDate.Text         = c_Contract_Info.Contract_FromDate.ToString("dd/MM/yyyy");
                dpToDate.Text           = c_Contract_Info.Contract_ToDate.ToString("dd/MM/yyyy");
                cboStatus.SelectedValue = c_Contract_Info.Status;

                txtFee.Text = c_Contract_Info.Fee.ToString("#,##0.#");

                List <Fees_Revenue_Info> c_lst_Fee        = new List <Fees_Revenue_Info>();
                List <Fees_Revenue_Info> c_lst_Fee_Extend = new List <Fees_Revenue_Info>();

                if (c_Contract_Info.Status == (decimal)Enum_Contract_Status.Gia_Han)
                {
                    Extend_Contract_Controller  _Extend_Contract_Controller = new Extend_Contract_Controller();
                    List <Extend_Contract_Info> _lst_ex = _Extend_Contract_Controller.Extend_Contract_GetByContractId(c_Contract_Info.Contract_Id);
                    if (_lst_ex.Count > 0)
                    {
                        txtFeeOnePay_Extend.Text = _lst_ex[0].FeeOnePay.ToString("#,##0.#");
                        txtFee_Extend.Text       = _lst_ex[0].Fee.ToString("#,##0.#");
                        dpFromDate_Extend.Text   = _lst_ex[0].Contract_FromDate.ToString("dd/MM/yyyy");
                        dpToDate_Extend.Text     = _lst_ex[0].Contract_ToDate.ToString("dd/MM/yyyy");
                    }

                    tabExtend.Visibility = Visibility.Visible;
                    List <Fees_Revenue_Info> _lst = _Fees_Revenue_Controller.Fees_Revenue_GetByContract(c_Contract_Info.Contract_Id);

                    foreach (Fees_Revenue_Info item in _lst)
                    {
                        if (item.Is_Extend == 1)
                        {
                            c_lst_Fee_Extend.Add(item);
                        }
                        else
                        {
                            c_lst_Fee.Add(item);
                        }
                    }

                    txtFee_Vnd_Extend.Text             = c_lst_Fee_Extend[c_lst_Fee_Extend.Count - 1].Fee_Vnd.ToString("#,##0.#");
                    txtFee_Vnd_Extend.Focusable        = false;
                    txtFee_Vnd_Extend.IsHitTestVisible = false;
                }
                else
                {
                    tabExtend.Visibility = Visibility.Collapsed;
                    c_lst_Fee            = _Fees_Revenue_Controller.Fees_Revenue_GetByContract(c_Contract_Info.Contract_Id);
                    txtFee_Vnd.Text      = c_lst_Fee[c_lst_Fee.Count - 1].Fee_Vnd.ToString("#,##0.#");

                    txtFee_Vnd.Focusable        = false;
                    txtFee_Vnd.IsHitTestVisible = false;
                }

                dgrFee.ItemsSource        = c_lst_Fee;
                dgrFee_Extend.ItemsSource = c_lst_Fee_Extend;
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
Example #12
0
        void LoadData()
        {
            try
            {
                List <AllCode_Info> _lst_Currency = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "CURENCY");
                cboCurrency.ItemsSource       = _lst_Currency;
                cboCurrency.DisplayMemberPath = "Content";
                cboCurrency.SelectedValuePath = "CdValue";

                List <AllCode_Info> _lst_Term = DBMemory.AllCode_GetBy_CdNameCdType("FEE", "TERM");
                cboTerm.ItemsSource       = _lst_Term;
                cboTerm.DisplayMemberPath = "Content";
                cboTerm.SelectedValuePath = "CdValue";

                cboTerm_Extend.ItemsSource       = _lst_Term;
                cboTerm_Extend.DisplayMemberPath = "Content";
                cboTerm_Extend.SelectedValuePath = "CdValue";

                List <AllCode_Info> _lst_C_T = DBMemory.AllCode_GetBy_CdNameCdType("CONTRACT", "STATUS");

                cboStatus.ItemsSource       = _lst_C_T;
                cboStatus.DisplayMemberPath = "Content";
                cboStatus.SelectedValuePath = "CdValue";

                Estate_Object_Info _Estate_Object_Info = _Estate_Object_Controller.Estate_Object_GetById(c_Contract_Info.Estate_Id, (decimal)Enum_Contract_Type.Tenant);
                if (_Estate_Object_Info != null)
                {
                    lbl_Estate_Name.Content      = _Estate_Object_Info.Estate_Name;
                    lbl_Estate_Code.Content      = _Estate_Object_Info.Estate_Code;
                    lbl_Estate_Type_Name.Content = _Estate_Object_Info.Estate_Type_Name;
                    lbl_Estate_Area.Content      = _Estate_Object_Info.Area;
                    lbl_Address.Content          = _Estate_Object_Info.Address;
                }

                Customer_Info _Customer_Info = c_Customer_Controller.Customer_GetById(c_Contract_Info.Object_Id);
                if (_Customer_Info != null)
                {
                    txtRenter_Name.Text   = _Customer_Info.Customer_Name;
                    txtAddress.Text       = _Customer_Info.Address;
                    txtPhone.Text         = _Customer_Info.Phone;
                    txtFax.Text           = _Customer_Info.Fax;
                    txtPosition.Text      = _Customer_Info.Position;
                    txtTaxCode.Text       = _Customer_Info.Tax_Code;
                    txtIdentity_Card.Text = _Customer_Info.Identity_Card;
                }

                txtRepresentive.Text = c_Contract_Info.Representive;
                txtUsers.Text        = c_Contract_Info.Users;

                txtContract_Code.Text     = c_Contract_Info.Contract_Code;
                dpContractDate.Text       = c_Contract_Info.Contract_Date.ToString("dd/MM/yyyy");
                cboCurrency.SelectedValue = c_Contract_Info.Currency;
                dpFromDate.Text           = c_Contract_Info.Contract_FromDate.ToString("dd/MM/yyyy");
                dpToDate.Text             = c_Contract_Info.Contract_ToDate.ToString("dd/MM/yyyy");
                txtFee.Text             = c_Contract_Info.Fee.ToString("#,##0.#");
                txtPrice.Text           = c_Contract_Info.Price.ToString("#,##0.#");
                cboTerm.SelectedValue   = c_Contract_Info.Term;
                cboStatus.SelectedValue = c_Contract_Info.Status;


                c_max_number_extend = _Extend_Contract_Controller.Get_Number_ExtendContract(c_Contract_Info.Contract_Id);

                List <Extend_Contract_Info> _lst_ex = new List <Extend_Contract_Info>();
                if (c_max_number_extend == 0)
                {
                    tabExtendInfo.Visibility = Visibility.Collapsed;
                }
                else
                {
                    tabExtendInfo.Visibility = Visibility.Visible;
                    _lst_ex = _Extend_Contract_Controller.Extend_Contract_GetByContractId(c_Contract_Info.Contract_Id);

                    dgrExtend.ItemsSource = _lst_ex;
                }

                List <Fees_Revenue_Info> c_lst_Fee        = new List <Fees_Revenue_Info>();
                List <Fees_Revenue_Info> c_lst_Fee_Extend = new List <Fees_Revenue_Info>();

                if (c_Contract_Info.Status == (decimal)Enum_Contract_Status.Gia_Han)
                {
                    if (_lst_ex.Count > 0)
                    {
                        txtFeeOnePay_Extend.Text     = _lst_ex[0].FeeOnePay.ToString("#,##0.#");
                        txtFee_Extend.Text           = _lst_ex[0].Fee.ToString("#,##0.#");
                        dpFromDate_Extend.Text       = _lst_ex[0].Contract_FromDate.ToString("dd/MM/yyyy");
                        dpToDate_Extend.Text         = _lst_ex[0].Contract_ToDate.ToString("dd/MM/yyyy");
                        cboTerm_Extend.SelectedValue = _lst_ex[0].Term;
                    }

                    tabExtend.Visibility = Visibility.Visible;
                    List <Fees_Revenue_Info> _lst = _Fees_Revenue_Controller.Fees_Revenue_GetByContract(c_Contract_Info.Contract_Id);

                    foreach (Fees_Revenue_Info item in _lst)
                    {
                        if (item.Is_Extend == c_max_number_extend)
                        {
                            c_lst_Fee_Extend.Add(item);
                        }
                        else
                        {
                            c_lst_Fee.Add(item);
                        }
                    }
                }
                else
                {
                    tabExtend.Visibility = Visibility.Collapsed;
                    c_lst_Fee            = _Fees_Revenue_Controller.Fees_Revenue_GetByContract(c_Contract_Info.Contract_Id);
                }

                dgrFee.ItemsSource        = c_lst_Fee;
                dgrFee_Extend.ItemsSource = c_lst_Fee_Extend;
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }