Beispiel #1
0
        public ActionResult savetask()
        {
            string groupid = Session["group"].ToString();

            Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"];

            string descritption = Request.Unvalidated.QueryString["description"];
            string MessageDate  = Request.QueryString["msgdate"];

            string AssignDate = Request.QueryString["now"];

            string comment = Request.QueryString["comment"];

            Guid idtoassign = Guid.Empty;

            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["memberid"]))
                {
                    idtoassign = Guid.Parse(Request.QueryString["memberid"]);
                }
            }
            catch (Exception ex)
            {
            }

            Api.Tasks.Tasks1 objTasks = new Api.Tasks.Tasks1();

            Api.Tasks.Tasks objApiTasks = new Api.Tasks.Tasks();
            objApiTasks.AddNewTaskWithGroup(descritption, MessageDate, objUser.Id.ToString(), objTasks, idtoassign.ToString(), comment, AssignDate, groupid);

            string Groupid = Session["group"].ToString();

            Api.BusinessSetting.BusinessSetting      objApiBusinessSetting = new Api.BusinessSetting.BusinessSetting();
            Domain.Socioboard.Domain.BusinessSetting objbsns = (Domain.Socioboard.Domain.BusinessSetting) new JavaScriptSerializer().Deserialize(objApiBusinessSetting.GetDetailsofBusinessOwner(Groupid), typeof(Domain.Socioboard.Domain.BusinessSetting));
            if (objbsns.TaskNotification == true)
            {
                Api.User.User ObjApiUser = new Api.User.User();
                Domain.Socioboard.Domain.User UsertoSendMail   = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ObjApiUser.getUsersById(idtoassign.ToString()), typeof(Domain.Socioboard.Domain.User)));
                Api.MailSender.MailSender     ApiobjMailSender = new Api.MailSender.MailSender();
                string mailsender = "";
                try
                {
                    var    mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_TaskNotificationMailPartial", UsertoSendMail);
                    string Subject  = "TASK ASSIGNMENT on Socioboard";

                    mailsender = ApiobjMailSender.SendTaskNotificationMail(UsertoSendMail.EmailId, mailBody, Subject);
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(Content(""));
        }
        public ActionResult savetask()
        {
            string groupid = Session["group"].ToString();

            Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"];

            string descritption = Request.Unvalidated.QueryString["description"];
            string MessageDate = Request.QueryString["msgdate"];

            string AssignDate = Request.QueryString["now"];

            string comment = Request.QueryString["comment"];

            Guid idtoassign = Guid.Empty;
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["memberid"]))
                {
                    idtoassign = Guid.Parse(Request.QueryString["memberid"]);
                }
            }
            catch (Exception ex)
            {

            }

            Api.Tasks.Tasks1 objTasks = new Api.Tasks.Tasks1();

            Api.Tasks.Tasks objApiTasks = new Api.Tasks.Tasks();
            objApiTasks.AddNewTaskWithGroup(descritption, MessageDate, objUser.Id.ToString(), objTasks, idtoassign.ToString(), comment, AssignDate, groupid);

            string Groupid = Session["group"].ToString();

            Api.BusinessSetting.BusinessSetting objApiBusinessSetting = new Api.BusinessSetting.BusinessSetting();
            Domain.Socioboard.Domain.BusinessSetting objbsns = (Domain.Socioboard.Domain.BusinessSetting)new JavaScriptSerializer().Deserialize(objApiBusinessSetting.GetDetailsofBusinessOwner(Groupid), typeof(Domain.Socioboard.Domain.BusinessSetting));
            if (objbsns.TaskNotification == true)
            {
                Api.User.User ObjApiUser = new Api.User.User();
                Domain.Socioboard.Domain.User UsertoSendMail = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ObjApiUser.getUsersById(idtoassign.ToString(), Session["access_token"].ToString()), typeof(Domain.Socioboard.Domain.User)));
                Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender();
                string mailsender = "";
                try
                {
                    var mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_TaskNotificationMailPartial", UsertoSendMail);
                    string Subject = "TASK ASSIGNMENT on Socioboard";

                    mailsender = ApiobjMailSender.SendTaskNotificationMail(UsertoSendMail.EmailId, mailBody, Subject);
                }
                catch (Exception)
                {

                    throw;
                }
            }

            return Content("");
        }