Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if(Request.QueryString["redirectid"]==null)
                {

                if(Session["USERINFO"]==null)
                {

                    FaceBookConnect.API_Key = "794873443927888";
                    FaceBookConnect.API_Secret = "9acae58fe0463444952937a30c580db7";

                    //FaceBookConnect.API_Key = "794907040591195";
                    //FaceBookConnect.API_Secret = "c04f2ce2aa23fdae3ad06fce3ab78cb0";

                TwitterConnect.API_Key = "xZEV2y8Tlvu4RbZWuVtsFhGJO";
                TwitterConnect.API_Secret = "kokijgTSJnKmOLtEMlvZJtZMl0Dd0vFxqmK4kmIf1oVxFWgF9r";

                GoogleConnect.ClientId = "7682337252-coj546o017md56kuf69temoqh4hl3qt7.apps.googleusercontent.com";
                GoogleConnect.ClientSecret = "KMxXZCqWqk1YUtciM4g3IeuV";

                GoogleConnect.RedirectUri = Request.Url.AbsoluteUri.Split('?')[0];

                if (!IsPostBack)
                {
                    Session["USERINFO"] = null;

                    //clearuserpass();
                    chk_remember.Checked = true;

                    if (Request.Cookies["UserName"] != null && Request.Cookies["Password"] != null)
                    {
                        txt_loginemail.Value = Request.Cookies["UserName"].Value;
                       // txt_loginpass.Value = Request.Cookies["Password"].Value;
                        txt_loginpass.Attributes["value"] = Request.Cookies["Password"].Value;

                    }
                    if (Request.Cookies["LBRUserName"] != null && Request.Cookies["LBRPassword"] != null)
                    {
                        txt_loginemail.Value = Request.Cookies["LBRUserName"].Value;
                        // txt_loginpass.Value = Request.Cookies["Password"].Value;
                        txt_loginpass.Attributes["value"] = Request.Cookies["LBRPassword"].Value;
                        txt_loginpass.Text = Request.Cookies["LBRPassword"].Value;
                        autologin();
                       // Response.Cookies["UserName"].Value = Request.Cookies["LBRUserName"].Value;
                       // Response.Cookies["Password"].Value = Request.Cookies["LBRPassword"].Value;
                    }
                    //if (Response.Cookies["LBRADMINLOGIN"].Values["UNAME"] != null)
                    //{
                    //    txt_loginemail.Value = Response.Cookies["LBRADMINLOGIN"].Values["UNAME"];
                    //}
                    //if (Response.Cookies["LBRADMINLOGIN"].Values["UPASS"] != null)
                    //{
                    //    txt_loginpass.Value = Response.Cookies["LBRADMINLOGIN"].Values["UPASS"];
                    //}
                    string code = "";
                    if (Request.QueryString["oauth_token"] != null && Request.QueryString["oauth_verifier"] != null)
                    {
                        string oauth_token = Request.QueryString["oauth_token"];
                        string oauth_verifier = Request.QueryString["oauth_verifier"];

                        OAuthHelper oauthhelper = new OAuthHelper();
                        oauthhelper.GetUserTwAccessToken(oauth_token, oauth_verifier);

                        if (string.IsNullOrEmpty(oauthhelper.oauth_error))
                        {
                            Session["twtoken"] = oauthhelper.oauth_access_token;
                            Session["twsecret"] = oauthhelper.oauth_access_token_secret;
                            Session["twuserid"] = oauthhelper.user_id;
                            Session["twname"] = oauthhelper.screen_name;

                            LBR_SIGNUP obj = new LBR_SIGNUP();
                            //string[] split = facebook.Split(' ');
                            obj.LBR_EMAILID = oauthhelper.screen_name;
                            obj.LBR_MODIFIEDBY = 1;
                            obj.LBR_MODIFIEDTYPE = 1;
                            obj.LBR_CREATEDBY = 1;
                            obj.LBR_LOGINTYPE = 3;

                            obj.LBR_FIRSTNAME = oauthhelper.screen_name;

                            // obj.LBR_IMAGEURL = image;
                            obj.LBR_LOGINID = oauthhelper.user_id;
                            DataTable dt = BLL.checkemail(obj);
                            if (dt.Rows.Count > 0)
                            {
                                Session["USERINFO"] = dt;
                               Response.Redirect("Linkskart.aspx");
                            }
                            else
                            {
                                dt = BLL.ExecuteQuery("exec Usp_lbr_signup @OPERATION = 'signupsocial',@LBR_EMAILID='" + obj.LBR_EMAILID + "',@LBR_LOGINTYPE='" + obj.LBR_LOGINTYPE + "',@LBR_FIRSTNAME='" + obj.LBR_FIRSTNAME + "',@LBR_LASTNAME='" + obj.LBR_LASTNAME + "',@LBR_IMAGEURL='" + obj.LBR_IMAGEURL + "',@LBR_LOGINID='" + obj.LBR_LOGINID + "',@LBR_MODIFIEDBY='" + obj.LBR_MODIFIEDBY + "',@LBR_MODIFIEDTYPE='" + obj.LBR_MODIFIEDTYPE + "',@LBR_CREATEDBY='" + obj.LBR_CREATEDBY + "'");
                                if (dt.Rows.Count > 0)
                                {
                                    obj.LBR_ID = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                                    obj.LBR_CREATEDBY = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                                    obj.LBR_MODIFIEDBY = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                                    bool status = BLL.setdefaulttabs(obj);
                                    Session["USERINFO"] = dt;
                                    Response.Redirect("Linkskart.aspx");
                                }
                                else
                                {
                                    BLL.ShowMessage(this, "Please try again after sometime");
                                }
                            }

                        }
                        else
                            Response.Write(oauthhelper.oauth_error);
                    }
                    if (Session["logintype"]!=null)
                    {
                    if(Int32.Parse(Session["logintype"].ToString())==4)
                    {
                    if (!string.IsNullOrEmpty(Request.QueryString["code"]))

                    {
                         code = Request.QueryString["code"];
                        string json = GoogleConnect.Fetch("me", code);

                        GoogleProfile profile = new JavaScriptSerializer().Deserialize<GoogleProfile>(json);
                        LBR_SIGNUP obj = new LBR_SIGNUP();
                        obj.LBR_EMAILID = profile.Emails.Find(email => email.Type == "account").Value;
                        obj.LBR_MODIFIEDBY = 1;
                        obj.LBR_MODIFIEDTYPE = 1;
                        obj.LBR_CREATEDBY = 1;
                        obj.LBR_LOGINTYPE = 4;
                        obj.USERS_STATUS = true;
                        obj.LBR_IMAGEURL = profile.Image.Url;
                        obj.LBR_FIRSTNAME = profile.DisplayName;
                        obj.LBR_LOGINID = profile.Id;
                        DataTable dt = BLL.checkemail(obj);
                        if (dt.Rows.Count > 0)
                        {
                            Session["USERINFO"] = dt;
                            Response.Redirect("Linkskart.aspx");
                        }
                        else
                        {
                            dt = BLL.ExecuteQuery("exec Usp_lbr_signup @OPERATION = 'signupsocial',@LBR_EMAILID='" + obj.LBR_EMAILID + "',@LBR_LOGINTYPE='" + obj.LBR_LOGINTYPE + "',@LBR_FIRSTNAME='" + obj.LBR_FIRSTNAME + "',@LBR_LASTNAME='" + obj.LBR_LASTNAME + "',@LBR_IMAGEURL='" + obj.LBR_IMAGEURL + "',@LBR_LOGINID='" + obj.LBR_LOGINID + "',@LBR_MODIFIEDBY='" + obj.LBR_MODIFIEDBY + "',@LBR_MODIFIEDTYPE='" + obj.LBR_MODIFIEDTYPE + "',@LBR_CREATEDBY='" + obj.LBR_CREATEDBY + "'");
                            if (dt.Rows.Count > 0)
                            {
                                obj.LBR_ID = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                                obj.LBR_CREATEDBY = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                                obj.LBR_MODIFIEDBY=Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                                bool status = BLL.setdefaulttabs(obj);
                                Session["USERINFO"] = dt;
                                Response.Redirect("Linkskart.aspx");
                            }
                            else
                            {
                                BLL.ShowMessage(this, "Please try again after sometime");
                            }
                        }
                        //lblId.Text = profile.Id;
                        //lblName.Text = profile.DisplayName;
                        //lblEmail.Text = profile.Emails.Find(email => email.Type == "account").Value;
                        //lblGender.Text = profile.Gender;
                        //lblType.Text = profile.ObjectType;
                        //ProfileImage.ImageUrl = profile.Image.Url;
                        //pnlProfile.Visible = true;
                        //btnLogin.Enabled = false;
                    }
                    if (Request.QueryString["error"] == "access_denied")
                    {
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('Access denied.')", true);
                    }

                }

                    if (Int32.Parse(Session["logintype"].ToString()) == 2)
                    {
                     code = Request.QueryString["code"];
                    if (!string.IsNullOrEmpty(code))
                    {
                        string data = FaceBookConnect.Fetch(code, "me");
                        FaceBookUser faceBookUser = new JavaScriptSerializer().Deserialize<FaceBookUser>(data);
                        faceBookUser.PictureUrl = string.Format("https://graph.facebook.com/{0}/picture", faceBookUser.Id);
                       string facebookid = faceBookUser.Id;
                       string username = faceBookUser.UserName;
                       string facebook = faceBookUser.Name;
                      string image = faceBookUser.PictureUrl;
                       string email = faceBookUser.Email;
                       LBR_SIGNUP obj = new LBR_SIGNUP();
                       string[] split = facebook.Split(' ');
                       obj.LBR_EMAILID = email;
                       obj.LBR_MODIFIEDBY = 1;
                       obj.LBR_MODIFIEDTYPE = 1;
                       obj.LBR_CREATEDBY = 1;
                       obj.LBR_LOGINTYPE = 2;
                        if(split.Length==2)
                        {
                       obj.LBR_FIRSTNAME = split[0];
                       obj.LBR_LASTNAME = split[1];
                        }
                        else
                        {
                            obj.LBR_FIRSTNAME = facebook;
                        }
                        obj.LBR_IMAGEURL = image;
                        obj.LBR_LOGINID = facebookid;
                       DataTable dt = BLL.checkemail(obj);
                       if(dt.Rows.Count>0)
                       {
                           Session["USERINFO"] = dt;
                           Response.Redirect("Linkskart.aspx");
                       }
                        else
                       {
                           dt = BLL.ExecuteQuery("exec Usp_lbr_signup @OPERATION = 'signupsocial',@LBR_EMAILID='" + obj.LBR_EMAILID + "',@LBR_LOGINTYPE='" + obj.LBR_LOGINTYPE + "',@LBR_FIRSTNAME='" + obj.LBR_FIRSTNAME + "',@LBR_LASTNAME='" + obj.LBR_LASTNAME + "',@LBR_IMAGEURL='" + obj.LBR_IMAGEURL + "',@LBR_LOGINID='" + obj.LBR_LOGINID + "',@LBR_MODIFIEDBY='" + obj.LBR_MODIFIEDBY + "',@LBR_MODIFIEDTYPE='" + obj.LBR_MODIFIEDTYPE + "',@LBR_CREATEDBY='"+ obj.LBR_CREATEDBY +"'");
                      if(dt.Rows.Count>0)
                      {
                          obj.LBR_ID = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                          obj.LBR_CREATEDBY = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                          obj.LBR_MODIFIEDBY = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                          bool status = BLL.setdefaulttabs(obj);
                          Session["USERINFO"] = dt;
                          Response.Redirect("Linkskart.aspx");
                      }
                           else
                      {
                          BLL.ShowMessage(this, "Please try again after sometime");
                      }
                       }

                    }
                    else
                    {

                    }
                    }
                }
                }
                }
                else
                {
                    Response.Redirect("Linkskart.aspx",false);
                }
            }
            else
            {
                DataTable dt_redirecturl = BLL.ExecuteQuery("select * from lbr_links where link_id="+ Request.QueryString["redirectid"].ToString() +"");
               if(dt_redirecturl.Rows.Count>0)
               {
               Response.Redirect(""+ dt_redirecturl.Rows[0]["link_path"].ToString() +"");
               }
                }
            }
            catch (Exception ex)
            {

            }
        }
