public ActionResult Create(AgentCardViewModel model) { var ts = (TravelSession)Session["TravelSessionInfo"]; if (Request.IsAjaxRequest()) { ///Get details Card Information ///////////// var viewmodel = _issuecardrepo.GetCardDetailsInfo(model.HFCardId); ///// Save Card issue to database in table /////// //model.CreatedBy = ts.AppUserId; //// Login user info _issuecardrepo.CreateIssueCard(model); ////// Hit the Card database with card status Sold CardViewModel cardmodel = new CardViewModel(); cardmodel.CardId = model.HFCardId; cardmodel.CardStatusId = 2; ////// This is for sold status _issuecardrepo.UpdateCardToSoldStatus(cardmodel); cardmodel.isActive = true; //model to return to partial view return(PartialView("CreatePartial", viewmodel)); } else { return(RedirectToAction("Index")); } }
//GET: /IssueCard/Create public ActionResult Create() { AgentCardViewModel model = new AgentCardViewModel() { AgentList = _issuecardrepo.GetAllAgentList().ToList(), }; //ViewData["Agents"] = new SelectList(_issuecardrepo.ListAllAgent(), "AgentId", "AgentName",0); return(View(model)); }
// // GET: /IssueCard/ public ActionResult Index() { AgentCardViewModel model = new AgentCardViewModel() { AgentList = _issuecardrepo.GetAllAgentList().ToList(), }; //ViewData["Agents"] = new SelectList(_issuecardrepo.ListAllAgent(), "AgentId", "AgentName",0); //Get Agent List model.agentcardmodel = _issuecardrepo.GetAllIssueCardsListToAgent(); return(View(model)); }
public ActionResult Index(int agentid) { AgentCardViewModel model = new AgentCardViewModel() { AgentList = _issuecardrepo.GetAllAgentList().ToList(), }; model.agentcardmodel = _issuecardrepo.GetAllIssueCardByAgentName(agentid); if (Request.IsAjaxRequest()) { return(PartialView("ListPartial", model)); } return(View(model)); }
public void CreateIssueCard(AgentCardViewModel model) { Htl_AgentCards obj = new Htl_AgentCards { AgentId = model.AgentId, CardId = model.HFCardId, IssueDate = DateTime.Now, CreateDate = DateTime.Now, CreatedBy = model.CreatedBy, }; entities.AddToHtl_AgentCards(obj); entities.SaveChanges(); }
// // GET: /CustomerCard/Create public ActionResult Create(AgentCardViewModel model, string[] Selectedcardnumber, int AgentId) { List <SelectListItem> customerstatus = new List <SelectListItem>(); customerstatus.Add(new SelectListItem { Text = "Active", Value = "T" }); customerstatus.Add(new SelectListItem { Text = "InActive", Value = "F" }); TempData["AgentName"] = _issuecardrepo.GetAgentInfo(AgentId); // ViewData["CustomerStatus"] = new SelectList(customerstatus, "Value", "Text",0); //ViewData["Agents"] = new SelectList(_issuecardrepo.ListAllAgent(), "AgentId", "AgentName", 0); // ViewData["Country"] = new SelectList(_CountryRepo.HotelCountryList(), "CountryId", "CountryName"); //ViewData["CustomerType"] = new SelectList(_Custrepo.GetCustomerType(), "CustomerTypeId", "CustomerTypeName"); List <string> Selectedcardnumbers = new List <string>(); List <int> SelectedcardIDs = new List <int>(); foreach (string sid in Selectedcardnumber) { Selectedcardnumbers.Add(sid); int cardid = _Custrepo.GetCardIdByCardNumber(sid); SelectedcardIDs.Add(cardid); } var viewmodel = new CustomerIsssueCard { CustomerStatusList = customerstatus, CustomerCard = Selectedcardnumbers, CustomerCardId = SelectedcardIDs, CountryList = _CountryRepo.GetAllCountryList().ToList(), AgentList = _issuecardrepo.GetAllAgentList().ToList(), CustomerTypeList = _Custrepo.GetAllCustomerType() // AgentId =id }; // TempData["AgentName"] = _issuecardrepo.GetAgentInfo(Agent.AgentId); return(View(viewmodel)); }