Ejemplo n.º 1
0
 private async void PromptCategorySelection()
 {
     try
     {
         selectCategory = new SelectCategory(questionaire, this);
         await PopupNavigation.Instance.PushAsync(selectCategory, true);
     }
     catch (Exception ex)
     {
         Debug.Write(ex.StackTrace);
     }
 }
Ejemplo n.º 2
0
        public ActionResult AddListing(SelectCategory model)
        {
            EasyServiceEntities easyServiceEntities = new EasyServiceEntities();

            ViewBag.categoryList = easyServiceEntities.Categories.Where(r => r.Id == model.CategoryId).ToList().Select(rr => new SelectListItem {
                Value = rr.Id.ToString(), Text = rr.Name
            }).ToList();

            ViewBag.subCategoryList = easyServiceEntities.SubCategories.Where(r => r.CategoryId == model.CategoryId).ToList().Select(rr => new SelectListItem {
                Value = rr.Id.ToString(), Text = rr.Name
            }).ToList();

            return(View());
        }
Ejemplo n.º 3
0
 private bool CategoryDeleteCheck(object obj)
 {
     if (SelectCategory == null)
     {
         return(false);
     }
     if (SelectCategory.Equals(CATEGORY_ALL))
     {
         return(false);
     }
     else if (SelectCategory.Equals(CATEGORY_STAR))
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 4
0
        private bool CategoryFilter(object item)
        {
            URLData category = item as URLData;

            if (SelectCategory.Equals(CATEGORY_ALL))
            {
                return(true);
            }
            if ((category.BookMark == true) && (SelectCategory.Equals(CATEGORY_STAR)))
            {
                return(true);
            }

            if (category.CategoryName.Equals(SelectCategory))
            {
                return(true);
            }

            category.SelectThis = false;
            return(false);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// добавление в базу данных нового клиента
 /// </summary>
 private void AddInDB()
 {
     try
     {
         using (con = new SqlConnection(AuthorizationSettings.connectionString))
         {
             con.Open();
             using (com = new SqlCommand("InsertStoragesName", con))
             {
                 com.CommandType = CommandType.StoredProcedure;
                 com.Parameters.AddWithValue("@CategoryID", SqlDbType.Int).Value      = SelectCategory.Split(' ')[0];
                 com.Parameters.AddWithValue("@UnitID", SqlDbType.Int).Value          = SelectUnitName.Split(' ')[0];
                 com.Parameters.AddWithValue("@Name", SqlDbType.VarChar).Value        = Name;
                 com.Parameters.AddWithValue("@Description", SqlDbType.VarChar).Value = Description;
                 com.Parameters.AddWithValue("@Price", SqlDbType.Float).Value         = Price;
                 com.ExecuteNonQuery();
             }
             con.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         con.Close();
         con.Dispose();
         isChange = true;
     }
 }
Ejemplo n.º 6
0
        public PartialViewResult CategorySection(string input_category)
        {
            SelectCategory model = new SelectCategory(input_category);

            return(PartialView(model));
        }