Esempio n. 2
0
        public void autologin()
        {
            try
            {
                LBR_SIGNUP obj = new LBR_SIGNUP();
                obj.LBR_PASSWORD = BLL.Encrypt(BLL.ReplaceQuote(txt_loginpass.Text.Trim()));
                obj.LBR_EMAILID = BLL.ReplaceQuote(txt_loginemail.Value.Trim());
                obj.LBR_LOGINTYPE = 1;
                DataTable dt = BLL.checklogin(obj);
                if (dt.Rows.Count > 0)
                {

                    if (chk_remember.Checked)
                    {
                        Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(30);
                        Response.Cookies["Password"].Expires = DateTime.Now.AddDays(30);
                        Response.Cookies["UserName"].Value = txt_loginemail.Value.Trim();
                        Response.Cookies["Password"].Value = txt_loginpass.Text.Trim();
                    }
                    else
                    {
                        Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1);
                        Response.Cookies["Password"].Expires = DateTime.Now.AddDays(-1);

                    }

                    Response.Cookies["LBRUserName"].Expires = DateTime.Now.AddDays(30);
                    Response.Cookies["LBRPassword"].Expires = DateTime.Now.AddDays(30);
                    Response.Cookies["LBRUserName"].Value = txt_loginemail.Value.Trim();
                    Response.Cookies["LBRPassword"].Value = txt_loginpass.Text.Trim();
                    //if (chk_remember.Checked)
                    //{
                    //    if (Request.Browser.Cookies)
                    //    {
                    //        if (Request.Cookies["LBRADMINLOGIN"] == null)
                    //        {
                    //            HttpCookie cookie = new HttpCookie("LBRADMINLOGIN");
                    //            Response.Cookies["LBRADMINLOGIN"].Expires = DateTime.Now.AddDays(30);

                    //            Response.Cookies["LBRADMINLOGIN"].Values["UNAME"] = txt_loginemail.Value;
                    //            Response.Cookies["LBRADMINLOGIN"].Values["UPASS"] = txt_loginpass.Value.ToString().Trim();

                    //        }
                    //        else
                    //        {
                    //            HttpCookie cookie = new HttpCookie("LBRADMINLOGIN");

                    //            Response.Cookies["LBRADMINLOGIN"].Values["UNAME"] = txt_loginemail.Value;
                    //            Response.Cookies["LBRADMINLOGIN"].Values["UPASS"] = txt_loginpass.Value.ToString().Trim();

                    //        }
                    //    }
                    //}
                    //else
                    //{
                    //    if (Request.Browser.Cookies)
                    //    {
                    //        if (Request.Cookies["LBRADMINLOGIN"] != null)
                    //        {
                    //            HttpCookie myCookie = new HttpCookie("LBRADMINLOGIN");
                    //            myCookie.Expires = DateTime.Now.AddDays(-500);
                    //            Response.Cookies.Add(myCookie);
                    //        }
                    //    }
                    //}
                    Session["USERINFO"] = dt;
                    Response.Redirect("Linkskart.aspx", false);
                }
                else
                {
                    //Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1);
                    //Response.Cookies["Password"].Expires = DateTime.Now.AddDays(-1);
                    //Response.Cookies["LBRUserName"].Expires = DateTime.Now.AddDays(-1);
                    //Response.Cookies["LBRPassword"].Expires = DateTime.Now.AddDays(-1);
                }
            }
            catch (Exception ex)
            {

            }
        }
