public NotifyViewModel(Page page)
 {
     this.page     = page;
     service       = new BoshokuService();
     categoryList  = LocalCategory.getListMain();
     sqliteManager = new SqliteManager();
 }
 void Handle_Refreshing(object sender, System.EventArgs e)
 {
     _lw.IsRefreshing      = true;
     _lw.BindingContext    = LocalCategory.getListMain();
     _backButton.IsVisible = false;
     _lw.IsRefreshing      = false;
     nextCount             = 0;
 }
Beispiel #3
0
        public SqliteManager()
        {
            sqliteConnection = DependencyService.Get <ISqliteConnection>().GetConnection();
            categoryList     = LocalCategory.getListMain();
            sqliteConnection.CreateTable <Announcements>();

            //userin son okuduğu veriyi tutmak için
            sqliteConnection.CreateTable <SimpleNews>();
        }
 public DrawerPage()
 {
     InitializeComponent();
     Title = "required";
     Icon  = "";
     NavigationPage.SetBackButtonTitle(this, string.Empty);
     NavigationPage.SetHasBackButton(this, false);
     categoryList       = LocalCategory.getListMain();
     _lw.BindingContext = categoryList;
 }
 private FirebaseObject <Announcements> correct_Item(FirebaseObject <Announcements> item)
 {
     item.Object.category = getCategory(LocalCategory.getListMain(), item.Object.category);
     //item.Object.dateCreator = item.Object.createdDate.ToShortDateString();
     item.Object.newsCreateDate = getCreatedDate(item.Object.createdDate);
     //item.Object.widthx = (Resolver.Resolve<IDevice>()).Display.Width;
     //item.Object.desc = item.Object.content.HtmlToPlainText();
     item.Object.imgVisible = true;
     item.Object.image      = string.IsNullOrEmpty(item.Object.image) ? "promotion" : item.Object.image;
     return(item);
 }
Beispiel #6
0
 public static void ApprovalStatus(LocalCategory obj)
 {
     using (var dbcontext = new KaamShaamEntities())
     {
         var dbJob = dbcontext.Categories.FirstOrDefault(l => l.Id == obj.Id);
         if (dbJob != null)
         {
             dbJob.IsApproved = obj.IsApproved;
             if (!obj.IsApproved)
             {
                 dbJob.Feedback = obj.Feedback;
             }
             dbcontext.SaveChanges();
         }
     }
 }
        private void searchOther(LocalCategory item)
        {
            //eğer asıl sayfada değilse oraya yönlendirmek için

            switch (item.key)
            {
            case "-AC123":
                MessagingCenter.Send <DrawerPage, bool>(this, "drawerActivity", true);
                MessagingCenter.Send <DrawerPage, CurrentTabPageChange>(this, "changeCurrentPage", CurrentTabPageChange.pageActivity);
                break;

            case "-AC124":
                MessagingCenter.Send <DrawerPage, bool>(this, "drawerActivity", false);
                MessagingCenter.Send <DrawerPage, CurrentTabPageChange>(this, "changeCurrentPage", CurrentTabPageChange.pageActivity);
                break;

            default:
                if (!string.IsNullOrEmpty(item.key))
                {
                    MessagingCenter.Send <DrawerPage, Search>(this, "drawerAnn", new Search()
                    {
                        categoryKey = item.key, monthNumbE = -1
                    });
                    MessagingCenter.Send <DrawerPage, CurrentTabPageChange>(this, "changeCurrentPage", CurrentTabPageChange.pageAnnoun);
                }
                else
                {
                    var search = new Search();
                    search.monthNumbS  = Enum.GetNames(typeof(Months)).ToList().IndexOf(item.val);
                    search.categoryKey = temp_CategoryKey;
                    search.category    = temp_Category;
                    MessagingCenter.Send <DrawerPage, Search>(this, "drawerAnn", search);
                    MessagingCenter.Send <DrawerPage, CurrentTabPageChange>(this, "changeCurrentPage", CurrentTabPageChange.pageAnnoun);
                }
                break;
            }
            temp_Category    = "";
            temp_CategoryKey = "";
        }
 private Announcements correct_Item(Announcements item)
 {
     item.category       = getCategory(LocalCategory.getListMain(), item.category);
     item.newsCreateDate = getCreatedDate(item.createdDate);
     return(item);
 }
Beispiel #9
0
        public static LocalUser MapUser(this AspNetUser source)
        {
            LocalCategory cat = null;

            if (source.CategoryId != 0)
            {
                cat = CategoryService.GetCategoryById(source.CategoryId);
            }
            var roleName = source.AspNetRoles.Any() ? source.AspNetRoles.FirstOrDefault().Name : "";

            var profileVists = new List <LocalProfileVisit>();

            if (source.ProfileVisitors != null && source.ProfileVisitors.Any())
            {
                profileVists = source.ProfileVisitors.Select(prf => prf.Mapper()).ToList();
            }

            var profileRatings = new List <LocalUserRating>();

            if (source.YourRatings != null && source.YourRatings.Any())
            {
                profileRatings = source.YourRatings.Where(df => df.IsApproved).Select(prf => prf.Mapper()).ToList();
            }

            var score = UserRatingService.GetRatingsInFloat(source.Id);

            var tempoLoc = " 31.476535115002306_74.32158172130585";

            if (source.LocationCord != null)
            {
                tempoLoc = source.LocationCord.Latitude + "_" + source.LocationCord.Longitude;
            }

            var userObj = new LocalUser
            {
                CNIC     = source.CNIC ?? "(Not Provided)",
                Email    = source.Email ?? "(Not Provided)",
                FullName = source.FullName ?? "(Not Provided)",
                Id       = source.Id,
                Mobile   = source.Mobile ?? "(Not Provided)",
                Type     = source.Type ?? "(Not Provided)",
                UserName = source.UserName ?? "(Not Provided)",
                Country  = source.Country ?? "(Not Provided)",
                City     = source.City ?? "(Not Provided)",

                LocTempo = tempoLoc,

                Intro         = source.Intro ?? "(Not Provided)",
                Language      = source.Language ?? "(Not Provided)",
                Status        = (bool)source.Status,
                ContractorId  = source.ContractorId ?? "(Not Provided)",
                CategoryId    = source.CategoryId ?? 0,
                RoleName      = roleName ?? "(Not Provided)",
                IsApproved    = (bool)source.IsApproved,
                Feedback      = source.Feedback ?? " - ",
                LocationName  = source.LocationName ?? "(Not Provided)",
                lat           = (source.LocationCord.Latitude).ToString(),
                lng           = (source.LocationCord.Longitude).ToString(),
                CatName       = cat?.Name ?? "(Not Provided)",
                Location      = source.LocationCord,
                Password      = source.PasswordHash,
                EditedAt      = Convert.ToDateTime(source.EditedAt).ToLongDateString(),
                EditedAtObj   = Convert.ToDateTime(source.EditedAt),
                ProfileVisits = profileVists,
                Score         = score,
                UserRatings   = profileRatings,
                CanRate       = false
            };

            return(userObj);
        }
Beispiel #10
0
 public ActionResult ChnageJobApprovalCats(LocalCategory model)
 {
     CategoryAdminService.ApprovalStatus(model);
     return(Json(true, JsonRequestBehavior.AllowGet));
 }