public ActionResult Index() { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { Hashtable hst = new Hashtable(); objTools = new Utility(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); ViewBag.Foto = DL.Foto; ViewBag.UserName = DL.FullName; ViewBag.ClientID = DL.ClientID; ViewBag.LastLogin = Convert.ToDateTime(DL.LastLogin).ToString("dd MMM yyyy HH:mm:ss"); hst.Add("@ClientID", Convert.ToInt16(DL.ClientID)); ViewBag.TxtMenu = objTools.CreateMenu(hst, "[SP_UsersMenuLoad]"); DataModel.DMSearchField DY = new DataModel.DMSearchField(); DY.MonthList = objTools.GetMonths(); DY.YearList = objTools.GetYears(); return(View(DY)); } else { return(RedirectPermanent("/")); } }
public ActionResult CustomerSearch(DataModel.DMSearchField data) { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { objTools = new Utility(); DBA = new DBClass(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); List <DataModel.DMUserCustomerList> CList = new List <DataModel.DMUserCustomerList>(); DataTable Dt = new DataTable(); Hashtable hst = new Hashtable(); hst.Add("@Key", data.Searching.Key); hst.Add("@ClientID", DL.ClientID); //hst.Add("@Month", data.Month); //hst.Add("@Years", data.Year); Dt = DBA.GetDataTables("[SP_UsersCustomerLoad]", hst); if (Dt.Rows.Count > 0) { CList = Dt.DataTableToList <DataModel.DMUserCustomerList>(); return(PartialView("_CustomerList", CList)); } else { return(Json(new { isSuccess = false, msg = string.Format("No Record(s) found") }, JsonRequestBehavior.AllowGet)); } } else { return(RedirectPermanent("/")); } }