Esempio n. 3
0
        protected void btn_submit_Click(object sender, EventArgs e)
        {
            try
            {
                if (txt_password.Value.Trim() == txt_confirmpassword.Value.Trim())
                {
                    bool status = false;
                    LBR_SIGNUP obj = new LBR_SIGNUP();
                    obj.LBR_FIRSTNAME = BLL.ReplaceQuote(txt_firstname.Value.Trim());
                    obj.LBR_LASTNAME = BLL.ReplaceQuote(txt_lastname.Value.Trim());
                    obj.LBR_EMAILID = txt_email.Value.Trim();
                    obj.LBR_PASSWORD = txt_password.Value.Trim();
                    obj.LBR_PHONENUMBER = txt_phone.Value.Trim();
                    obj.LBR_LOGINTYPE = 1;
                    DataTable dt_checkmail = BLL.checkemail(obj);
                    if (dt_checkmail.Rows.Count == 0)
                    {

                        DataTable dt= BLL.createuser(obj);

                        if (dt.Rows.Count>0)
                        {
                            obj.LBR_ID = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                            obj.LBR_CREATEDBY = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                            obj.LBR_MODIFIEDBY = Int32.Parse(dt.Rows[0]["LBR_ID"].ToString());
                            status = BLL.setdefaulttabs(obj);
                            clearuserpass();
                            BLL.ShowMessage(this, "Signup sucessfully completed,please login with your credentials");

                            MailMessage mailmessage = new MailMessage();
                            mailmessage.IsBodyHtml = true;
                            SmtpClient client = new SmtpClient("linkskart.com");

                            client.Credentials = new System.Net.NetworkCredential("*****@*****.**", ".santhu143");
                            mailmessage.From = new System.Net.Mail.MailAddress("*****@*****.**");

                            // mailmessage.From = new MailAddress("*****@*****.**");
                            mailmessage.To.Add(obj.LBR_EMAILID);
                            // mailmessage.CC.Add(emailid);
                            mailmessage.Subject = "Signup Process sucessfully Completed with LINKSKART";

                            mailmessage.Body = " <p> Dear " + obj.LBR_FIRSTNAME + " " + obj.LBR_LASTNAME + ",<br />Thank you so much for showing interest in LINKSKART</p><table align=\"center\"><tr><td>Username/EmailID</td><td>:</td><td>" + obj.LBR_EMAILID + "</td></tr><tr><td>Password</td><td>:</td><td>" + obj.LBR_PASSWORD + "</td></tr></table><p>Please <a href=\"www.linkskart.com\">Click Here</a> to visit LINKSKART></p>";
                            client.EnableSsl = false;

                            //MailMessage eMail = new MailMessage();
                            //eMail.BodyFormat = MailFormat.Html;
                            //eMail.From = "*****@*****.**";
                            //eMail.To = obj.LBR_EMAILID;
                            //// eMail.Cc = "*****@*****.**";
                            //// eMail.Bcc = "*****@*****.**";
                            //eMail.Subject = "Signup Process sucessfully Completed with LINKSKART";
                            //eMail.Body = " <p> Dear " + obj.LBR_FIRSTNAME + " " + obj.LBR_LASTNAME + ",<br />Thank you so much for showing interest in LINKSKART</p><table align=\"center\"><tr><td>Username/EmailID</td><td>:</td><td>" + obj.LBR_EMAILID + "</td></tr><tr><td>Password</td><td>:</td><td>" + obj.LBR_PASSWORD + "</td></tr></table><p>Please <a href=\"www.linkskart.com\">Click Here</a> to visit LINKSKART></p>";

                            //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
                            //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25");
                            //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "*****@*****.**");
                            //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", ".santhu143");
                            //SmtpMail.SmtpServer = "linkskart.com";

                            try
                            {

                                client.Send(mailmessage);
                            }
                            catch (Exception ae)
                            {

                            }

                            //MailMessage mailmessage = new MailMessage();
                            //mailmessage.IsBodyHtml = true;
                            //SmtpClient client = new SmtpClient(ConfigurationSettings.AppSettings["signupMsgclient"].ToString());

                            //client.Credentials = new System.Net.NetworkCredential(ConfigurationSettings.AppSettings["signupMsgUser"].ToString(), ConfigurationSettings.AppSettings["signMsgPassword"].ToString());
                            //mailmessage.From = new System.Net.Mail.MailAddress(ConfigurationSettings.AppSettings["signupMsgFrom"].ToString());

                            //// mailmessage.From = new MailAddress("*****@*****.**");
                            //mailmessage.To.Add(ConfigurationSettings.AppSettings["signupMsgTo"].ToString());
                            //// mailmessage.CC.Add(emailid);
                            //mailmessage.Subject = "Signup process sucessfully completed with LINKSKART";

                            //mailmessage.Body = " <p> Dear "+ obj.LBR_FIRSTNAME +" "+ obj.LBR_LASTNAME+",<br />Thank you so much for showing interest in LINKSKART</p><table align=\"center\"><tr><td>Username/EmailID</td><td>:</td><td>"+ obj.LBR_EMAILID +"</td></tr><tr><td>Password</td><td>:</td><td>"+ obj.LBR_PASSWORD +"</td></tr></table><p>Please <a href=\"www.linkskart.com\">Click Here</a> to visit LINKSKART></p>";
                            //client.EnableSsl = false;
                            //client.Port = 25;
                            //client.Send(mailmessage);
                        }
                        else
                        {
                            BLL.ShowMessage(this, "please try again after sometime");
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "$('#myModal').modal('show'); ", true);
                        }
                    }

                    else
                    {
                        BLL.ShowMessage(this, "EmailID already exists");
                        txt_email.Focus();
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "$('#myModal').modal('show'); ", true);
                    }
                }
                else
                {
                    BLL.ShowMessage(this, "Password/confirm password doesnot match");
                    txt_confirmpassword.Focus();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "$('#myModal').modal('show');", true);
                }

            }
            catch (Exception ex)
            {

            }
        }
