public ActionResult LoadGroup()
 {
     User objUser = (User)Session["User"];
     Socioboard.Api.Groups.Groups objApiGroups = new Socioboard.Api.Groups.Groups();
     List<Domain.Socioboard.Domain.Groups> lstgroup = (List<Domain.Socioboard.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(objApiGroups.GetGroupDetailsByUserId(objUser.Id.ToString()), typeof(List<Domain.Socioboard.Domain.Groups>)));
     return PartialView("_GroupPartial", lstgroup);
 }
        //
        // GET: /BusinessSetting/

        public ActionResult Index()
        {
            if (Session["User"] != null)
            {
                
            

            Guid GroupId = Guid.Parse(Session["group"].ToString());
            Socioboard.Api.Groups.Groups ApiobjGroup = new Socioboard.Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups ObjGroup = (Domain.Socioboard.Domain.Groups)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjGroup.GetGroupDetailsByGroupId(GroupId.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            if (ObjGroup.GroupName == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
            {
                //return Content("Default Group Can't Access");
                ViewBag.DefaultFroup = "DefaultGroup";
                return View();
            }
            else{
                return View();
            }
            }
            else
            {
                return RedirectToAction("Index", "Index");
            }
        }
Esempio n. 3
0
 public ActionResult AddGroup(string groupname)
 {
     User objUser = (User)Session["User"];
     Socioboard.Api.Groups.Groups objApiGroups = new Socioboard.Api.Groups.Groups();
     Domain.Socioboard.Domain.Groups objgroup = (Domain.Socioboard.Domain.Groups)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(objApiGroups.AddGroup(groupname, objUser.Id.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
     return Content(objgroup.Id.ToString());
 }
        public ActionResult AddGroup(string groupname)
        {
            User objUser = (User)Session["User"];

            Socioboard.Api.Groups.Groups    objApiGroups = new Socioboard.Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objgroup     = (Domain.Socioboard.Domain.Groups)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(objApiGroups.AddGroup(groupname, objUser.Id.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            return(Content(objgroup.Id.ToString()));
        }
        public ActionResult LoadGroup()
        {
            User objUser = (User)Session["User"];

            Socioboard.Api.Groups.Groups           objApiGroups = new Socioboard.Api.Groups.Groups();
            List <Domain.Socioboard.Domain.Groups> lstgroup     = (List <Domain.Socioboard.Domain.Groups>)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(objApiGroups.GetGroupDetailsByUserId(objUser.Id.ToString()), typeof(List <Domain.Socioboard.Domain.Groups>)));

            return(PartialView("_GroupPartial", lstgroup));
        }
        //
        // GET: /BusinessSetting/

        public ActionResult Index()
        {
            Guid GroupId = Guid.Parse(Session["group"].ToString());

            Socioboard.Api.Groups.Groups    ApiobjGroup = new Socioboard.Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups ObjGroup    = (Domain.Socioboard.Domain.Groups)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjGroup.GetGroupDetailsByGroupId(GroupId.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            if (ObjGroup.GroupName == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
            {
                //return Content("Default Group Can't Access");
                ViewBag.DefaultFroup = "DefaultGroup";
                return(View());
            }
            else
            {
                return(View());
            }
        }
        //
        // GET: /BusinessSetting/

        public ActionResult Index()
        {

            Guid GroupId = Guid.Parse(Session["group"].ToString());
            Socioboard.Api.Groups.Groups ApiobjGroup = new Socioboard.Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups ObjGroup = (Domain.Socioboard.Domain.Groups)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjGroup.GetGroupDetailsByGroupId(GroupId.ToString()), typeof(Domain.Socioboard.Domain.Groups)));
<<<<<<< HEAD
            if (ObjGroup.GroupName == ConfigurationManager.AppSettings["DefaultGroupName"].ToString())
=======
            if (ObjGroup.GroupName == "Socioboard")
>>>>>>> e052534b7a2a3744cad9dddbc3c6acccf394ca7b
            {
                //return Content("Default Group Can't Access");
                ViewBag.DefaultFroup = "DefaultGroup";
                return View();
            }
            else{
                return View();
            }
        }
Esempio n. 8
0
        public ActionResult ComposeMessageSend(string message, string allprofiles, string curdaatetimetime)
        {
            User objUser = (User)Session["User"];
            string groupid = Session["group"].ToString();
            Socioboard.Api.Groups.Groups ApiobjGroups = new Socioboard.Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            string[] profileandidarr = Regex.Split(allprofiles, "<:>");
            var fi = Request.Files["file"];
            string file = string.Empty;


            //Get Dropbox Selected Images
            //string[] DropboxImg = null;
            //try
            //{
            //    DropboxImg = Request.Form["DropboxImg"].Split(',');
            //}
            //catch { };



            if (Request.Files.Count > 0)
            {
                if (fi != null)
                {
                    var path = Server.MapPath("~/Themes/" + System.Configuration.ConfigurationManager.AppSettings["domain"] + "/Contents/img/upload");

                    // var path = System.Configuration.ConfigurationManager.AppSettings["MailSenderDomain"]+"Contents/img/upload";
                    file = path + "\\" + fi.FileName;
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }
                    fi.SaveAs(file);
                    path = path + "\\" + fi.FileName;
                    logger.Error(path);
                }
            }
            foreach (var item in profileandidarr)
            {
                string[] profileandid = item.Split('~');
                string profiletype = profileandid[1];
                string profileid = profileandid[0];
                int DBXCount = 0;

            DbxNext:

                //if (!string.IsNullOrEmpty(DropboxImg[0]))
                //{
                //if (DropboxImg.Count() != 0 && DropboxImg.Count() >= DBXCount)
                //{
                //    file = DropboxImg[DBXCount];
                //    DBXCount++;
                //}
                //}
                try
                {

                    if (profiletype == "facebook")
                    {
                        Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();
                        ApiobjFacebook.FacebookComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);

                    }
                    if (profiletype == "facebook_page")
                    {
                        Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();
                        ApiobjFacebook.FacebookComposeMessageForPage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }

                    if (profiletype == "twitter")
                    {
                        Api.Twitter.Twitter ApiobjTwitter = new Api.Twitter.Twitter();
                        ApiobjTwitter.TwitterComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);

                    } if (profiletype == "linkedin")
                    {
                        Api.Linkedin.Linkedin ApiobjLinkedin = new Api.Linkedin.Linkedin();
                        ApiobjLinkedin.LinkedinComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }
                    if (profiletype == "tumblr")
                    {
                        Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                        ApiobjTumblr.TumblrComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }


                    Api.ScheduledMessage.ScheduledMessage objAddComposeSentMessage = new Api.ScheduledMessage.ScheduledMessage();
                    objAddComposeSentMessage.AddComposeMessage(objGroups.UserId.ToString(), profileid, profiletype, message);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

                //if (!string.IsNullOrEmpty(DropboxImg[0]))
                //{
                //    if (DBXCount < DropboxImg.Count())
                //    {
                //        goto DbxNext;
                //    }
                //}
            }
            return Content("");
        }
        public async Task<ActionResult> ComposeMessageSend(string message, string allprofiles, string curdaatetimetime)
        {
            User objUser = (User)Session["User"];
            //curdaatetimetime = DateExtension.ToClientTime(DateTime.UtcNow);
            string groupid = Session["group"].ToString();
            Socioboard.Api.Groups.Groups ApiobjGroups = new Socioboard.Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            string[] profileandidarr = Regex.Split(allprofiles, "<:>");
            var fi = Request.Files["file"];
            string file = string.Empty;


            //Get Dropbox Selected Images
            //string[] DropboxImg = null;
            //try
            //{
            //    DropboxImg = Request.Form["DropboxImg"].Split(',');
            //}
            //catch { };



            if (Request.Files.Count > 0)
            {
                if (fi != null)
                {
                    var path = Server.MapPath("~/Themes/" + System.Configuration.ConfigurationManager.AppSettings["domain"] + "/Contents/img/upload");

                    // var path = System.Configuration.ConfigurationManager.AppSettings["MailSenderDomain"]+"Contents/img/upload";
                    file = path + "\\" + fi.FileName;
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }
                    fi.SaveAs(file);
                    path = path + "\\" + fi.FileName;
                    logger.Error(path);
                }
            }
            foreach (var item in profileandidarr)
            {
                string[] profileandid = item.Split('~');
                string profiletype = profileandid[1];
                string profileid = profileandid[0];
                int DBXCount = 0;

            DbxNext:

                //if (!string.IsNullOrEmpty(DropboxImg[0]))
                //{
                //if (DropboxImg.Count() != 0 && DropboxImg.Count() >= DBXCount)
                //{
                //    file = DropboxImg[DBXCount];
                //    DBXCount++;
                //}
                //}
                try
                {

                    if (profiletype == "facebook")
                    {
                        Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();
                        ApiobjFacebook.FacebookComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file,"");

                    }
                    if (profiletype == "facebook_page")
                    {
                        Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();
                        ApiobjFacebook.FacebookComposeMessageForPage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file,"");
                    }

                    if (profiletype == "twitter")
                    {
                        Api.Twitter.Twitter ApiobjTwitter = new Api.Twitter.Twitter();
                        ApiobjTwitter.TwitterComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);

                    } if (profiletype == "linkedin")
                    {
                 string accesstoken = "";
                 string returndata = "";
                 List<KeyValuePair<string, string>> Parameters = new List<KeyValuePair<string, string>>();
                 Parameters.Add(new KeyValuePair<string, string>("GroupId", Session["group"].ToString()));
                 Parameters.Add(new KeyValuePair<string, string>("comment", message));
                 Parameters.Add(new KeyValuePair<string, string>("UserId", objUser.Id.ToString()));
                 Parameters.Add(new KeyValuePair<string, string>("ImageUrl", file));
                 Parameters.Add(new KeyValuePair<string, string>("ProfileId", profileid));
                 if (Session["access_token"] != null)
                 {
                     accesstoken = Session["access_token"].ToString();
                 }
                 HttpResponseMessage response = await WebApiReq.PostReq("api/ApiLinkedIn/LinkedInProfileUpdate", Parameters, "Bearer", accesstoken);
                 if (response.IsSuccessStatusCode)
                 {
                     returndata = await response.Content.ReadAsAsync<string>();
                 }
                    }
                    if (profiletype == "tumblr")
                    {
                        Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                        ApiobjTumblr.TumblrComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }


                    Api.ScheduledMessage.ScheduledMessage objAddComposeSentMessage = new Api.ScheduledMessage.ScheduledMessage();
                    objAddComposeSentMessage.AddComposeMessage(objGroups.UserId.ToString(), profileid, profiletype, message, file);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

                //if (!string.IsNullOrEmpty(DropboxImg[0]))
                //{
                //    if (DBXCount < DropboxImg.Count())
                //    {
                //        goto DbxNext;
                //    }
                //}
            }
            return Content("");
        }
