protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } var masterDal = new Falcon.DataAccess.Master.MasterDAL(); if (string.IsNullOrEmpty(CountryId)) { CountryId = masterDal.GetCountry(string.Empty, 3).FirstOrDefault().CountryID.ToString(); } List <Falcon.Entity.Other.EState> states = masterDal.GetState(string.Empty, 3); _ddlState.Items.Clear(); _ddlState.Items.Add(new ListItem("Select State", "0")); _ddlState.Items.AddRange(states.Where <EState>(state => state.Country.CountryID.ToString() == CountryId).Select <EState, ListItem>(state => new ListItem(HttpUtility.HtmlEncode(state.Name), HttpUtility.HtmlEncode(state.StateID.ToString()))).ToArray <ListItem>()); }
/// <summary> /// Add Task /// </summary> private void AddTask() { if ((!string.IsNullOrEmpty(Request["subject"])) || !string.IsNullOrEmpty(Request["duedate"]) || !string.IsNullOrEmpty(Request["duetime"])) { if (!string.IsNullOrEmpty(Request["prospectid"])) { Response.Clear(); Response.ContentType = "text/xml"; // Add Task string strSubject = string.Empty; string strDueDate = string.Empty; string strDueTime = string.Empty; string strProspectid = string.Empty; string strAssignedStatus = string.Empty; long temp; if (!string.IsNullOrEmpty(Request["subject"])) { strSubject = Request["subject"].ToString(); } if (!string.IsNullOrEmpty(Request["duedate"])) { strDueDate = Request["duedate"].ToString(); } if (!string.IsNullOrEmpty(Request["duetime"])) { strDueTime = Request["duetime"].ToString(); } if (!string.IsNullOrEmpty(Request["prospectid"])) { strProspectid = Request["prospectid"].ToString(); } if (!string.IsNullOrEmpty(Request["assignedstatus"])) { strAssignedStatus = Request["assignedstatus"].ToString(); } var masterDal = new Falcon.DataAccess.Master.MasterDAL(); var task = new Falcon.Entity.Other.ETask(); //TaskService objTaskService = new TaskService(); //EUserShellModuleRole objEUserShellModuleRole = new EUserShellModuleRole(); //ETask task = new ETask(); //task.TaskStatusType = new ETaskStatusType(); //task.TaskPriorityType = new ETaskPriorityType(); //task.TaskType = new ETaskType(); //task.UserShellModule = new HealthYes.Web.UI.TaskService.EUserShellModuleRole(); task.TaskStatusType = new Falcon.Entity.Other.ETaskStatusType(); task.TaskPriorityType = new Falcon.Entity.Other.ETaskPriorityType(); task.TaskType = new Falcon.Entity.Other.ETaskType(); task.UserShellModule = new Falcon.Entity.User.EUserShellModuleRole(); var currentSession = IoC.Resolve <ISessionContext>().UserSession; task.Active = true; task.Subject = strSubject; if (strDueDate != "") { task.DueDate = strDueDate; } if (strDueTime != "") { task.DueTime = strDueTime; } task.Notes = ""; task.StartDate = ""; task.StartTime = ""; task.UserShellModule.ShellID = currentSession.CurrentOrganizationRole.OrganizationId.ToString(); task.UserShellModule.RoleShellID = (int)currentSession.CurrentOrganizationRole.OrganizationRoleUserId; task.UserShellModule.RoleID = currentSession.CurrentOrganizationRole.RoleId.ToString(); task.UserShellModule.UserID = currentSession.UserId.ToString(); //task.UserShellModule = objEUserShellModuleRole; task.ProspectID = 0; if (!string.IsNullOrEmpty(strProspectid)) { task.ProspectID = Convert.ToInt64(strProspectid); } task.ContactID = 0; task.CreatedBY = Convert.ToInt32(currentSession.UserId); task.ModifiedBY = task.CreatedBY; //objTaskService.AddTask(task, objEUserShellModuleRole, out temp, out temp1); temp = masterDal.SaveTask(task, Convert.ToInt32(EOperationMode.Insert), currentSession.UserId.ToString(), currentSession.CurrentOrganizationRole.OrganizationId.ToString(), currentSession.CurrentOrganizationRole.RoleId.ToString()); if (temp == 0) { temp = 9999990; } if (Request["ishost"] == null || Request["ishost"] == "") { // Assign Prospect if (task.ProspectID > 0) { if (currentSession.CurrentOrganizationRole.CheckRole((long)Roles.SalesRep) && strAssignedStatus.Equals("2")) { FranchisorDAL objFranchisorDal = new FranchisorDAL(); //mode - 1 for Assign Prospect objFranchisorDal.AssignProspect(1, Convert.ToInt64(task.ProspectID), Convert.ToInt64(currentSession.UserId)); XmlDeclartion = XmlDeclartion + "<result>1</result>"; Response.Write(XmlDeclartion); } else { XmlDeclartion = XmlDeclartion + "<result>0</result>"; Response.Write(XmlDeclartion); } } } // task added to prospect else if (Request["ishost"] != null && Request["ishost"] != "") { XmlDeclartion = XmlDeclartion + "<result>1</result>"; Response.Write(XmlDeclartion); } } } else { XmlDeclartion = XmlDeclartion + "<result>2</result>"; Response.Write(XmlDeclartion); } }