Esempio n. 4
0
        protected void btn_forgotpass_Click(object sender, EventArgs e)
        {
            try
            {
                LBR_SIGNUP obj = new LBR_SIGNUP();
                obj.LBR_LOGINTYPE = 1;
                obj.LBR_EMAILID = txt_forgotemail.Value.Trim();
                DataTable dt_checkmail = BLL.checkemail(obj);
                if (dt_checkmail.Rows.Count > 0)
                {
                   // should i give you as sample code?
                    //is any thing wrong i wrote this codewas used in mny sites by me it worked well if you have any other code provide me

                    //for psl team
                    // make changes in this and try

                      MailMessage mailmessage = new MailMessage();
                        mailmessage.IsBodyHtml = true;
                        SmtpClient client = new SmtpClient("linkskart.com");

                        client.Credentials = new System.Net.NetworkCredential("*****@*****.**", ".santhu143");
                        mailmessage.From = new System.Net.Mail.MailAddress("*****@*****.**");

                        // mailmessage.From = new MailAddress("*****@*****.**");
                        mailmessage.To.Add(obj.LBR_EMAILID);
                        // mailmessage.CC.Add(emailid);
                        mailmessage.Subject = "Password request";

                        mailmessage.Body = "<p> Dear " + dt_checkmail.Rows[0]["LBR_FIRSTNAME"].ToString() + " " + dt_checkmail.Rows[0]["LBR_LASTNAME"].ToString() + ",<br /> <br />You password is " + BLL.Decrypt(dt_checkmail.Rows[0]["LBR_PASSWORD"].ToString()) + " please <a href=\"http://www.linkskart.com\">Click Here</a> to visit LINKSKART.</p></div>";
                        client.EnableSsl = false;

                    //MailMessage eMail = new MailMessage();
                    //eMail.BodyFormat = MailFormat.Html;
                    //eMail.From = "*****@*****.**";
                    //eMail.To = obj.LBR_EMAILID;
                    //// eMail.Cc = "*****@*****.**";
                    //// eMail.Bcc = "*****@*****.**";

                    //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "linkskart.com");
                    //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
                    //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25");
                    //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "*****@*****.**");
                    //eMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", ".santhu143");
                    //eMail.Body = "<p> Dear " + dt_checkmail.Rows[0]["LBR_FIRSTNAME"].ToString() + " " + dt_checkmail.Rows[0]["LBR_LASTNAME"].ToString() + ",<br /> <br />You password is " + BLL.Decrypt(dt_checkmail.Rows[0]["LBR_PASSWORD"].ToString()) + " please <a href=\"http://www.linkskart.com\">Click Here</a> to visit LINKSKART.</p></div>";
                    //eMail.Subject = "Password request";

                    try
                    {
                        client.Send(mailmessage);
                        //SmtpMail.Send(eMail);
                    }
                    catch (Exception ae)
                    {
                        // Label1.Text = ae.Message;
                    }
                    //ok i will try this if i dont get i will message you again ok no problem, if chat is not available you can drop an email at [email protected] with code file attached.ok t

                    //MailMessage mailmessage = new MailMessage();
                    //mailmessage.IsBodyHtml = true;
                    //SmtpClient client = new SmtpClient(ConfigurationSettings.AppSettings["forgotMsgclient"].ToString());

                    //client.Credentials = new System.Net.NetworkCredential(ConfigurationSettings.AppSettings["forgotMsgUser"].ToString(), ConfigurationSettings.AppSettings["forgotMsgPassword"].ToString());
                    //mailmessage.From = new System.Net.Mail.MailAddress(ConfigurationSettings.AppSettings["forgotMsgFrom"].ToString());

                    //// mailmessage.From = new MailAddress("*****@*****.**");
                    //mailmessage.To.Add(obj.LBR_EMAILID);
                    //// mailmessage.CC.Add(emailid);
                    //mailmessage.Subject = "Request for password";

                    //mailmessage.Body = "<p> Dear "+ dt_checkmail.Rows[0]["LBR_FIRSTNAME"].ToString() + " "+ dt_checkmail.Rows[0]["LBR_LASTNAME"].ToString() +",<br /> <br />You password is "+ BLL.Decrypt(dt_checkmail.Rows[0]["LBR_PASSWORD"].ToString()) +" please <a href=\"http://www.linkskart.com\">Click Here</a> to visit LINKSKART.</p></div>";
                    //client.EnableSsl = false;
                    //client.Port = 25;
                    //client.Send(mailmessage);

                    BLL.ShowMessage(this, "Password has been sent to your registered email id");
                    txt_forgotemail.Value = "";
                }
                else
                {
                    BLL.ShowMessage(this, "This is not registered Email id");
                    txt_forgotemail.Focus();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "$('#myModal2').modal('show'); ", true);
                }
            }
            catch (Exception ex)
            {

            }
        }
