public object GetCashbackCategory() { using (var connection = this.GetConnection()) { string query = @"SELECT t.init_type as label, t.from_cat_id as value FROM ONE.TRANS_TYPE t WHERE FROM_CAT_ID LIKE 'CB%'"; var result = connection.Query <CustomDropDownModel>(query).ToList(); this.CloseConnection(connection); CustomDropDownModel customDropDownModel = new CustomDropDownModel { label = "All", value = "A" }; result.Add(customDropDownModel); return(result); } }
public object GetMonthYearList() { List <CustomDropDownModel> monthYearList = new List <CustomDropDownModel>(); try { for (int i = 0; i <= 12; i++) { CustomDropDownModel customDropDownModel = new CustomDropDownModel(); customDropDownModel.label = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.AddMonths(-i).Month) + " " + DateTime.Now.AddMonths(-i).Year; customDropDownModel.value = DateTime.Now.AddMonths(-i).Month.ToString("#00") + "" + DateTime.Now.AddMonths(-i).ToString("yy"); //monthYearList.Add(CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.AddMonths(-i).Month) + " " + DateTime.Now.AddMonths(-i).Year); monthYearList.Add(customDropDownModel); } return(monthYearList); } catch (Exception ex) { return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString())); } }