public ActionResult Create() { Task model = new Task(); string getRequestID = Request["RequestID"]; string getRegarding = Request["Regarding"]; string getTicketNumber = Request["TicketNumber"]; Guid RequestID = new Guid(); string Regarding = ""; if (getRequestID != "" && getRequestID != null) { RequestID = new Guid(getRequestID); model.RequestID = RequestID; model.RequestTicketNumber = getTicketNumber; Regarding = getRegarding; model.Regarding = Regarding; } StringMapController dropDown = new StringMapController(); ViewBag.SL_StatusCode = dropDown.getDropDown("Task", "taskstatus", model.TaskStatus == null ? 0 : (int)model.TaskStatus); ViewBag.SL_Priority = dropDown.getDropDown("Task", "priority", model.Priority == null ? 0 : (int)model.Priority); model.Priority = 2; model.TaskStatus = 1; Guid currUser = new Guid(Session["CurrentUserID"].ToString()); var usname = new List <SystemUser>(); var su = db.systemUser.Single(p => p.SystemUserId == currUser); model.OwnerName = su.FullName; model.OwnerID = currUser; return(View(model)); }
public ActionResult Edit(Guid id) { QueueItem model = db.queueitem.Single(x => x.QueueItemId == id); StringMapController dropDown = new StringMapController(); return(View(model)); }
public ActionResult Edit(Guid id) { SystemUser model = db.systemUser.Find(id); StringMapController dropDown = new StringMapController(); //ViewBag.PreferredPhoneCode = new SelectList(db.pickList.Where(x => x.EntityName == "Systemuser" && x.AttributeName == "preferredphonecode").OrderBy(x => x.DisplayOrder), "AttributeValue", "Label" , user.PreferredPhoneCode); ViewBag.PreferredPhoneCodeList = dropDown.getDropDown(entityName, "preferredphonecode", model.PreferredPhoneCode == null ? 0 : (int)model.PreferredPhoneCode); return(View(model)); }
public ActionResult Create() { Guid logonUser = new Guid(System.Web.HttpContext.Current.Session["CurrentUserID"].ToString()); SystemUser user = new SystemUser(); user.CreatedBy = logonUser; StringMapController dropDown = new StringMapController(); ViewBag.PreferredPhoneCode = dropDown.getDropDown(entityName, "preferredphonecode", user.PreferredPhoneCode == null ? 0 : (int)user.PreferredPhoneCode); return(View()); }
public ActionResult Edit(Guid id) { NonCustomer model = db.noncustomer.Find(id); StringMapController dropDown = new StringMapController(); //buat hide save and new di form ViewBag.hideSaveAndOpen = true; //buat notes ViewBag.BusinessUnitID = model.BusinessUnitID; //buat dropdown di form ViewBag.SL_AddressType = dropDown.getDropDown(entityName, "addresstype", model.AddressType == null ? 0 : (int)model.AddressType); return(View(model)); }
public ActionResult Edit(Guid id) { CustomerAddress model = db.customeradress.Find(id); StringMapController dropDown = new StringMapController(); ViewBag.displayStatus = "disabled"; //buat hide save and new di form ViewBag.hideSaveAndOpen = true; //buat dropdown di form ViewBag.SL_AddressType = dropDown.getDropDown("Contact", "address1_addresstypecode", model.AddressTypeCode == null ? 0 : (int)model.AddressTypeCode); return(View(model)); }
public ActionResult Create(string customerID = null, string customerName = null) { StringMapController dropDown = new StringMapController(); NonCustomer model = new NonCustomer(); model.CreatedBy = new Guid(Session["CurrentUserID"].ToString()); model.CreatedByName = Session["Fullname"].ToString(); model.Owner = new Guid(Session["CurrentUserID"].ToString()); model.OwnerName = Session["Fullname"].ToString(); model.CreatedOn = DateTime.Now; //buat hide save and new di form ViewBag.hideSaveAndOpen = true; //buat dropdown di form ViewBag.SL_AddressType = dropDown.getDropDown(entityName, "addresstype", model.AddressType == null ? 0 : (int)model.AddressType); return(View(model)); }
public ActionResult Edit(Guid id) { Task model = db.task.Find(id); StringMapController dropDown = new StringMapController(); // Notes ViewBag.ObjectID = id; ViewBag.BusinessUnitID = model.BusinessUnitID; // Documents ViewBag.TabPosition = Request["position"]; ViewBag.SL_Priority = dropDown.getDropDown("Task", "priority", model.Priority == null ? 0 : (int)model.Priority); Annotation note = db.SpGetNotes(id).Select(x => new Annotation { AnnotationID = x.AnnotationID, CreatedByID = x.CreatedBy, CreatedBy = x.CreatedByName, CreatedOn = x.CreatedOn, DeletionStateCode = x.DeletionStateCode, ModifiedByID = x.ModifiedBy, ModifiedBy = x.ModifiedByName, ModifiedOn = x.ModifiedOn, NoteText = x.NoteText, ObjectID = x.ObjectID, ObjectTypeCode = x.ObjectTypeCode, BusinessUnitID = x.OwningBusinessUnit, Subject = x.Subject }).FirstOrDefault(); for (int i = 0; i < model.Notes.Count(); i++) { if (!model.Notes.ElementAt(i).IsDocument) { model.Notes.Remove(model.Notes.ElementAt(i)); } } model.Notes.Add(note); return(View(model)); }
public ActionResult Edit(Guid id) { Customer model = db.customer.Find(id); StringMapController dropDown = new StringMapController(); ViewBag.displayStatus = "disabled"; // For hide save and new In Form ViewBag.hideSaveAndOpen = true; // For Dropdown In form // ViewBag.SL_Category = dropDown.getDropDown("Contact", "customertypecode", model.CustomerTypeCode == null ? 1 : (int)model.CustomerTypeCode); ViewBag.SL_Gender = dropDown.getDropDown("Contact", "gendercode", model.GenderCode == null ? 0 : (int)model.GenderCode); ViewBag.SL_AddressType = dropDown.getDropDown("Contact", "address1_addresstypecode", model.AddressTypeCode == null ? 0 : (int)model.AddressTypeCode); // For Customer Segementation //GetSegmentation(model.CISNumber); //ViewBag.Membership = this.Membership; //ViewBag.Segmentation = this.Segmentation; return(View(model)); }
public ActionResult Edit(Guid id) { Request model = db.request.Find(id); Regex r = new Regex(@"\d{2}-\d{2}-\d{4}"); bool correctRegex = false; if (!string.IsNullOrEmpty(model.TransactionTime)) { correctRegex = r.IsMatch(model.TransactionTime); } if (correctRegex == true && !string.IsNullOrEmpty(model.TransactionTime) && model.TransactionTime.Length > 10) { ViewBag.TransactionTimeHour = model.TransactionTime[11].ToString() + model.TransactionTime[12].ToString(); ViewBag.TransactionTimeMin = model.TransactionTime[14].ToString() + model.TransactionTime[15].ToString(); if (model.TransactionTime.Length == 19) { ViewBag.TransactionTimeSec = model.TransactionTime[17].ToString() + model.TransactionTime[18].ToString(); } else { ViewBag.TransactionTimeSec = "00"; } model.TransactionTime = model.TransactionTime.Substring(0, 10); } StringMapController dropDown = new StringMapController(); //Set Customer Product field if (!string.IsNullOrEmpty(model.LoanNo)) { ViewBag.CustomerProduct = "loan"; } else if (!string.IsNullOrEmpty(model.CustomerNo)) { ViewBag.CustomerProduct = "creditcard"; } else if (!string.IsNullOrEmpty(model.AccountNo) || !string.IsNullOrEmpty(model.CardNo)) { ViewBag.CustomerProduct = "deposit"; } if (model.CustomerID == null || model.CustomerID == new Guid(ConfigurationManager.AppSettings["DummyCustomerID"].ToString())) { ViewBag.customerType = "noncustomer"; } else { ViewBag.customerType = "customer"; } if ((model.StatusCode == 1 || model.StatusCode == 2 || model.StatusCode == 3) && model.UserBranchID == new Guid(Session["BusinessUnitID"].ToString())) { ViewBag.displayStatus = "enabled"; } else { ViewBag.displayStatus = "disabled"; } //buat hide save and new di form ViewBag.hideSaveAndOpen = true; //buat notes ViewBag.ObjectID = id; ViewBag.BusinessUnitID = model.BusinessUnitID; //buat documents ViewBag.TabPosition = Request["position"]; //buat dropdown di form ViewBag.SL_ContactMethod = dropDown.getDropDown(entityName, "contactmethod", model.ContactMethod == null ? 0 : (int)model.ContactMethod); ViewBag.SL_CustomerAttitude = dropDown.getDropDown(entityName, "customerattitude", model.CustomerAttitude == null ? 0 : (int)model.CustomerAttitude); ViewBag.SL_Location = dropDown.getDropDown(entityName, "location", model.Location == null ? 0 : (int)model.Location); ViewBag.SL_PriorityCode = dropDown.getDropDown(entityName, "prioritycode", model.PriorityCode == null ? 0 : (int)model.PriorityCode); ViewBag.SL_StatusCode = dropDown.getDropDown(entityName, "statuscode", model.StatusCode == null ? 0 : (int)model.StatusCode); ViewBag.SL_Currency = dropDown.getDropDown(entityName, "currency", model.Currency == null ? 0 : (int)model.Currency); ViewBag.SL_CaseOriginCode = dropDown.getDropDown(entityName, "caseorigincode", model.CaseOriginCode == null ? 0 : (int)model.CaseOriginCode); //Get kota list if (model.SegmentationID != null) { ViewBag.Kota = new SelectList(db.serviceLevel.Where(x => x.ProductID == model.ProductID && x.CategoryID == model.CategoryID && x.SegmentationID == model.SegmentationID && x.DeletionStateCode == 0 && x.KotaID != null).Select(x => new { key = x.KotaID, value = x.KotaName }).Distinct(), "key", "value"); } else { ViewBag.Kota = new SelectList(db.serviceLevel.Where(x => x.ProductID == model.ProductID && x.CategoryID == model.CategoryID && x.DeletionStateCode == 0 && x.KotaID != null).Select(x => new { key = x.KotaID, value = x.KotaName }).Distinct(), "key", "value"); } Annotation note = db.SpGetNotes(id).Select(x => new Annotation { AnnotationID = x.AnnotationID, CreatedByID = x.CreatedBy, CreatedBy = x.CreatedByName, CreatedOn = x.CreatedOn, DeletionStateCode = x.DeletionStateCode, ModifiedByID = x.ModifiedBy, ModifiedBy = x.ModifiedByName, ModifiedOn = x.ModifiedOn, NoteText = x.NoteText, ObjectID = x.ObjectID, ObjectTypeCode = x.ObjectTypeCode, BusinessUnitID = x.OwningBusinessUnit, Subject = x.Subject }).FirstOrDefault(); model.Notes.Add(note); var referral = string.IsNullOrEmpty(model.RefTicketNumber) ? null : db.request.Where(x => x.TicketNumber == model.RefTicketNumber).FirstOrDefault(); ViewBag.RefferalProduct = referral == null ? string.Empty : referral.ProductName; ViewBag.RefferalCategory = referral == null ? string.Empty : referral.CategoryName; return(View(model)); }
public ActionResult Create(Guid?customerID = null, string customerName = null, string segmentationName = null) { StringMapController dropDown = new StringMapController(); string customerType = Request["customerType"]; string accountNo = Request["accountNo"]; string cardNo = Request["cardNo"]; string customerNo = Request["customerNo"]; string loanNo = Request["loanNo"]; Request model = new Request(); model.CreatedBy = new Guid(Session["CurrentUserID"].ToString()); model.CreatedByName = Session["Fullname"].ToString(); model.InteractionCount = "1"; model.CreatedOn = DateTime.Now; model.ForCustomer = true; if (customerType == "noncustomer") { model.CustomerID = new Guid(ConfigurationManager.AppSettings["DummyCustomerID"].ToString()); model.ForCustomer = false; model.NonCustomerID = customerID; model.NonCustomerName = customerName; ViewBag.customerType = "noncustomer"; } else if (customerType == "customer_deposit") { model.ForCustomer = true; model.CustomerID = customerID; model.CustomerName = customerName; model.AccountNo = accountNo; model.CardNo = cardNo; ViewBag.customerType = "customer_deposit"; } else if (customerType == "customer_creditcard") { model.ForCustomer = true; model.CustomerID = customerID; model.CustomerName = customerName; model.CustomerNo = customerNo; model.CardNo = cardNo; ViewBag.customerType = "customer_creditcard"; } else if (customerType == "customer_loan") { model.ForCustomer = true; model.CustomerID = customerID; model.CustomerName = customerName; model.AccountNo = accountNo; model.LoanNo = loanNo; ViewBag.customerType = "customer_loan"; } else if (customerType == "customer") { model.ForCustomer = true; model.CustomerID = customerID; model.CustomerName = customerName; ViewBag.customerType = "customer"; } model.CustomerAttitude = 3; model.PriorityCode = 2; //buat hide save and new di form ViewBag.hideSaveAndOpen = true; //buat dropdown di form ViewBag.SL_ContactMethod = dropDown.getDropDown(entityName, "contactmethod", model.ContactMethod == null ? 0 : (int)model.ContactMethod); ViewBag.SL_CustomerAttitude = dropDown.getDropDown(entityName, "customerattitude", model.CustomerAttitude == null ? 0 : (int)model.CustomerAttitude); ViewBag.SL_Location = dropDown.getDropDown(entityName, "location", model.Location == null ? 0 : (int)model.Location); ViewBag.SL_PriorityCode = dropDown.getDropDown(entityName, "prioritycode", model.PriorityCode == null ? 0 : (int)model.PriorityCode); ViewBag.SL_StatusCode = dropDown.getDropDown(entityName, "statuscode", model.StatusCode == null ? 0 : (int)model.StatusCode); ViewBag.SL_Currency = dropDown.getDropDown(entityName, "currency", model.Currency == null ? 0 : (int)model.Currency); ViewBag.SL_CaseOriginCode = dropDown.getDropDown(entityName, "caseorigincode", model.CaseOriginCode == null ? 0 : (int)model.CaseOriginCode); //find segmentationID if (segmentationName != null) { var getSegmentation = db.Segmentation.Where(x => x.Name == segmentationName); if (getSegmentation != null) { model.SegmentationID = getSegmentation.FirstOrDefault().ID; } } return(View(model)); }