Esempio n. 5
0
        public void loadtabs(string lbrid,string imageurl,string name)
        {
            LBR_SIGNUP obj = new LBR_SIGNUP();
            obj.LBR_ID = Int32.Parse(lbrid);
            //  DataSet dt_set = BLL.get_tabs(obj);
            DataTable dt_atab = BLL.get_tabs(obj);
            DataTable dt_tabs = BLL.ExecuteQuery("exec USP_LBR_SIGNUP @OPERATION='LOADANONYMOUSTAB', @LBR_ID='" + obj.LBR_ID + "'");
            dt_tabs.Merge(dt_atab);
            string innerhtml = "";
            string tabcontent = "";
            string remainingtabs = "";
            string remainintabscontent = "";
            int sharedcount = 0;
            int anonyshared = 0;
            //int k = 0;
            if (dt_tabs.Rows.Count > 0)
            {
                if(imageurl!=null && imageurl!="")
                {
                innerhtml = " <li class='nav-header'><div class='dropdown profile-element'><span><img  id='img_user' alt='profile pic' class='img-circle' src='"+ imageurl +"' /></span><a href='#'><span class='clear'><span class='block m-t-xs'><strong  id='lbl_name' class='font-bold'>"+ name +"</strong></span></span></a></div></li><li class='nav-header' style='padding-top: 0px !important;padding-bottom: 0px;padding-left: 0px;'><div class='dropdown profile-element' style='padding:13px 25px'><a data-toggle='modal' data-target='#mynewtab'><span class='clear'>Create a new tab</span></a></div></li>";
                }
                else
                {
                    innerhtml = " <li class='nav-header'><div class='dropdown profile-element'><span><img  id='img_user' alt='profile pic' class='img-circle' src='Images/Dummy.jpg' /></span><a href='#'><span class='clear'><span class='block m-t-xs'><strong  id='lbl_name' class='font-bold'>"+ name +"</strong></span></span></a></div></li><li class='nav-header' style='padding-top: 0px !important;padding-bottom: 0px;padding-left: 0px;'><div class='dropdown profile-element' style='padding:13px 25px'><a data-toggle='modal' data-target='#mynewtab'><span class='clear'>Create a new tab</span></a></div></li>";
                }
                    for (int i = 0; i < dt_tabs.Rows.Count; i++)
                {
                    sharedcount = 0;
                    anonyshared = 0;
                    sharedcount = Int32.Parse(dt_tabs.Rows[i]["sharedcount"].ToString());

                    if (sharedcount == 0)
                    {
                        if(i==0)
                        {
                            innerhtml = innerhtml + "<li class='pull-left leftwidth active'><a title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\" id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href='#' onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" ><span class='nav-label block'>" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</span></a><ul></ul></li><li class='pull-left '> <a class='rightpadding'><span class='block m-t-xs'><b class='caret'></b></span><ul class='dropdown-menu animated fadeInRight m-t-xs'><li><a onclick=\"Sharetotaltableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Share</a></li><li><a  onclick=\"opentabnameleft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Rename</a></li><li><a onclick=\"deletetableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Delete</a></li></ul></a></li>";
                        }
                        else
                        {
                        // innerhtml = "<li class=\"active\"><a id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";
                        innerhtml = innerhtml + "<li class='pull-left leftwidth'><a title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\" id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href='#' onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" ><span class='nav-label block'>" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</span></a><ul></ul></li><li class='pull-left '> <a class='rightpadding'><span class='block m-t-xs'><b class='caret'></b></span><ul class='dropdown-menu animated fadeInRight m-t-xs'><li><a onclick=\"Sharetotaltableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Share</a></li><li><a  onclick=\"opentabnameleft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Rename</a></li><li><a onclick=\"deletetableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Delete</a></li></ul></a></li>";
                        }
                        }
                    else
                    {
                        if(i==0)
                        {
                            innerhtml = innerhtml + "<li class='pull-left leftwidth active'><a title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\" id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href='#'  onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" ><span class='nav-label block'>" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "<span class='label label-warning pull-right' id=\"lbn_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\">" + sharedcount + "</span></span></a><ul></ul></li><li class='pull-left '> <a class='rightpadding'><span class='block m-t-xs'><b class='caret'></b></span><ul class='dropdown-menu animated fadeInRight m-t-xs'><li><a onclick=\"Sharetotaltableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Share</a></li><li><a onclick=\"opentabnameleft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Rename</a></li><li><a onclick=\"deletetableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Delete</a></li></ul></a></li>";
                        }
                        else
                        {
                            innerhtml = innerhtml + "<li class='pull-left leftwidth'><a title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\" id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href='#'  onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" ><span class='nav-label block'>" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "<span class='label label-warning pull-right' id=\"lbn_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\">" + sharedcount + "</span></span></a><ul></ul></li><li class='pull-left '> <a class='rightpadding'><span class='block m-t-xs'><b class='caret'></b></span><ul class='dropdown-menu animated fadeInRight m-t-xs'><li><a onclick=\"Sharetotaltableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Share</a></li><li><a onclick=\"opentabnameleft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Rename</a></li><li><a onclick=\"deletetableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Delete</a></li></ul></a></li>";
                        }

                    }

                    if(i==0)
                    {
                    LBR_LINKS objlinks = new LBR_LINKS();
                    objlinks.LINK_TABID = Int32.Parse(dt_tabs.Rows[i]["TAB_ID"].ToString());
                    objlinks.LINK_SIGNUPID = Int32.Parse(lbrid);
                    DataTable dt_links = BLL.get_links(objlinks);
                    string content = System.Text.RegularExpressions.Regex.Replace(Loadlinks(dt_links), @"\s+", " ");
                    //if (content != string.Empty)
                    //{
                    tabcontent = "<div class=\"tab-pane fade active in\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\">" + content + "</div>";
                    //}
                    //else
                    //{
                    //    tabcontent = "<div class=\"tab-pane fade active in\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</div>";
                    //}

                    hid_tab.Value = lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString();
                    div_tabcontent.InnerHtml = tabcontent;
                    }

                }
                    //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "myJsFn", "loadmenus("++")", true);
                div_menus.InnerHtml = innerhtml;

            }
        }
