/// <summary>
 /// Event handler for activation of form.It reloads the datagrid view datasource.
 /// </summary>
 /// <param name="sender">Sender object</param>
 /// <param name="e">Event argument</param>
 private void addGPS_Activated(object sender, EventArgs e)
 {
     Models.Category[] allCategories = CategoryDelegate.GetAllCategories().ToArray();
     category_comboBox.DataSource    = allCategories;
     category_comboBox.ValueMember   = Constants.CATEGORY_ID;
     category_comboBox.DisplayMember = Constants.CATEGORY_NAME;
 }
Example #2
0
        /// <summary>
        /// Event handler for the activation of the form.
        /// </summary>
        /// <param name="sender">Sender Object</param>
        /// <param name="e">Event argument</param>
        private void locateCategory_Activated(object sender, EventArgs e)
        {
            List <Models.Category> allCategories = CategoryDelegate.GetAllCategories().ToList();

            Models.Category category = new Models.Category();
            category.categoryId   = 0;
            category.categoryName = Constants.ALL;
            allCategories.Insert(0, category);
            category_comboBox.BindingContext = new BindingContext();
            category_comboBox.DataSource     = allCategories;
            category_comboBox.ValueMember    = Constants.CATEGORY_ID;
            category_comboBox.DisplayMember  = Constants.CATEGORY_NAME;
            loadGoogleMapForAllCategory();
        }
Example #3
0
 /// <summary>
 /// Collects categroy details and saves as a datatable.
 /// </summary>
 /// <returns>Returns category data as datatable</returns>
 private DataTable GetRESTData()
 {
     categoryDetail = new DataTable();
     try
     {
         this.allCategoryDetails = CategoryDelegate.GetAllCategories();
         categoryDetail.Columns.Add("Category Name", typeof(string));
         categoryDetail.Columns.Add("Category Color", typeof(string));
         categoryDetail.Columns.Add("Category Description", typeof(string));
         foreach (Models.Category category in allCategoryDetails)
         {
             categoryDetail.Rows.Add(category.categoryName, category.colorIndication, category.categoryDesc);
         }
         return(categoryDetail);
     }
     catch (Exception ex)
     {
         log.Error(string.Format("Error in get Reposiory details from server {0}", ex.Message));
         return(categoryDetail);
     }
 }