Esempio n. 1
0
        void Search()
        {
            try
            {
                Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;

                c_lst = c_Contract_Controller.Contract_Search_ByContract_Type(((decimal)Enum_Contract_Type.Tenant).ToString(), CommonData.c_All_Value,
                                                                              CommonData.c_All_Value, CommonData.c_All_Value, "-1");

                #region Tìm theo trạng thái thanh toán phí

                if (cboFee.SelectedValue.ToString() != CommonData.c_All_Value)
                {
                    List <Contract_Info> _tem = new List <Contract_Info>();

                    if (cboFee.SelectedValue.ToString() == ((decimal)Enum_HanFee.QuaHan).ToString())
                    {
                        foreach (Contract_Info item in c_lst)
                        {
                            if (DBMemory.KiemTra_QuaHan_ThanhToan(item.Contract_Id))
                            {
                                _tem.Add(item);
                            }
                        }
                    }
                    else
                    {
                        foreach (Contract_Info item in c_lst)
                        {
                            if (DBMemory.KiemTra_SapDenHan_ThanhToan(item.Contract_Id))
                            {
                                _tem.Add(item);
                            }
                        }
                    }

                    c_lst = _tem;
                }

                #endregion

                Mouse.OverrideCursor    = null;
                dgrContract.ItemsSource = c_lst;
                DataGridHelper.NVSFocus(dgrContract, 0, 0);
            }
            catch (Exception ex)
            {
                Mouse.OverrideCursor = null;
                ErrorLog.log.Error(ex.ToString());
            }
        }
Esempio n. 2
0
        void Search()
        {
            try
            {
                Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;

                string _code = txtCode.Text.ToUpper();

                if (_code == "")
                {
                    _code = CommonData.c_All_Value;
                }

                string _Building = "-1";
                if (cboBuilding.Text != CommonData.c_All_Content)
                {
                    _Building = cboBuilding.SelectedValue.ToString();
                }

                c_lst = c_Contract_Controller.Contract_Search_ByContract_Type(_tenant, _code, cboStatus.SelectedValue.ToString(), CommonData.c_All_Value, _Building);

                #region Tìm theo tên bên YC môi giới
                if (txtObject_Name.Text != "")
                {
                    List <Contract_Info> _tem = new List <Contract_Info>();
                    foreach (Contract_Info item in c_lst)
                    {
                        if (item.Object_Name.ToUpper().Contains(txtObject_Name.Text.ToUpper()))
                        {
                            _tem.Add(item);
                        }
                    }

                    c_lst = _tem;
                }
                #endregion

                #region Tìm theo trạng thái thanh toán phí

                if (cboFee.SelectedValue.ToString() != CommonData.c_All_Value)
                {
                    List <Contract_Info> _tem = new List <Contract_Info>();

                    if (cboFee.SelectedValue.ToString() == ((decimal)Enum_HanFee.QuaHan).ToString())
                    {
                        foreach (Contract_Info item in c_lst)
                        {
                            if (DBMemory.KiemTra_QuaHan_ThanhToan(item.Contract_Id))
                            {
                                _tem.Add(item);
                            }
                        }
                    }
                    else
                    {
                        foreach (Contract_Info item in c_lst)
                        {
                            if (DBMemory.KiemTra_SapDenHan_ThanhToan(item.Contract_Id))
                            {
                                _tem.Add(item);
                            }
                        }
                    }

                    c_lst = _tem;
                }

                #endregion

                Mouse.OverrideCursor = null;

                dgrContract.ItemsSource = c_lst;
                DataGridHelper.NVSFocus(dgrContract, 0, 0);
            }
            catch (Exception ex)
            {
                Mouse.OverrideCursor = null;
                ErrorLog.log.Error(ex.ToString());
            }
        }