Esempio n. 10
0
        public ActionResult ComposeMessageSend(string message, string allprofiles, string curdaatetimetime)
        {
            User   objUser = (User)Session["User"];
            string groupid = Session["group"].ToString();

            Socioboard.Api.Groups.Groups    ApiobjGroups = new Socioboard.Api.Groups.Groups();
            Domain.Socioboard.Domain.Groups objGroups    = (Domain.Socioboard.Domain.Groups)(new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups)));
            string[] profileandidarr = Regex.Split(allprofiles, "<:>");
            var      fi   = Request.Files["file"];
            string   file = string.Empty;


            //Get Dropbox Selected Images
            //string[] DropboxImg = null;
            //try
            //{
            //    DropboxImg = Request.Form["DropboxImg"].Split(',');
            //}
            //catch { };



            if (Request.Files.Count > 0)
            {
                if (fi != null)
                {
                    var path = Server.MapPath("~/Themes/" + System.Configuration.ConfigurationManager.AppSettings["domain"] + "/Contents/img/upload");

                    // var path = System.Configuration.ConfigurationManager.AppSettings["MailSenderDomain"]+"Contents/img/upload";
                    file = path + "\\" + fi.FileName;
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }
                    fi.SaveAs(file);
                    path = path + "\\" + fi.FileName;
                    logger.Error(path);
                }
            }
            foreach (var item in profileandidarr)
            {
                string[] profileandid = item.Split('~');
                string   profiletype  = profileandid[1];
                string   profileid    = profileandid[0];
                int      DBXCount     = 0;

DbxNext:

                //if (!string.IsNullOrEmpty(DropboxImg[0]))
                //{
                //if (DropboxImg.Count() != 0 && DropboxImg.Count() >= DBXCount)
                //{
                //    file = DropboxImg[DBXCount];
                //    DBXCount++;
                //}
                //}
                try
                {
                    if (profiletype == "facebook")
                    {
                        Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();
                        ApiobjFacebook.FacebookComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }
                    if (profiletype == "facebook_page")
                    {
                        Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook();
                        ApiobjFacebook.FacebookComposeMessageForPage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }

                    if (profiletype == "twitter")
                    {
                        Api.Twitter.Twitter ApiobjTwitter = new Api.Twitter.Twitter();
                        ApiobjTwitter.TwitterComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }
                    if (profiletype == "linkedin")
                    {
                        Api.Linkedin.Linkedin ApiobjLinkedin = new Api.Linkedin.Linkedin();
                        ApiobjLinkedin.LinkedinComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }
                    if (profiletype == "tumblr")
                    {
                        Api.Tumblr.Tumblr ApiobjTumblr = new Api.Tumblr.Tumblr();
                        ApiobjTumblr.TumblrComposeMessage(message, profileid, objGroups.UserId.ToString(), curdaatetimetime, file);
                    }


                    Api.ScheduledMessage.ScheduledMessage objAddComposeSentMessage = new Api.ScheduledMessage.ScheduledMessage();
                    objAddComposeSentMessage.AddComposeMessage(objGroups.UserId.ToString(), profileid, profiletype, message, file);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

                //if (!string.IsNullOrEmpty(DropboxImg[0]))
                //{
                //    if (DBXCount < DropboxImg.Count())
                //    {
                //        goto DbxNext;
                //    }
                //}
            }
            return(Content(""));
        }