Esempio n. 6
0
        public void loadadmintabs()
        {
            LBR_SIGNUP obj = new LBR_SIGNUP();
            obj.LBR_ID = 22;
            DataTable dt_tabs = BLL.get_tabs(obj);
            string innerhtml = "";
            string tabcontent = "";
            string remainingtabs = "";
            string remainintabscontent = "";
            //int k = 0;
            if (dt_tabs.Rows.Count > 0)
            {
                for (int i = 0; i < dt_tabs.Rows.Count; i++)
                {
                    if (i <= 2)
                    {
                        if (i == 0)
                        {
                            innerhtml = "<li class=\"admintabs\" class=\"active\"><a class=\"admintabsa\" id=\"aadmin_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tabadmin" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttabadmin('22_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";

                            LBR_LINKS objlinks = new LBR_LINKS();
                            objlinks.LINK_TABID = Int32.Parse(dt_tabs.Rows[i]["TAB_ID"].ToString());
                            objlinks.LINK_SIGNUPID = 22;
                            string content = loadhtml(objlinks);
                            //if (content != string.Empty)
                            //{
                            tabcontent = "<div class=\"tab-pane fade active in\" id=\"tabadmin" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\">" + content + "</div>";
                            //}
                            //else
                            //{
                            //    tabcontent = "<div class=\"tab-pane fade active in\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</div>";
                            //}

                            hid_tabadmin.Value = "22" + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString();

                        }

                        else
                        {
                            innerhtml = innerhtml + "<li class=\"admintabs\"><a class=\"admintabsa\" id=\"aadmin_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tabadmin" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttabadmin('22_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";
                            tabcontent = tabcontent + "<div class=\"tab-pane fade\" id=\"tabadmin" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\"></div>";
                        }
                    }
                    else
                    {
                        remainingtabs = remainingtabs + "<li class=\"\"><a id=\"aadmin_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tabadmin" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttabadmin('22_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";
                        remainintabscontent = remainintabscontent + "<div class=\"tab-pane fade\" id=\"tabadmin" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\"></div>";
                        if (hid_remainingtabsadmin.Value != "")
                        {
                            hid_remainingtabsadmin.Value = hid_remainingtabsadmin.Value + "," + dt_tabs.Rows[i]["TAB_ID"].ToString();
                        }
                        else
                        {
                            hid_remainingtabsadmin.Value = dt_tabs.Rows[i]["TAB_ID"].ToString();
                        }
                    }

                }
                remainingtabs = "<li class=\"dropdown\" style=\"width:10px !important;\"  title=\"Click Here more Tabs\"><a href=\"#\" data-toggle=\"dropdown\" class=\"alltabs\"><i class=\"fa fa-ellipsis-v\"></i></a><ul id='div_remainingtabsadmin' class=\"dropdown-menu dropdown__menu1\" role=\"menu\">" + remainingtabs + "</ul></li>";

                //u_admintabs.InnerHtml = innerhtml + remainingtabs;
                //div_admintabs.InnerHtml = tabcontent + remainintabscontent + "<div class=\"clearfix\"></div>";
            }
        }
Esempio n. 7
0
        public static string refreshloadtabsnew(string lbrid)
        {
            string totalcontent = "";
            try
            {

                LBR_SIGNUP obj = new LBR_SIGNUP();
                obj.LBR_ID = Int32.Parse(lbrid);
                DataTable dt_tabs = BLL.get_tabs(obj);
                DataTable dt_atab = BLL.ExecuteQuery("exec USP_LBR_SIGNUP @OPERATION='LOADANONYMOUSTAB', @LBR_ID='" + obj.LBR_ID + "'");
                string innerhtml = "";
                string tabcontent = "";
                string remainingtabs = "";
                string remainintabscontent = "";
                //int k = 0;

                if (dt_tabs.Rows.Count > 0)
                {
                    if (dt_tabs.Rows.Count > 5)
                    {
                        for (int i = 0; i < dt_tabs.Rows.Count; i++)
                        {
                            if (i <= 4)
                            {
                                if (i == 0)
                                {
                                    innerhtml = "<li class=\"active\"><a id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";

                                    LBR_LINKS objlinks = new LBR_LINKS();
                                    objlinks.LINK_TABID = Int32.Parse(dt_tabs.Rows[i]["TAB_ID"].ToString());
                                    objlinks.LINK_SIGNUPID = Int32.Parse(lbrid);
                                    // string content = loadhtml(objlinks);
                                    //if (content != string.Empty)
                                    //{
                                    tabcontent = "<div class=\"tab-pane fade active in\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\">" + loadhtml(objlinks) + "</div>";
                                    //}
                                    //else
                                    //{
                                    //    tabcontent = "<div class=\"tab-pane fade active in\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</div>";
                                    //}

                                    //    hid_tab.Value = dt_user.Rows[0]["lbr_id"].ToString() + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString();
                                    totalcontent = lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString();
                                }

                                else
                                {
                                    if ((i + 1) == dt_tabs.Rows.Count)
                                    {
                                        if (dt_atab.Rows.Count > 0)
                                        {
                                            innerhtml = innerhtml + "<li class=\"\"><a id=\"a_" + dt_atab.Rows[0]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_atab.Rows[0]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_atab.Rows[0]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_atab.Rows[0]["TAB_NAME"].ToString() + "\">" + dt_atab.Rows[0]["TAB_NAME"].ToString() + "</a></li>";
                                            tabcontent = tabcontent + "<div class=\"tab-pane fade\" id=\"tab" + dt_atab.Rows[0]["TAB_ID"].ToString() + "default\"></div>";
                                        }
                                    }
                                    else
                                    {
                                        innerhtml = innerhtml + "<li class=\"\"><a id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";
                                        tabcontent = tabcontent + "<div class=\"tab-pane fade\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\"></div>";
                                    }
                                }
                            }
                            else
                            {
                                if (i == 5)
                                {
                                    if (dt_atab.Rows.Count > 0)
                                    {
                                        innerhtml = innerhtml + "<li class=\"\"><a id=\"a_" + dt_atab.Rows[0]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_atab.Rows[0]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_atab.Rows[0]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_atab.Rows[0]["TAB_NAME"].ToString() + "\">" + dt_atab.Rows[0]["TAB_NAME"].ToString() + "</a></li>";
                                        tabcontent = tabcontent + "<div class=\"tab-pane fade\" id=\"tab" + dt_atab.Rows[0]["TAB_ID"].ToString() + "default\"></div>";
                                    }

                                }
                                remainingtabs = remainingtabs + "<li class=\"\"><a id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";
                                remainintabscontent = remainintabscontent + "<div class=\"tab-pane fade\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\"></div>";
                            }

                        }
                        remainingtabs = "<li class=\"dropdown\"  title=\"Click Here more Tabs\"><a href=\"#\" data-toggle=\"dropdown\" class=\"smalltab\"><i class=\"fa fa-chevron-down\"></i></a><ul id='div_remainingtabs' class=\"dropdown-menu dropdown__menu\" role=\"menu\">" + remainingtabs + "<li class=\"\"> <a href=\"#\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#mynewtab\">Create new tab</a></li></ul></li>";
                        remainintabscontent = remainintabscontent + "<div class=\"tab-pane fade\" id=\"tabnewdefault\">Newtab</div>";
                        totalcontent = totalcontent + "!@#" + innerhtml + remainingtabs + "!@#" + tabcontent + remainintabscontent + "<div class=\"clearfix\"></div>";

                    }
                    else
                    {
                        dt_tabs.Merge(dt_atab);
                        for (int i = 0; i < dt_tabs.Rows.Count; i++)
                        {
                            if (i <= 5)
                            {
                                if (i == 0)
                                {
                                    innerhtml = "<li class=\"active\"><a id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";

                                    LBR_LINKS objlinks = new LBR_LINKS();
                                    objlinks.LINK_TABID = Int32.Parse(dt_tabs.Rows[i]["TAB_ID"].ToString());
                                    objlinks.LINK_SIGNUPID = Int32.Parse(lbrid);
                                    // string content = loadhtml(objlinks);
                                    //if (content != string.Empty)
                                    //{
                                    tabcontent = "<div class=\"tab-pane fade active in\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\">" + loadhtml(objlinks) + "</div>";
                                    //}
                                    //else
                                    //{
                                    //    tabcontent = "<div class=\"tab-pane fade active in\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</div>";
                                    //}

                                    //    hid_tab.Value = dt_user.Rows[0]["lbr_id"].ToString() + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString();
                                    totalcontent = lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString();
                                }

                                else
                                {
                                    innerhtml = innerhtml + "<li class=\"\"><a id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";
                                    tabcontent = tabcontent + "<div class=\"tab-pane fade\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\"></div>";

                                }
                            }
                            else
                            {

                                remainingtabs = remainingtabs + "<li class=\"\"><a id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";
                                remainintabscontent = remainintabscontent + "<div class=\"tab-pane fade\" id=\"tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\"></div>";
                            }

                        }
                        remainingtabs = "<li class=\"dropdown\"  title=\"Click Here more Tabs\"><a href=\"#\" data-toggle=\"dropdown\" class=\"smalltab\"><i class=\"fa fa-chevron-down\"></i></a><ul id='div_remainingtabs' class=\"dropdown-menu dropdown__menu\" role=\"menu\">" + remainingtabs + "<li class=\"\"> <a href=\"#\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#mynewtab\">Create new tab</a></li></ul></li>";
                        remainintabscontent = remainintabscontent + "<div class=\"tab-pane fade\" id=\"tabnewdefault\">Newtab</div>";
                        totalcontent = totalcontent + "!@#" + innerhtml + remainingtabs + "!@#" + tabcontent + remainintabscontent + "<div class=\"clearfix\"></div>";

                    }
                    //tabs.InnerHtml = innerhtml + remainingtabs;
                    // div_tabcontent.InnerHtml = tabcontent + remainintabscontent + "<div class=\"clearfix\"></div>";
                }

            }
            catch (Exception ex)
            {

            }
            return totalcontent;
        }
Esempio n. 8
0
        public static string loadtabsstatic(string lbrid,string tabid)
        {
            LBR_SIGNUP obj = new LBR_SIGNUP();
            obj.LBR_ID = Int32.Parse(lbrid);
            //  DataSet dt_set = BLL.get_tabs(obj);
            DataTable dt_user = BLL.ExecuteQuery("select lbr_imageurl,lbr_firstname,lbr_lastname from lbr_signup where lbr_id="+ lbrid +"");
            string imageurl = dt_user.Rows[0]["LBR_imageurl"].ToString();
              string name = dt_user.Rows[0]["LBR_FIRSTNAME"].ToString();

                            if (dt_user.Rows[0]["LBR_LASTNAME"].ToString() != null && dt_user.Rows[0]["LBR_LASTNAME"].ToString()!="")
                            {
                                name = name + " " + dt_user.Rows[0]["LBR_LASTNAME"].ToString();
                            }
            DataTable dt_atab = BLL.get_tabs(obj);
            DataTable dt_tabs = BLL.ExecuteQuery("exec USP_LBR_SIGNUP @OPERATION='LOADANONYMOUSTAB', @LBR_ID='" + obj.LBR_ID + "'");
            dt_tabs.Merge(dt_atab);
            string innerhtml = "";
            string tabcontent = "";
            string remainingtabs = "";
            string remainintabscontent = "";
            int sharedcount = 0;
            int anonyshared = 0;
            //int k = 0;
            if (dt_tabs.Rows.Count > 0)
            {
                if (imageurl != null && imageurl != "")
                {
                    innerhtml = " <li class='nav-header'><div class='dropdown profile-element'><span><img  id='img_user' alt='profile pic' class='img-circle' src='" + imageurl + "' /></span><a href='#'><span class='clear'><span class='block m-t-xs'><strong  id='lbl_name' class='font-bold'>" + name + "</strong></span></span></a></div></li><li class='nav-header' style='padding-top: 0px !important;padding-bottom: 0px;padding-left: 0px;'><div class='dropdown profile-element' style='padding:13px 25px'><a data-toggle='modal' data-target='#mynewtab'><span class='clear'>Create a new tab</span></a></div></li>";
                }
                else
                {
                    innerhtml = " <li class='nav-header'><div class='dropdown profile-element'><span><img  id='img_user' alt='profile pic' class='img-circle' src='Images/Dummy.jpg' /></span><a href='#'><span class='clear'><span class='block m-t-xs'><strong  id='lbl_name' class='font-bold'>" + name + "</strong></span></span></a></div></li><li class='nav-header' style='padding-top: 0px !important;padding-bottom: 0px;padding-left: 0px;'><div class='dropdown profile-element' style='padding:13px 25px'><a data-toggle='modal' data-target='#mynewtab'><span class='clear'>Create a new tab</span></a></div></li>";
                }
                for (int i = 0; i < dt_tabs.Rows.Count; i++)
                {
                    sharedcount = 0;
                    anonyshared = 0;
                    sharedcount = Int32.Parse(dt_tabs.Rows[i]["sharedcount"].ToString());

                    if (sharedcount == 0)
                    {
                        if (dt_tabs.Rows[i]["TAB_ID"].ToString() == tabid)
                        {
                            innerhtml = innerhtml + "<li class='pull-left leftwidth active'><a title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\" id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href='#' onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" ><span class='nav-label block'>" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</span></a><ul></ul></li><li class='pull-left '> <a class='rightpadding'><span class='block m-t-xs'><b class='caret'></b></span><ul class='dropdown-menu animated fadeInRight m-t-xs'><li><a onclick=\"Sharetotaltableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Share</a></li><li><a  onclick=\"opentabnameleft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Rename</a></li><li><a onclick=\"deletetableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Delete</a></li></ul></a></li>";
                        }
                        else
                        {
                            // innerhtml = "<li class=\"active\"><a id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href=\"#tab" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "default\" onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" data-toggle=\"tab\"  title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\">" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</a></li>";
                            innerhtml = innerhtml + "<li class='pull-left leftwidth'><a title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\" id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href='#' onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" ><span class='nav-label block'>" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "</span></a><ul></ul></li><li class='pull-left '> <a class='rightpadding'><span class='block m-t-xs'><b class='caret'></b></span><ul class='dropdown-menu animated fadeInRight m-t-xs'><li><a onclick=\"Sharetotaltableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Share</a></li><li><a  onclick=\"opentabnameleft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Rename</a></li><li><a onclick=\"deletetableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Delete</a></li></ul></a></li>";
                        }
                    }
                    else
                    {
                        if (dt_tabs.Rows[i]["TAB_ID"].ToString() == tabid)
                        {
                            innerhtml = innerhtml + "<li class='pull-left leftwidth active'><a title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\" id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href='#'  onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" ><span class='nav-label block'>" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "<span class='label label-warning pull-right' id=\"lbn_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\">" + sharedcount + "</span></span></a><ul></ul></li><li class='pull-left '> <a class='rightpadding'><span class='block m-t-xs'><b class='caret'></b></span><ul class='dropdown-menu animated fadeInRight m-t-xs'><li><a onclick=\"Sharetotaltableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Share</a></li><li><a onclick=\"opentabnameleft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Rename</a></li><li><a onclick=\"deletetableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Delete</a></li></ul></a></li>";
                        }
                        else
                        {
                            innerhtml = innerhtml + "<li class='pull-left leftwidth'><a title=\"" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "\" id=\"a_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\" href='#'  onclick=\"selecttab('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "')\" ><span class='nav-label block'>" + dt_tabs.Rows[i]["TAB_NAME"].ToString() + "<span class='label label-warning pull-right' id=\"lbn_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "\">" + sharedcount + "</span></span></a><ul></ul></li><li class='pull-left '> <a class='rightpadding'><span class='block m-t-xs'><b class='caret'></b></span><ul class='dropdown-menu animated fadeInRight m-t-xs'><li><a onclick=\"Sharetotaltableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Share</a></li><li><a onclick=\"opentabnameleft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\">Rename</a></li><li><a onclick=\"deletetableft('" + lbrid + "_" + dt_tabs.Rows[i]["TAB_ID"].ToString() + "');\" >Delete</a></li></ul></a></li>";
                        }

                    }

                }

            }

            return innerhtml;
        }