public ActionResult SendFeedBackMail(string id) { _productInfoBAL = new ProductInfoBAL(); _cAS_ProductInfoVM = new CAS_ProductInfoVM(); _cAS_ProductInfoVM = _productInfoBAL.GetProductDataById(id); CommonClass common = new CommonClass(); common.SendMail(_cAS_ProductInfoVM.Customer_Name, _cAS_ProductInfoVM.Project_Name); _productInfoBAL = new ProductInfoBAL(); _productInfoBAL.UpdateProductInfoAfterMailSent(id); SearchVM obj = new SearchVM(); return RedirectToAction("Index", obj); }
public List<CAS_ProductInfoVM> GetAllProductData(SearchVM search, out int totalcount) { _cAS_ProductInfoVMList = new List<CAS_ProductInfoVM>(); _db = new CFT_DBEntities(); IEnumerable<CAS_ProductInfo> query = _db.CAS_ProductInfo.Include("CAS_FeedbackData").ToList(); totalcount = query.Count(); search.PageCurrentIndex = search.PageCurrentIndex <= 0 ? 0 : search.PageCurrentIndex; query = query.Skip(search.PageCurrentIndex * search.PageSize).Take(search.PageSize); search.PageCount = Convert.ToInt32(Math.Ceiling((double)((double)(totalcount / (double)search.PageSize)))); var lists = query.Select((a => new CAS_ProductInfoVM() { Business_Unit = a.Business_Unit, CAS_ProductId = a.CAS_ProductId, CAS_FeedbackDataVM = ConvertToFeedBackDataVM(a), Customer_Email = a.Customer_Email, Customer_Name = a.Customer_Name, Customer_Phone = a.Customer_Phone, Function = a.Function, Id = a.Id, IEC_Contact = a.IEC_Contact, Project_Name = a.Project_Name, Project_Team = a.Project_Team, CreatedAt = a.CreatedAt, CreatedBy = a.CreatedBy, UpdateAt = a.UpdateAt, UpdateBy = a.UpdateBy, IsActive = a.IsActive, ISDeleted = a.ISDeleted })); List<CAS_ProductInfoVM> listitems = lists.ToList(); return listitems; }
// GET: ProductInfo public ActionResult Index(SearchVM obj) { _productInfoBAL = new ProductInfoBAL(); _cAS_ProductInfoVMList = new List<CAS_ProductInfoVM>(); _searchVM = new SearchVM(); _productInfoSearch = new ProductInfoSearch(); try { obj = obj ?? new SearchVM(); SearchVM objjsearch = Session["searchvm"] != null ? Session["searchvm"] as SearchVM : obj; objjsearch.PageCurrentIndex = obj.PageCurrentIndex <= 0 ? 0 : obj.PageCurrentIndex; int totalcount; _cAS_ProductInfoVMList = _productInfoBAL.GetAllProductData(objjsearch, out totalcount); _productInfoSearch.TotalCount = totalcount; _productInfoSearch.SearchExpression = objjsearch; _productInfoSearch.CAS_ProductInfoVM = _cAS_ProductInfoVMList; } catch (Exception ex) { } return View(_productInfoSearch); }