//[Authorize(Roles = "Client")] public ActionResult Create(JobOrder jobOrder, string StartDate, string[] ItemId, string[] ItemType, string[] ItemDescription, string[] Unit, string[] UnitPrice, string[] ItemDuration, string[] Actions, string fileName, bool Status = false) { string body = " has assigned you a job order: "; string jobOrderNo = string.Empty; string useraction = "Created"; var userDetails = generic.GetUserDetail(User.Identity.GetUserId()); ViewData["UserProfile"] = userDetails; if (userDetails.CorporateId != null && userDetails.CorporateId != userDetails.SubscriberId) { jobOrder.ClientId = userDetails.CorporateId; } else { jobOrder.ClientId = User.Identity.GetUserId(); } //var startDate = Convert.ToDateTime(StartDate); jobOrder.StartDate = null; if (!String.IsNullOrEmpty(StartDate)) { jobOrder.StartDate = DateTime.ParseExact(StartDate, "dd-MM-yyyy", CultureInfo.InvariantCulture); } PopulateOrderType(userDetails.SubscriberId); PopulateCurrency(jobOrder.Currency); PopulateSalaryRange(jobOrder.SalaryRange); PopulateExperienceRange(jobOrder.ExpRange); if (string.IsNullOrEmpty(jobOrder.ClientId)) { return(RedirectToAction("Login", "Account", new { area = "" })); } else { string UserId = User.Identity.GetUserId(); var userdetails = generic.GetUserDetail(UserId); jobOrder.UpdatedBy = User.Identity.GetUserId(); jobOrder.SubscriberId = userdetails.SubscriberId; jobOrder.JobOrderStatus = "Unassigned"; if (!string.IsNullOrEmpty(jobOrder.JobOrderNumber)) { useraction = "Updated"; body = " has modified job order: "; } jobOrderNo = cmsMgr.CreatJobOrder(jobOrder, ItemId, ItemType, ItemDescription, Unit, UnitPrice, ItemDuration, Actions); if (!string.IsNullOrEmpty(jobOrderNo)) { foreach (string file in Request.Files) { HttpPostedFileBase attachment = Request.Files[file] as HttpPostedFileBase; cmsMgr.uploadFile(jobOrderNo, attachment); } } string message1 = "A Job Order : " + jobOrderNo + " has been assigned to you by " + userDetails.Name; //eg "message hello "; // generic.sendSMSMessage(message1, generic.GetUserDetail(userdetails.SubscriberId).PhoneNumber); generic.sendSMS(message1, generic.GetUserDetail(userDetails.SubscriberId).PhoneNumber); admin.AddNotification(userdetails.SubscriberId, UserId, body + jobOrderNo, "JobOrder", jobOrderNo, Status, DateTime.Now); return(RedirectToAction("Create", "JobOrder", new { area = "CMS", result = useraction })); } }