public ActionResult ReassignProspects(FormCollection form) { var success = true; try { var prospectIds = form["PersonID"]; var userId = form["UserID"]; foreach (var prospectId in prospectIds.Split(',')) { if (string.IsNullOrEmpty(prospectId)) { continue; } var oldUser = prospectId.Split('_')[1]; var pId = prospectId.Split('_')[0]; if (oldUser == userId) { success = false; } else { CRM_UserMapping obj = new CRM_UserMapping(); int length = pId.Length; if (length > 8) { string personsid = pId.Remove(0, 25); obj.PersonID = Convert.ToInt64(personsid); } else { obj.PersonID = Convert.ToInt64(pId); } obj.UpdatedBy = CurrentUser.NameIdentifierInt64; obj.UpdatedOn = DateTime.Now; // AssignedBy= CurrentUser.NameIdentifierInt64.ToString(), obj.UserID = Convert.ToInt64(userId); _objSaleBAL.ReassignProspectBAL(obj); Library.TMS.Notifications nof = new Library.TMS.Notifications(); nof.NotificationText = "Your have assigned a prospect"; nof.Organization_ID = CurrentUser.CompanyID; nof.ToUser = Convert.ToInt64(obj.UserID); nof.FromUser = CurrentUser.NameIdentifierInt64; nof.ActionUrl = "Prospect/Detail?pid=" + obj.PersonID; nof.Event_ID = 2; nof.CreatedDate = DateTime.Now; BALNotification.create_NotificationsBAL(nof); var notificationHub = GlobalHost.ConnectionManager.GetHubContext <NotificationHub>(); notificationHub.Clients.All.notify("added"); } } } catch (Exception ex) { } return(View("SaleAdminstration")); }
public long AssigementHistory_CreateDAL(CRM_UserMapping _mapping) { return(ExecuteScalarInt32Sp("CRM_ProspectsAssignmentHistory_Create", ParamBuilder.Par("PersonID", _mapping.PersonID), ParamBuilder.Par("UserID", _mapping.UserID), ParamBuilder.Par("UpdatedBy", _mapping.UpdatedBy), ParamBuilder.Par("UpdatedOn", _mapping.UpdatedOn) )); }
public long ReassignProspectDAL(CRM_UserMapping _mapping) { return(ExecuteScalarInt32Sp("CRM_UserMapping_Create", ParamBuilder.Par("PersonID", _mapping.PersonID), ParamBuilder.Par("UserID", _mapping.UserID), ParamBuilder.Par("UpdatedBy", _mapping.UpdatedBy), ParamBuilder.Par("UpdatedOn", _mapping.UpdatedOn) )); }
public ActionResult ReassignProspects(FormCollection form) { var success = true; try { var prospectIds = form["PersonID"]; var userId = form["UserID"]; foreach (var prospectId in prospectIds.Split(',')) { if (string.IsNullOrEmpty(prospectId)) { continue; } var oldUser = prospectId.Split('_')[1]; var pId = prospectId.Split('_')[0]; if (oldUser == userId) { success = false; } else { CRM_UserMapping obj = new CRM_UserMapping(); int length = pId.Length; if (length > 8) { string personsid = pId.Remove(0, 25); obj.PersonID = Convert.ToInt64(personsid); } else { obj.PersonID = Convert.ToInt64(pId); } obj.UpdatedBy = CurrentUser.NameIdentifierInt64; obj.UpdatedOn = DateTime.Now; // AssignedBy= CurrentUser.NameIdentifierInt64.ToString(), obj.UserID = Convert.ToInt64(userId); _objSaleBAL.ReassignProspectBAL(obj); } } } catch (Exception ex) { throw; } return(View("SaleAdminstration")); }
public int ManageAssigned_DeleteBAL(CRM_UserMapping _mapping) { return(DAL.ManageAssigned_DeleteDAL(_mapping)); }
public long AssigementHistory_CreateBAL(CRM_UserMapping _Organization) { return(DAL.AssigementHistory_CreateDAL(_Organization)); }
public long ReassignProspectBAL(CRM_UserMapping _Organization) { return(DAL.ReassignProspectDAL(_Organization)); }