public ActionResult addPg(PgModel model, HttpPostedFileBase filename)
 {
     model.OBuserID = User.Identity.Name;
     if (dal.addPg(model))
     {
         filename.SaveAs(Server.MapPath(model.pgImagesAddress));
         return(RedirectToAction("PgAdded", "Owner"));
     }
     else
     {
         return(RedirectToAction("PgNotAdded", "Owner"));
     }
 }
Пример #2
0
        public void GetAllProviders()
        {
            IsLoading = true;
            ProviderCud.GetHospitals().ContinueWith(task => {
                if (task.Exception == null)
                {
                    AllProviders = new ObservableCollection <Provider>(task.Result);

                    if (!string.IsNullOrEmpty(SearchTerm))
                    {
                        int pgg;
                        SearchedProviders = new ObservableCollection <Provider>(AllProviders.Where(i => i.Name.Contains(SearchTerm, StringComparison.CurrentCultureIgnoreCase)));
                        if (SearchedProviderCount > 0)
                        {
                            if (SearchedProviders.Count > 10)
                            {
                                pgg = 5;
                            }
                            else
                            {
                                pgg = SearchedProviders.Count;
                            }
                            PaginationModel = new PgModel(pgg, SearchedProviders.Count);
                        }
                    }
                    else
                    {
                        int pg;
                        if (AllProviders.Count > 5)
                        {
                            pg = 5;
                        }
                        else
                        {
                            pg = AllProviders.Count;
                        }
                        PaginationModel = new PgModel(pg, AllProviders.Count);
                    }

                    Pagination.seed(PaginationModel);
                    ProcessDisplayItems();
                    IsLoading = false;
                    PaginationModel.PropertyChanged += PaginationModel_PropertyChanged;
                }
            });
        }