Exemplo n.º 1
0
 public void LoadOfferList()
 {
     try
     {
         ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();
         AddCustomSearchCriterias(searchCriteria);
         List <OfferDataView> list = CostCalculationRef.GetAllOfferDataView(searchCriteria, GridViewSortExpression, GridViewSortDirection);
         LoadSearchResult(list);
     }
     catch (Exception ex)
     {
         BaseHelper.Log("Error in LoadPersonsList " + formResource.PagePath);
         BaseHelper.Log(ex.Message);
         BaseHelper.Log(ex.StackTrace);
     }
 }
Exemplo n.º 2
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            this.ownerPage = this.Page as BasicPage;

            this.AdminClientRef     = new Administration();
            this.CommonClientRef    = new Common();
            this.CostCalculationRef = new CostCalculationRef();

            this.CurrentEntityMasterID = Constants.INVALID_ID_STRING;

            AjaxControlToolkit.ToolkitScriptManager.RegisterClientScriptBlock(this,
                                                                              this.GetType(),
                                                                              "IsNumeric",
                                                                              BaseHelper.JS_SCRIPT_IS_NUMERIC,
                                                                              false);
        }
Exemplo n.º 3
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();
                AddCustomSearchCriterias(searchCriteria);
                List <OfferDataView> list = CostCalculationRef.GetAllOfferDataView(searchCriteria, GridViewSortExpression, GridViewSortDirection);


                LoadSearchResult(list);
                this.pnlFilterData.Visible = false;
            }
            catch (Exception ex)
            {
                BaseHelper.Log("Error in btnSearch_Click " + formResource.PagePath);
                BaseHelper.Log(ex.Message);
                BaseHelper.Log(ex.StackTrace);
            }
        }
Exemplo n.º 4
0
        public void AlphabetClick(string alpha)
        {
            try
            {
                if (alpha == Constants.ALL_CHARACTERS)
                {
                    List <AbstractSearch>         searchCriteria = new List <AbstractSearch>();
                    List <ProfileSettingDataView> list           = CostCalculationRef.GetProfilesList(searchCriteria, GridViewSortExpression, GridViewSortDirection);

                    ClearFilterForm();
                    LoadSearchResult(list);
                }
                else
                {
                    ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();
                    AddCustomSearchCriterias(searchCriteria);

                    searchCriteria.Add(new TextSearch
                    {
                        Comparator = TextComparators.StartsWith,
                        Property   = "Customer",
                        SearchTerm = alpha
                    });

                    List <ProfileSettingDataView> list = CostCalculationRef.GetProfilesList(searchCriteria, GridViewSortExpression, GridViewSortDirection);

                    LoadSearchResult(list);
                }
            }
            catch (Exception ex)
            {
                BaseHelper.Log("Error in AlphabetClick " + formResource.PagePath);
                BaseHelper.Log(ex.Message);
                BaseHelper.Log(ex.StackTrace);
            }
        }
Exemplo n.º 5
0
        public override void FormLoad()
        {
            try
            {
                ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();
                AddCustomSearchCriterias(searchCriteria);

                if (string.IsNullOrEmpty(this.GridViewSortExpression) || this.GridViewSortExpression == Constants.INVALID_ID_STRING)
                {
                    this.GridViewSortExpression = "OfferDate";
                }

                List <OfferDataView> listOfferDataView = CostCalculationRef.GetAllOfferDataView(searchCriteria, GridViewSortExpression, GridViewSortDirection);

                //ако има права може да вижда всичко, ако няма права вижда тези, които е редактирал или създал
                if (!CheckUserActionPermission(ETEMEnums.SecuritySettings.ShowOfferFullList, false))
                {
                    listOfferDataView = listOfferDataView.Where(z => z.idCreateUser.Value == Convert.ToInt32(this.UserProps.IdUser) ||
                                                                z.idModifyUser == Convert.ToInt32(this.UserProps.IdUser)).ToList();
                }

                this.gvOffer.DataSource = CostCalculationRef.GetAllOfferDataView(searchCriteria, GridViewSortExpression, GridViewSortDirection);

                if (NewPageIndex.HasValue)
                {
                    this.gvOffer.PageIndex = NewPageIndex.Value;
                }
                this.gvOffer.DataBind();
            }
            catch (Exception ex)
            {
                BaseHelper.Log("Error in FormLoad " + formResource.PagePath);
                BaseHelper.Log(ex.Message);
                BaseHelper.Log(ex.StackTrace);
            }
        }