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

                string _status = cboStatus.SelectedValue.ToString();

                if (_status == ((decimal)Enum_Contract_Status.Den_Han_Thong_Bao).ToString())
                {
                    c_lst = c_Contract_Controller.Contract_Search_DenHanTB(ConvertData.ConvertDate2String(DateTime.Now), ConvertData.ConvertDate2String(DateTime.Now.AddDays(60)));
                }
                else
                {
                    c_lst = c_Contract_Controller.Contract_Search_ByContract_Type(CommonData.c_All_Value, CommonData.c_All_Value,
                                                                                  cboStatus.SelectedValue.ToString(), CommonData.c_All_Value, "-1");

                    //c_lst = c_Contract_Controller.Contract_Render_Search(CommonData.c_All_Value, cboStatus.SelectedValue.ToString(), CommonData.c_All_Value, "-1", CommonData.c_All_Value);
                }

                Mouse.OverrideCursor    = null;
                dgrContract.ItemsSource = c_lst;
                DataGridHelper.NVSFocus(dgrContract, 0, 0);
            }
            catch (Exception ex)
            {
                Mouse.OverrideCursor = null;
                ErrorLog.log.Error(ex.ToString());
            }
        }
Beispiel #2
0
        private Hashtable hashRibbonButtonFunction = new Hashtable();       //danh sach cac ribbon button ma co tag trong function list (chinh la nhung ribbon button can phan quyen)

        #region Event
        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            try
            {
                #region Tạm thời bỏ
                //List<Contract_Info> _lst_tem = new List<Contract_Info>();
                //List<Contract_Info> _lst = new List<Contract_Info>();
                //List<Contract_Info> _lst_nopay = new List<Contract_Info>();
                //Contract_Controller _Contract_Controller = new Contract_Controller();
                //_lst_tem = _Contract_Controller.Get_Contract_Exprire_Date(ConvertData.ConvertDate2String(DateTime.Now));
                //foreach (Contract_Info item in _lst_tem)
                //{
                //    if (item.Fee_Status == (decimal)Enum_Fee_Status.Payed)
                //    {
                //        _lst.Add(item);
                //    }
                //    else
                //        _lst_nopay.Add(item);
                //}

                //if (_lst.Count > 0)
                //{
                //    StartsInternational.Contract.Create.Auto_StatusContract _Auto_StatusContract = new Contract.Create.Auto_StatusContract();
                //    _Auto_StatusContract.c_lst = _lst;
                //    _Auto_StatusContract.Owner = Window.GetWindow(this);
                //    _Auto_StatusContract.ShowDialog();
                //}
                #endregion

                Contract_Controller  _Contract_Controller = new Contract_Controller();
                List <Contract_Info> _lst_nopay           = _Contract_Controller.Contract_Search_DenHanTB(ConvertData.ConvertDate2String(DateTime.Now), ConvertData.ConvertDate2String(DateTime.Now.AddDays(60)));

                if (_lst_nopay.Count > 0)
                {
                    Contract_HetHan_Display _Contract_HetHan_Display = new Contract_HetHan_Display();
                    _Contract_HetHan_Display.c_lst = _lst_nopay;
                    _Contract_HetHan_Display.Owner = Window.GetWindow(this);
                    _Contract_HetHan_Display.ShowDialog();
                }
                InitAllDockForm();
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
        void LoadData(bool p_is_call)
        {
            try
            {
                if (p_is_call == false)
                {
                    dgrContract.ItemsSource = c_lst;
                }
                else
                {
                    Contract_Controller _Contract_Controller = new Contract_Controller();
                    c_lst = _Contract_Controller.Contract_Search_DenHanTB(ConvertData.ConvertDate2String(DateTime.Now), ConvertData.ConvertDate2String(DateTime.Now.AddDays(60)));
                }

                DataGridHelper.NVSFocus(dgrContract, 0, 0);
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }