public ActionResult LoadGroupUserProfiles() { Dictionary <SocialProfile, object> dict_Socialprofiled = new Dictionary <SocialProfile, object>(); dict_Socialprofiled = SBUtils.GetAllUserProfiles(); return(PartialView("_UserProfilesPartial", dict_Socialprofiled)); }
public ActionResult ProfileSnapshot(string op) { int CountProfileSnapshot = 0; try { if (op == null) { Session["CountProfileSnapshot"] = 0; } } catch (Exception ex) { } if (Session["CountProfileSnapshot"] != null) { CountProfileSnapshot = (int)Session["CountProfileSnapshot"]; } else { Session["CountProfileSnapshot"] = 0; } List <TeamMemberProfile> lstTeamMemberProfile = SBUtils.GetUserTeamMemberProfiles(); Dictionary <Domain.Myfashion.Domain.TeamMemberProfile, Dictionary <object, List <object> > > diclist = SBUtils.GetUserProfilesSnapsAccordingToGroup(lstTeamMemberProfile, CountProfileSnapshot); if (diclist.Count > 0 && diclist != null) { Session["CountProfileSnapshot"] = (int)Session["CountProfileSnapshot"] + diclist.Count; } return(PartialView("_HomeProfileSnapshotPartial", diclist)); }
public ActionResult ProfileSnapshot() { List <TeamMemberProfile> lstTeamMemberProfile = SBUtils.GetUserTeamMemberProfiles(); Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, Dictionary <object, List <object> > > diclist = SBUtils.GetUserProfilesSnapsAccordingToGroup(lstTeamMemberProfile); return(PartialView("_HomeProfileSnapshotPartial", diclist)); }
public static string BuildNewEAN13Barcode(string country_code, string manufacturer_code) { int digits = 12 - (country_code.Length + manufacturer_code.Length); string product_code = ""; string aux = ""; for (int i = 0; i < digits; i++) { aux += "9"; } int max_code = Convert.ToInt32(aux); for (int i = 0; i < max_code; i++) { string aux_code = SBUtils.FillLeftCeros(i + 1, digits); Ean13 bc = new Ean13(country_code, manufacturer_code, aux_code); bc.CalculateChecksumDigit(); string check_barcode = country_code + manufacturer_code + aux_code + bc.ChecksumDigit; string query = string.Format("SELECT product_id FROM products WHERE product_barcode = '{0}'", check_barcode); if (SBFactory.getDbh().QueryRow(query) == null) { product_code = check_barcode; break; } } return(product_code); }
protected void Page_Load(object sender, EventArgs e) { try { #region for You can use only 30 days as Unpaid User SocioBoard.Domain.User user = (User)Session["LoggedUser"]; if (user.PaymentStatus.ToLower() == "unpaid") { if (!SBUtils.IsUserWorkingDaysValid(user.ExpiryDate)) { // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('You can use only 30 days as Unpaid User !');", true); Session["GreaterThan30Days"] = "GreaterThan30Days"; Response.Redirect("../Settings/Billing.aspx"); } } #endregion } catch (Exception ex) { Console.WriteLine("Error : " + ex.StackTrace); } }
public ActionResult SBApp(string profileType, string url, string content, string imageUrl, string name, string userImage, string screenName, string tweet, string tweetId, string type) { Domain.Socioboard.Helper.PluginData _PluginData = new Domain.Socioboard.Helper.PluginData(); _PluginData.profileType = profileType; _PluginData.content = content; _PluginData.imageUrl = imageUrl; _PluginData.name = name; _PluginData.screenName = screenName; _PluginData.tweet = tweet; _PluginData.tweetId = tweetId; _PluginData.url = url; _PluginData.userImage = userImage; _PluginData.type = type; if (Session["User"] != null) { if (!string.IsNullOrEmpty(url) && profileType != "pinterest") { Domain.Socioboard.Helper.ThumbnailDetails plugindata = PluginHelper.CreateThumbnail(url); _PluginData._ThumbnailDetails = plugindata; } ViewBag.plugin = _PluginData; //Dictionary<string, object> dict_TeamMember = new Dictionary<string, object>(); List <Domain.Socioboard.Helper.PluginProfile> lstsb = new List <Domain.Socioboard.Helper.PluginProfile>(); lstsb = SBUtils.GetProfilesForPlugin(); return(View("RMain", lstsb)); } return(View("Rlogin")); }
public ActionResult AuthenticateWordpress() { string wordpressredirecturl = string.Empty; try { Api.Groups.Groups objApiGroups = new Api.Groups.Groups(); JObject group = JObject.Parse(objApiGroups.GetGroupDetailsByGroupId(Session["group"].ToString().ToString())); wordpressredirecturl = SBUtils.GetWordpressRedirectLink(); Response.Redirect(wordpressredirecturl); //int profilecount = (Int16)(Session["ProfileCount"]); //int totalaccount = (Int16)Session["TotalAccount"]; //if (Convert.ToString(group["GroupName"]) == "Socioboard") //{ // if (profilecount < totalaccount) // { // wordpressredirecturl = SBUtils.GetWordpressRedirectLink(); // Response.Redirect(wordpressredirecturl); // } // else // { // return RedirectToAction("Index", "Home"); // } //} } catch (Exception ex) { return(RedirectToAction("Index", "Home")); } return(Content(wordpressredirecturl)); }
public ActionResult CheckEmailIdExist(string newEmailId) { User objUser = (User)Session["User"]; Api.User.User ApiobjUser = new Api.User.User(); Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender(); string ret = string.Empty; string mailsender = ""; ret = ApiobjUser.CheckEmailId(newEmailId); if (ret == "NotExist") { string strRandomUnique = SBUtils.GenerateRandomUniqueString(); string res_UpdateChangePasswordKey = ApiobjUser.UpdateResetEmailKey(objUser.Id.ToString(), strRandomUnique); if (res_UpdateChangePasswordKey == "1") { TempData["NewEmailId"] = newEmailId; TempData.Keep("NewEmailId"); ViewBag.NewEmailId = newEmailId; objUser.ChangeEmailKey = strRandomUnique; } Session["User"] = objUser; var mailBody = Helper.SBUtils.RenderViewToString1(this.ControllerContext, this.TempData, "_EmailChangeMailBodyPartial", objUser); string Subject = "Socioboard"; mailsender = ApiobjMailSender.SendChangePasswordMail(newEmailId, mailBody, Subject); return(Content("Mail Send Successfully")); } else { return(Content("EmailId already Exist")); } }
public ActionResult connectedprofilestothisgroup(string selectedgroupid) { Session["selectedgroupid"] = selectedgroupid; Dictionary <GroupProfile, object> dict_ProfileConnected = new Dictionary <GroupProfile, object>(); dict_ProfileConnected = SBUtils.GetProfilesConnectedwithgroup(); return(PartialView("_ProfilesConnectedToGroupPartial", dict_ProfileConnected)); }
public void logString(string str, bool console = true) { SBUtils.logString(this.LogFile, str); if (console) { Console.WriteLine(str); } }
public ActionResult loadtask() { Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"]; Domain.Socioboard.Domain.Team team = SBUtils.GetTeamFromGroupId(); Api.Tasks.Tasks objApiTasks = new Api.Tasks.Tasks(); List <Domain.Socioboard.Domain.Tasks> taskdata = (List <Domain.Socioboard.Domain.Tasks>) new JavaScriptSerializer().Deserialize(objApiTasks.getAllTasksOfUserList(objUser.Id.ToString(), team.GroupId.ToString()), typeof(List <Domain.Socioboard.Domain.Tasks>)); return(PartialView("_TaskPartial", taskdata)); }
public ActionResult loadprofiles() { User objUser = (User)Session["User"]; Dictionary <TeamMemberProfile, object> dict_TeamMember = new Dictionary <TeamMemberProfile, object>(); if (Session["group"] != null) { dict_TeamMember = SBUtils.GetUserProfilesccordingToGroup(); } return(PartialView("_HomeUserProfilePartial", dict_TeamMember)); }
public ActionResult OpenSummayModel(string FriendId) { User _User = (User)Session["User"]; Api.User.User Apiuser = new Api.User.User(); User NewUser = (User) new JavaScriptSerializer().Deserialize(Apiuser.getUsersById(FriendId), typeof(User)); List <Affiliates> lstAffiliate = SBUtils.GetAffiliatesData(_User.Id, Guid.Parse(FriendId)); ViewBag.FriendsEmail = NewUser.EmailId; return(PartialView("_SummaryPartial", lstAffiliate)); }
public ActionResult ComposeScheduledMessage() { User objUser = (User)Session["User"]; Dictionary <TeamMemberProfile, object> dict_TeamMember = new Dictionary <TeamMemberProfile, object>(); if (Session["group"] != null) { dict_TeamMember = SBUtils.GetUserProfilesccordingToGroup(); } return(PartialView("_ComposeMessageSchedulerPartial", dict_TeamMember)); }
public PartialViewResult LoadCompleteTask() { Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"]; Domain.Socioboard.Domain.Team team = SBUtils.GetTeamFromGroupId(); Api.Tasks.Tasks objApiTasks = new Api.Tasks.Tasks(); List <Domain.Socioboard.Domain.Tasks> taskdata = (List <Domain.Socioboard.Domain.Tasks>) new JavaScriptSerializer().Deserialize(objApiTasks.GetAllCompleteTaskofUser(objUser.Id.ToString(), team.GroupId.ToString()), typeof(List <Domain.Socioboard.Domain.Tasks>)); ViewBag.Task = "CompleteTask"; return(PartialView("_TaskPartial", taskdata)); }
public ActionResult Index() { if (Request.QueryString["teamid"] != null) { string teamid = Request.QueryString["teamid"].ToString(); Api.Team.Team _apiteam = new Api.Team.Team(); _apiteam.UpdateTeambyteamid(teamid); } if (Session["Paid_User"] != null && Session["Paid_User"].ToString() == "Unpaid") { return(RedirectToAction("Billing", "PersonalSetting")); } else { ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; #region Count Used Accounts try { User objUser = (User)Session["User"]; Api.SocialProfile.SocialProfile apiobjSocialProfile = new Api.SocialProfile.SocialProfile(); apiobjSocialProfile.GetAllSocialProfiles(); Session["ProfileCount"] = Convert.ToInt16(apiobjSocialProfile.GetAllSocialProfilesOfUserCount(objUser.Id.ToString()).ToString()); Session["TotalAccount"] = Convert.ToInt16(SBUtils.GetUserPackageProfileCount(objUser.AccountType)); ViewBag.AccountType = objUser.AccountType; //if (Session["GroupName"] == null) //{ // Groups objGroupDetails = objGroupRepository.getGroupDetail(user.Id); // team = objTeamRepo.getAllDetails(objGroupDetails.Id, user.EmailId); // Session["GroupName"] = team; //} //else //{ // team = (SocioBoard.Domain.Team)Session["GroupName"]; //} } catch (Exception ex) { Console.WriteLine(ex.Message); } #endregion if (Session["SocialManagerInfo"] != null) { } int ProfileCount = int.Parse(Session["ProfileCount"].ToString()); return(View(User)); // return PartialView("_HomePartial"); } }
public ActionResult loadprofiles() { User objUser = (User)Session["User"]; //List<TeamMemberProfile> lstTeamMemberProfile = new List<TeamMemberProfile>(); Dictionary <TeamMemberProfile, object> dict_TeamMember = new Dictionary <TeamMemberProfile, object>(); // Api.Team.Team objApiTeam = new Api.Team.Team(); if (Session["group"] != null) { dict_TeamMember = SBUtils.GetUserProfilesccordingToGroup(); } return(PartialView("_PofilePartial", dict_TeamMember)); }
protected void page_load(object sender, EventArgs e) { User user = (User)Session["LoggedUser"]; #region for You can use only 30 days as Unpaid User if (user.PaymentStatus.ToLower() == "unpaid") { if (!SBUtils.IsUserWorkingDaysValid(user.ExpiryDate)) { // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('You can use only 30 days as Unpaid User !');", true); Session["GreaterThan30Days"] = "GreaterThan30Days"; Response.Redirect("/Settings/Billing.aspx"); } } Session["GreaterThan30Days"] = null; #endregion if (user == null) { Response.Redirect("/Default.aspx"); } if (!IsPostBack) { List <Groups> lstgroup = grouprepo.getAllGroupsCompleteDetails(user.Id); if (lstgroup.Count != 0) { inviteteamfromUserAndGroups.HRef = "InviteMember.aspx"; } memberName.Text = user.UserName; ddlGroup.DataSource = lstgroup; ddlGroup.DataTextField = "GroupName"; ddlGroup.DataValueField = "Id"; ddlGroup.DataBind(); ddlGroup.Items.Insert(0, "Select"); this.GetAllGroups(lstgroup); if (!AllGroups.InnerHtml.ToString().Contains("<span id=\"totalgroups\" style=\"display:none;\">0</span>")) { this.ProfilesAvailabeforuser(user.Id); } } }
protected void Page_Load(object sender, EventArgs e) { try { SocioBoard.Domain.User user = (User)Session["LoggedUser"]; #region for You can use only 30 days as Unpaid User if (user.PaymentStatus.ToLower() == "unpaid") { if (!SBUtils.IsUserWorkingDaysValid(user.ExpiryDate)) { // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('You can use only 30 days as Unpaid User !');", true); Session["GreaterThan30Days"] = "GreaterThan30Days"; Response.Redirect("/Settings/Billing.aspx"); } } Session["GreaterThan30Days"] = null; #endregion btnchangestatus.Attributes.Add("onclick", "return checkStatusInfo();"); User loginInfoEmail = (User)Session["LoggedUser"]; if (Session["LoggedUser"] != null) { custid = loginInfoEmail.Id; blackcount.InnerHtml = Convert.ToString((int)Session["CountMessages"]); custname = loginInfoEmail.UserName; } else { Response.Redirect("/Default.aspx", false); } if (!IsPostBack) { this.rdbtnmytask_CheckedChanged(sender, e); } } catch (Exception ex) { logger.Error(ex.Message); } }
public ActionResult OpenSummayModel(string FriendId) { string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow); //string datetime = Request.Form["localtime"].ToString(); ViewBag.datetime = datetime; User _User = (User)Session["User"]; Api.User.User Apiuser = new Api.User.User(); User NewUser = (User) new JavaScriptSerializer().Deserialize(Apiuser.getUsersById(FriendId, Session["access_token"].ToString()), typeof(User)); List <Affiliates> lstAffiliate = SBUtils.GetAffiliatesData(_User.Id, Guid.Parse(FriendId)); ViewBag.FriendsEmail = NewUser.EmailId; return(PartialView("_SummaryPartial", lstAffiliate)); }
protected void Page_Load(object sender, EventArgs e) { if (Request.Form != null) { try { string code = Request.Form["code"].ToString(); Response.Write(SBUtils.GetCouponStatus(code)); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
// Edited by Antima public ActionResult ConfirmPassword(string CnfrmPassword) { User objUser = (User)Session["User"]; string Password = SBUtils.MD5Hash(CnfrmPassword); string ret = string.Empty; if (objUser.Password == Password) { ret = "Password Confirm"; } else { ret = "Password Not Match"; } return(Content(ret)); }
public ActionResult SendFogotPassMail(string emailId) { Api.User.User ApiobjUser = new Api.User.User(); Domain.Socioboard.Domain.User objuser = new Domain.Socioboard.Domain.User(); try { objuser = (Domain.Socioboard.Domain.User)(new JavaScriptSerializer().Deserialize(ApiobjUser.getUserInfoByEmail(emailId), typeof(Domain.Socioboard.Domain.User))); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } Api.MailSender.MailSender ApiobjMailSender = new Api.MailSender.MailSender(); string mailsender = ""; try { if (objuser == null) { mailsender = "IdNOtExist"; } //Generate a random unique string string strRandomUnique = SBUtils.GenerateRandomUniqueString(); //Update random unique string in User string res_UpdateChangePasswordKey = ApiobjUser.UpdateForgetPasswordKey(objuser.Id.ToString(), strRandomUnique); if (res_UpdateChangePasswordKey == "1") { ViewBag.ForgetPasswordKey = strRandomUnique; objuser.ChangePasswordKey = strRandomUnique; } objuser.ChangePasswordKey = strRandomUnique; var mailBody = Helper.SBUtils.RenderViewToString(this.ControllerContext, "_ForgotPasswordMailBodyPartial", objuser); string Subject = "You requested a password reset for your " + ConfigurationManager.AppSettings["DefaultGroupName"].ToString() + " Account";//"Forget password Socioboard Account"; mailsender = ApiobjMailSender.SendChangePasswordMail(emailId, mailBody, Subject); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } return(Content(mailsender)); }
public ActionResult Index(string teamid) { User objUser = (User)Session["User"]; if (teamid != null) { if (objUser != null) { Api.Team.Team ApiobjTeam = new Api.Team.Team(); Team objuserinfo = (Team)(new JavaScriptSerializer().Deserialize(ApiobjTeam.GetTeamById(teamid), typeof(Team))); if (objuserinfo.InviteStatus == 0) { ApiobjTeam.UpdateTeam(objUser.Id.ToString(), teamid, objUser.UserName); } Response.Redirect("../Home/Index", true); } else { //Response.Redirect("Index/Registration?teamid="+teamid +""); return(RedirectToAction("Registration", "Index", new { teamid = teamid })); } } Session["fblogin"] = null; ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; #region Count Used Accounts try { Api.SocialProfile.SocialProfile apiobjSocialProfile = new Api.SocialProfile.SocialProfile(); apiobjSocialProfile.GetAllSocialProfiles(); Session["ProfileCount"] = Convert.ToInt16(apiobjSocialProfile.GetAllSocialProfilesOfUserCount(objUser.Id.ToString()).ToString()); Session["TotalAccount"] = Convert.ToInt16(SBUtils.GetUserPackageProfileCount(objUser.AccountType)); } catch (Exception ex) { Console.WriteLine(ex.Message); } #endregion if (Session["SocialManagerInfo"] != null) { } return(View(User)); // return PartialView("_HomePartial"); }
public void Resume() { Time.timeScale = 1f; AudioListener.volume = 1; Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; m_GameIsPaused = false; m_pauseMenuUI.SetActive(false); #if UNITY_EDITOR || UNITY_STANDALONE_WIN SBUtils.MouseClick(MouseClickEvents.LEFTDOWN, new Vector2(Screen.width / 2, Screen.height / 2)); #endif //pauseMenuScaler.uiScaleMode = CanvasScaler.ScaleMode.ConstantPixelSize; //CalculateNormalizedHeightRes(); //Time.timeScale = 1f; //AudioListener.volume = 1; //Cursor.visible = false; //Cursor.lockState = CursorLockMode.Locked; //var tween = DOTween.To(() => pauseMenuScaler.scaleFactor, x => pauseMenuScaler.scaleFactor = x, 0, menuAnimDuration) // .SetRecyclable(true) // .SetEase(Ease.OutExpo) // .SetUpdate(isIndependentUpdate: true); //tween.OnUpdate(() => //{ // if (tween.ElapsedPercentage() >= 0.9) // { // m_GameIsPaused = false; // canSwitch = true; // m_pauseMenuUI.SetActive(false); // #if UNITY_EDITOR || UNITY_STANDALONE_WIN // LeftClickMouse(); // #endif // } //}).OnComplete(() => //{ // ForceUpdateMenu(); //}); }
// Edited by Antima public ActionResult ConfirmPassword(string CnfrmPassword) { User objUser = (User)Session["User"]; string Password = SBUtils.MD5Hash(CnfrmPassword); string ret = string.Empty; Api.User.User ApiobjUser = new Api.User.User(); string user = ApiobjUser.getUserInfoByEmail(objUser.EmailId); objUser = (Domain.Socioboard.Domain.User) new JavaScriptSerializer().Deserialize(user, typeof(Domain.Socioboard.Domain.User)); if (objUser.Password.Equals(Password)) { ret = "Password Confirm"; } else { ret = "Password Not Match"; } return(Content(ret)); }
//Modified by Sumit Gupta [31-01-15] public ActionResult ChangePassword(string id, string oldpass, string newpass, string confirmpass) { User objUser = (User)Session["User"]; Api.User.User ApiobjUser = new Api.User.User(); //UserRepository userrepo = new UserRepository(); //Domain.Socioboard.Domain.User user = ApiobjUser.getUserInfoByEmail(; string user = ApiobjUser.getUserInfoByEmail(id); Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User) new JavaScriptSerializer().Deserialize(user, typeof(Domain.Socioboard.Domain.User)); string ret = string.Empty; if (newpass.Equals(confirmpass)) { if (!_User.Password.Equals(SBUtils.MD5Hash(confirmpass))) { ret = ApiobjUser.ChangePasswordWithoutOldPassword(id, "", newpass); } else { ret = "New Password and Old Password is same"; } } else { ret = "New Password and Confirm Password mismatch"; } //string ret = ApiobjUser.UpdateUser(id, fname, lname, dt); //if (ret == "1") //{ // objUser.UserName = fname + " " + lname; // objUser.TimeZone = dt; // Session["User"] = objUser; //} return(Content(ret)); }
public ActionResult DisplayCount() { string AllProfileId = string.Empty; string FbProfileId = string.Empty; string TwtProfileId = string.Empty; int fbmsgcount = 0; int twtmsgcount = 0; int allsentmsgcount = 0; User objUser = (User)Session["User"]; Dictionary <Domain.Myfashion.Domain.TeamMemberProfile, object> allprofileofuser = SBUtils.GetUserProfilesccordingToGroup(); foreach (var item in allprofileofuser) { try { if (item.Key.ProfileType == "facebook" || item.Key.ProfileType == "facebook_page") { FbProfileId += item.Key.ProfileId + ','; } else if (item.Key.ProfileType == "twitter") { TwtProfileId += item.Key.ProfileId + ','; } AllProfileId += item.Key.ProfileId + ','; } catch (Exception Err) { Console.Write(Err.StackTrace); } } try { FbProfileId = FbProfileId.Substring(0, FbProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } try { TwtProfileId = TwtProfileId.Substring(0, TwtProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } try { AllProfileId = AllProfileId.Substring(0, AllProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } try { Api.FacebookFeed.FacebookFeed objFacebookFeed = new Api.FacebookFeed.FacebookFeed(); objFacebookFeed.Timeout = 300000; fbmsgcount = objFacebookFeed.GetFeedCountByProfileIdAndUserId(objUser.Id.ToString(), FbProfileId); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { Api.TwitterMessage.TwitterMessage objTwitterMessage = new Api.TwitterMessage.TwitterMessage(); objTwitterMessage.Timeout = 300000; twtmsgcount = objTwitterMessage.GetFeedCountByProfileIdAndUserId(objUser.Id.ToString(), FbProfileId); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { Api.ScheduledMessage.ScheduledMessage objScheduledMessage = new Api.ScheduledMessage.ScheduledMessage(); objScheduledMessage.Timeout = 300000; allsentmsgcount = objScheduledMessage.GetSentMessageCountByProfileIdAndUserId(objUser.Id.ToString(), FbProfileId); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } string _totalIncomingMessage = "0"; string _totalSentMessage = "0"; string _totalTwitterFollowers = "0"; string _totalFacebookFan = "0"; try { _totalIncomingMessage = (fbmsgcount + twtmsgcount).ToString(); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { _totalSentMessage = allsentmsgcount.ToString(); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { _totalTwitterFollowers = SBUtils.GetAllTwitterFollowersCountofUser(TwtProfileId, objUser.Id.ToString()); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { _totalFacebookFan = SBUtils.GetAllFacebookFancountofUser(FbProfileId, objUser.Id.ToString()); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } ViewBag._totalIncomingMessage = _totalIncomingMessage; ViewBag._totalSentMessage = _totalSentMessage; ViewBag._totalTwitterFollowers = _totalTwitterFollowers; ViewBag._totalFacebookFan = _totalFacebookFan; return(PartialView("_HomeUserActivityPartial")); }
public void log(object obj) { SBUtils.log(this.LogFile, obj); }
protected void btnRegister_Click(object sender, ImageClickEventArgs e) { Groups groups = new Groups(); GroupRepository objGroupRepository = new GroupRepository(); Team teams = new Team(); TeamRepository objTeamRepository = new TeamRepository(); try { Session["login"] = null; Registration regpage = new Registration(); User user = (User)Session["LoggedUser"]; if (DropDownList1.SelectedValue == "Free" || DropDownList1.SelectedValue == "Standard" || DropDownList1.SelectedValue == "Deluxe" || DropDownList1.SelectedValue == "Premium" || DropDownList1.SelectedValue == "SocioBasic" || DropDownList1.SelectedValue == "SocioStandard" || DropDownList1.SelectedValue == "SocioPremium" || DropDownList1.SelectedValue == "SocioDeluxe") { if (TextBox1.Text.Trim() != "") { string resp = SBUtils.GetCouponStatus(TextBox1.Text).ToString(); if (resp != "valid") { // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert(Not valid);", true); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + resp + "');", true); return; } } if (user != null) { user.EmailId = txtEmail.Text; user.UserName = txtFirstName.Text + " " + txtLastName.Text; UserActivation objUserActivation = new UserActivation(); UserRepository userrepo = new UserRepository(); Coupon objCoupon = new Coupon(); CouponRepository objCouponRepository = new CouponRepository(); if (userrepo.IsUserExist(user.EmailId)) { try { string acctype = string.Empty; if (Request.QueryString["type"] != null) { if (Request.QueryString["type"] == "INDIVIDUAL" || Request.QueryString["type"] == "CORPORATION" || Request.QueryString["type"] == "SMALL BUSINESS") { acctype = Request.QueryString["type"]; } else { acctype = "INDIVIDUAL"; } } else { acctype = "INDIVIDUAL"; } user.AccountType = Request.QueryString["type"]; } catch (Exception ex) { logger.Error(ex.StackTrace); Console.WriteLine(ex.StackTrace); } user.AccountType = DropDownList1.SelectedValue.ToString(); if (string.IsNullOrEmpty(user.AccountType)) { user.AccountType = AccountType.Free.ToString(); } if (string.IsNullOrEmpty(user.Password)) { user.Password = regpage.MD5Hash(txtPassword.Text); // userrepo.UpdatePassword(user.EmailId, user.Password, user.Id, user.UserName, user.AccountType); string couponcode = TextBox1.Text.Trim(); userrepo.SetUserByUserId(user.EmailId, user.Password, user.Id, user.UserName, user.AccountType, couponcode); try { if (TextBox1.Text.Trim() != "") { objCoupon.CouponCode = TextBox1.Text.Trim(); List <Coupon> lstCoupon = objCouponRepository.GetCouponByCouponCode(objCoupon); objCoupon.Id = lstCoupon[0].Id; objCoupon.EntryCouponDate = lstCoupon[0].EntryCouponDate; objCoupon.ExpCouponDate = lstCoupon[0].ExpCouponDate; objCoupon.Status = "1"; objCouponRepository.SetCouponById(objCoupon); } } catch (Exception ex) { Console.WriteLine(ex.Message); logger.Error("Error : " + ex.Message); logger.Error("Error : " + ex.StackTrace); } //add userActivation try { objUserActivation.Id = Guid.NewGuid(); objUserActivation.UserId = user.Id; objUserActivation.ActivationStatus = "0"; UserActivationRepository.Add(objUserActivation); } catch (Exception ex) { Console.WriteLine(ex.Message); logger.Error("Error : " + ex.Message); logger.Error("Error : " + ex.StackTrace); } //add package start try { UserPackageRelation objUserPackageRelation = new UserPackageRelation(); UserPackageRelationRepository objUserPackageRelationRepository = new UserPackageRelationRepository(); PackageRepository objPackageRepository = new PackageRepository(); Package objPackage = objPackageRepository.getPackageDetails(user.AccountType); objUserPackageRelation.Id = Guid.NewGuid(); objUserPackageRelation.PackageId = objPackage.Id; objUserPackageRelation.UserId = user.Id; objUserPackageRelation.ModifiedDate = DateTime.Now; objUserPackageRelation.PackageStatus = true; objUserPackageRelationRepository.AddUserPackageRelation(objUserPackageRelation); //end package MailSender.SendEMail(txtFirstName.Text + " " + txtLastName.Text, txtPassword.Text, txtEmail.Text, user.AccountType.ToString(), user.Id.ToString()); } catch (Exception ex) { Console.WriteLine(ex.Message); logger.Error("Error : " + ex.Message); logger.Error("Error : " + ex.StackTrace); } try { groups.Id = Guid.NewGuid(); groups.GroupName = ConfigurationManager.AppSettings["DefaultGroupName"]; groups.UserId = user.Id; groups.EntryDate = DateTime.Now; objGroupRepository.AddGroup(groups); teams.Id = Guid.NewGuid(); teams.GroupId = groups.Id; teams.UserId = user.Id; teams.EmailId = user.EmailId; // teams.FirstName = user.UserName; objTeamRepository.addNewTeam(teams); BusinessSettingRepository busnrepo = new BusinessSettingRepository(); //SocioBoard.Domain.Team team = (SocioBoard.Domain.Team)Session["GroupName"]; SocioBoard.Domain.BusinessSetting objbsnssetting = new SocioBoard.Domain.BusinessSetting(); if (!busnrepo.checkBusinessExists(user.Id, groups.GroupName)) { objbsnssetting.Id = Guid.NewGuid(); objbsnssetting.BusinessName = groups.GroupName; //objbsnssetting.GroupId = team.GroupId; objbsnssetting.GroupId = groups.Id; objbsnssetting.AssigningTasks = false; objbsnssetting.AssigningTasks = false; objbsnssetting.TaskNotification = false; objbsnssetting.TaskNotification = false; objbsnssetting.FbPhotoUpload = 0; objbsnssetting.UserId = user.Id; objbsnssetting.EntryDate = DateTime.Now; busnrepo.AddBusinessSetting(objbsnssetting); } } catch (Exception ex) { Console.WriteLine(ex.Message); logger.Error("Error : " + ex.Message); logger.Error("Error : " + ex.StackTrace); } } } Session["LoggedUser"] = user; Response.Redirect("Home.aspx"); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Please select Account Type!');", true); } } catch (Exception ex) { logger.Error(ex.StackTrace); Console.WriteLine(ex.StackTrace); } }