// GET: WebSite public ActionResult Index() { var tbl = new tblAll(); var tbllist = new ListAll(); var queryListMenu = (from data in db.tblMenus where data.StatusMenu == 1 && data.ShowHomeMenu == 1 select data).ToList(); var dataNewProducts = from dataProducts in db.tblProducts join dataCategory in db.tblMenus on dataProducts.IdCategoryProducts equals dataCategory.IdMenu where dataProducts.StatusProducts == 1 orderby dataProducts.IdProducts descending select dataProducts; var queryListPicture = (from data in db.tblPictures // where data.Position==1 select data).ToList(); var querySlider = (from dataSlider in db.tblSliders where dataSlider.StatusSlider == 1 select dataSlider).ToList(); var queryBlogNo = (from dataBlog in db.tblBlogs where dataBlog.StatusBlog == 1 && dataBlog.IsVideo == 0 orderby dataBlog.IdBlog descending select dataBlog).Take(2).ToList(); var queryBlogIs = (from dataBlog in db.tblBlogs where dataBlog.StatusBlog == 1 && dataBlog.IsVideo == 1 orderby dataBlog.IdBlog descending select dataBlog).Take(1).ToList(); tbl.ListMenu = queryListMenu; tbl.ListPicture = queryListPicture; tbl.tblPro = dataNewProducts.ToList(); tbl.ListSlider = querySlider; tbl.ListBlogNo = queryBlogNo; tbl.ListBlogIs = queryBlogIs; return(View(tbl)); }
public void ListSalesRetail(int iDisplayLength, int iDisplayStart, int iSortCol_0, string sSortDir_0, string sSearch) { int displayLength = iDisplayLength; int displayStart = iDisplayStart; int sortCol = iSortCol_0; string sortDir = sSortDir_0; string search = sSearch; ListAll cls2 = new ListAll(); List <ListAll> myList = new List <ListAll>(); int filteredCount = 0; DataSet DS = new DataSet(); SqlInvoice CN = new SqlInvoice(); DS = CN.RunSql("SP_ListTranSalesRetail '" + displayLength + "','" + displayStart + "','" + sortCol + "','" + sortDir + "','" + search + "','" + HttpContext.Current.Request.Cookies["AccYear"].Value + "'", "List"); if (DS.Tables.Count > 0) { if (DS.Tables[0].Rows.Count > 0) { for (int i = 0; i < DS.Tables[0].Rows.Count; i++) { ListAll cls = new ListAll(); filteredCount = Convert.ToInt32(DS.Tables[0].Rows[i]["TotalCount"] != DBNull.Value ? DS.Tables[0].Rows[i]["TotalCount"].ToString() : "0"); cls.nSrNo = DS.Tables[0].Rows[i]["nSrNo"] != DBNull.Value ? DS.Tables[0].Rows[i]["nSrNo"].ToString() : ""; cls.dDate = DS.Tables[0].Rows[i]["dDate"] != DBNull.Value ? DS.Tables[0].Rows[i]["dDate"].ToString() : ""; cls.cName = DS.Tables[0].Rows[i]["cName"] != DBNull.Value ? DS.Tables[0].Rows[i]["cName"].ToString() : ""; cls.nGrossRs = DS.Tables[0].Rows[i]["nGrossRs"] != DBNull.Value ? DS.Tables[0].Rows[i]["nGrossRs"].ToString() : ""; cls.nNetRs = DS.Tables[0].Rows[i]["nNetRs"] != DBNull.Value ? DS.Tables[0].Rows[i]["nNetRs"].ToString() : ""; cls.cedit = DS.Tables[0].Rows[i]["cedit"] != DBNull.Value ? DS.Tables[0].Rows[i]["cedit"].ToString() : ""; cls.cdelete = DS.Tables[0].Rows[i]["cdelete"] != DBNull.Value ? DS.Tables[0].Rows[i]["cdelete"].ToString() : ""; cls.cprint = DS.Tables[0].Rows[i]["cprint"] != DBNull.Value ? DS.Tables[0].Rows[i]["cprint"].ToString() : ""; cls.cprintm = DS.Tables[0].Rows[i]["cprintm"] != DBNull.Value ? DS.Tables[0].Rows[i]["cprintm"].ToString() : ""; myList.Add(cls); } } } var result = new { iTotalRecords = GetTotalCount("SalesRetail", ""), //iTotalRecords = 5000, iTotalDisplayRecords = filteredCount, aaData = myList }; JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.Write(js.Serialize(result)); }
private async void ListView_Refreshing(object sender, EventArgs e) { await LoadAllTab(); await LoadTodayTab(); await LoadThisWeekTab(); ListAll.EndRefresh(); ListToday.EndRefresh(); ListThisWeek.EndRefresh(); }
private int GetTotalCount(string pageName, string cType) { ListAll m = new ListAll(); int totalCount = 0; DataSet DS = new DataSet(); SqlInstitute CN = new SqlInstitute(); DS = CN.RunSql("usp_GetTotalCount '" + pageName + "','" + HttpContext.Current.Request.Cookies["compid"].Value.ToString() + "'", "Count"); totalCount = Convert.ToInt32(DS.Tables[0].Rows[0][0].ToString()); return(totalCount); }
public void ListQuestion(int iDisplayLength, int iDisplayStart, int iSortCol_0, string sSortDir_0, string sSearch) { int displayLength = iDisplayLength; int displayStart = iDisplayStart; int sortCol = iSortCol_0; string sortDir = sSortDir_0; string search = sSearch; ListAll cls2 = new ListAll(); List <ListAll> myList = new List <ListAll>(); int filteredCount = 0; DataSet DS = new DataSet(); SqlInstitute CN = new SqlInstitute(); DS = CN.RunSql("usp_GetQuestionMaster '" + displayLength + "','" + displayStart + "','" + sortCol + "','" + sortDir + "','" + search + "','" + HttpContext.Current.Request.Cookies["compid"].Value.ToString() + "'", "List"); if (DS.Tables.Count > 0) { if (DS.Tables[0].Rows.Count > 0) { for (int i = 0; i < DS.Tables[0].Rows.Count; i++) { ListAll cls = new ListAll(); filteredCount = Convert.ToInt32(DS.Tables[0].Rows[i]["TotalCount"] != DBNull.Value ? DS.Tables[0].Rows[i]["TotalCount"].ToString() : "0"); cls.cMedium = DS.Tables[0].Rows[i]["cMedium"] != DBNull.Value ? DS.Tables[0].Rows[i]["cMedium"].ToString() : ""; cls.cStandardName = DS.Tables[0].Rows[i]["cStandardName"] != DBNull.Value ? DS.Tables[0].Rows[i]["cStandardName"].ToString() : ""; cls.cSubjectName = DS.Tables[0].Rows[i]["cSubjectName"] != DBNull.Value ? DS.Tables[0].Rows[i]["cSubjectName"].ToString() : ""; cls.cChapterName = DS.Tables[0].Rows[i]["cChapterName"] != DBNull.Value ? DS.Tables[0].Rows[i]["cChapterName"].ToString() : ""; cls.cAnswerKey = DS.Tables[0].Rows[i]["cAnswerKey"] != DBNull.Value ? DS.Tables[0].Rows[i]["cAnswerKey"].ToString() : ""; cls.NID = DS.Tables[0].Rows[i]["NID"] != DBNull.Value ? DS.Tables[0].Rows[i]["NID"].ToString() : ""; cls.cedit = DS.Tables[0].Rows[i]["cedit"] != DBNull.Value ? DS.Tables[0].Rows[i]["cedit"].ToString() : ""; cls.cdelete = DS.Tables[0].Rows[i]["cdelete"] != DBNull.Value ? DS.Tables[0].Rows[i]["cdelete"].ToString() : ""; myList.Add(cls); } } } var result = new { iTotalRecords = GetTotalCount("LevelMaster", ""), //iTotalRecords = 5000, iTotalDisplayRecords = filteredCount, aaData = myList }; JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.Write(js.Serialize(result)); }
public void ListPayment(int iDisplayLength, int iDisplayStart, int iSortCol_0, string sSortDir_0, string sSearch) { int displayLength = iDisplayLength; int displayStart = iDisplayStart; int sortCol = iSortCol_0; string sortDir = sSortDir_0; string search = sSearch; ListAll cls2 = new ListAll(); List <ListAll> myList = new List <ListAll>(); int filteredCount = 0; DataSet DS = new DataSet(); SqlInvoice CN = new SqlInvoice(); DS = CN.RunSql("SP_ListTranPayment '" + displayLength + "','" + displayStart + "','" + sortCol + "','" + sortDir + "','" + cls2.CompID + "','" + search + "'", "List"); if (DS.Tables.Count > 0) { if (DS.Tables[0].Rows.Count > 0) { for (int i = 0; i < DS.Tables[0].Rows.Count; i++) { ListAll cls = new ListAll(); filteredCount = Convert.ToInt32(DS.Tables[0].Rows[i]["TotalCount"] != DBNull.Value ? DS.Tables[0].Rows[i]["TotalCount"].ToString() : "0"); cls.nVouchNo = DS.Tables[0].Rows[i]["nVouchNo"] != DBNull.Value ? DS.Tables[0].Rows[i]["nVouchNo"].ToString() : ""; cls.dVochDate = DS.Tables[0].Rows[i]["dVochDate"] != DBNull.Value ? DS.Tables[0].Rows[i]["dVochDate"].ToString() : ""; cls.cCashBank = DS.Tables[0].Rows[i]["cCashBank"] != DBNull.Value ? DS.Tables[0].Rows[i]["cCashBank"].ToString() : ""; cls.cName = DS.Tables[0].Rows[i]["cname"] != DBNull.Value ? DS.Tables[0].Rows[i]["cname"].ToString() : ""; cls.cedit = DS.Tables[0].Rows[i]["cedit"] != DBNull.Value ? DS.Tables[0].Rows[i]["cedit"].ToString() : ""; cls.cdelete = DS.Tables[0].Rows[i]["cdelete"] != DBNull.Value ? DS.Tables[0].Rows[i]["cdelete"].ToString() : ""; myList.Add(cls); } } } var result = new { iTotalRecords = GetTotalCount("ListPay", ""), //iTotalRecords = 5000, iTotalDisplayRecords = filteredCount, aaData = myList }; JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.Write(js.Serialize(result)); }
private int GetTotalCount(string pageName, string cType) { myClass m = new myClass(); ListAll cls2 = new ListAll(); int totalCount = 0; DataSet DS = new DataSet(); SqlInvoice CN = new SqlInvoice(); DS = CN.RunSql("SP_GetTotalCount '" + pageName + "','" + cType + "','" + cls2.CompID + "'", "Count"); totalCount = Convert.ToInt32(DS.Tables[0].Rows[0][0].ToString()); return(totalCount); }
public Task <IEnumerable <Opportunity> > Handle(ListAll request, CancellationToken cancellationToken) { var opportunities = new Opportunities(context.Opportunities); return(opportunities.GetAll()); }
public async Task <List <TodoDto> > Handle(ListAll request, CancellationToken cancellationToken) { return(_db.Todos.Select(t => new TodoDto { Id = t.Id, Complete = t.Complete, Name = t.Name }).ToList()); }