예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //regular
     sc = (CTdll.SessionContext)Session["SC"];
     if (!IsPostBack)
     {
         GetCityDetails();
         ipAddress = IpAddress();
         hostName  = Dns.GetHostName();
         Addvisitor();
     }
 }
예제 #2
0
 public void Autenticateuser()
 {
     try
     {
         // ds = cc.getLoginDetails(txtUserId.Text.ToString(), cc.DESEncrypt(txtPassword.Text.ToString()));
         CTdll.UserLogin ul = new CTdll.UserLogin();
         sc            = ul.getLoggedIn(txtUserId.Text.ToString(), cc.DESEncrypt(txtPassword.Text.ToString()), ConfigurationManager.AppSettings["ConnectionString"], "Login");
         Session["SC"] = sc;
         if (sc != null)
         {
             Session["User"] = Convert.ToString(sc.UserId);
             //Session["MobileNoN"] = Convert.ToString(ds.Tables[0].Rows[0]["MobileNo"]);
             Session["UserFirstNameN"] = Convert.ToString(sc.UserFName);
             Session["UserLastNameN"]  = Convert.ToString(sc.UserLName);
             Session["UserMiddleName"] = Convert.ToString(sc.UserMName);
             Session["CityNameN"]      = Convert.ToString(sc.CityName);
             Session["City"]           = Convert.ToString(sc.CityId);
             Session["Mobile"]         = Convert.ToString(sc.Mobile);
             Session["lastLogin"]      = Convert.ToString(sc.LastLogin);
             if (Convert.ToString(sc.UserId).Trim() == "")
             {
                 lblMsg.Text = "Invalid User";
                 ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User Name or Password is Incorrect ...Please try again')", true);
             }
             else
             {
                 Response.Redirect("html/UserInfo.aspx");
             }
         }
         else
         {
             lblMsg.Text = "Invalid User";
             ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User Name or Password is Incorrect ...Please try again')", true);
         }
     }
     catch (Exception ex)
     {
         string msg = ex.Message;
         lblMsg.Text = "Invalid User";
         ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User Name or Password is Incorrect...Please try again')", true);
     }
 }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        sc = (CTdll.SessionContext)Session["SC"];
        if (!IsPostBack)
        {
            try
            {
                ds = (DataSet)Session["Location"];
                if (ds == null)
                {
                    Location loc = new Location();
                    ds = loc.getAllLocation();
                    Session["Location"] = ds;
                }
                if (ds.Tables[0] != null)
                {
                    ddlState.DataSource     = ds.Tables[0];
                    ddlState.DataTextField  = "StateName";
                    ddlState.DataValueField = "StateId";
                    ddlState.DataBind();
                    ddlState.Items.Add("--Select--");
                    ddlState.Items[ddlState.Items.Count - 1].Value = " ";
                    ddlDistrict.Items.Add("--Select--");
                    ddlDistrict.Items[ddlDistrict.Items.Count - 1].Value = " ";
                    ddlCity.Items.Add("--Select--");
                    ddlCity.Items[ddlCity.Items.Count - 1].Value = " ";

                    ddlState.SelectedIndex = ddlState.Items.Count - 1;
                }
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
            }
        }
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        titleName.Text = "Myct In";
        sc             = (CTdll.SessionContext)Session["sc"];
        try
        {
            if (!IsPostBack)
            {
                try
                {
                    try
                    {
                        ds = (DataSet)Session["Location"];
                        if (ds == null)
                        {
                            Location loc = new Location();
                            ds = loc.getAllLocation();
                            Session["Location"] = ds;
                        }
                        if (ds.Tables[0] != null)
                        {
                            ddlState.DataSource     = ds.Tables[0];
                            ddlState.DataTextField  = "StateName";
                            ddlState.DataValueField = "StateId";
                            ddlState.DataBind();
                            ddlState.Items.Add("--Select--");
                            ddlState.Items[ddlState.Items.Count - 1].Value = " ";
                            ddlDistrict.Items.Add("--Select--");
                            ddlDistrict.Items[ddlDistrict.Items.Count - 1].Value = " ";
                            ddlCity.Items.Add("--Select--");
                            ddlCity.Items[ddlCity.Items.Count - 1].Value = " ";

                            ddlState.SelectedIndex = ddlState.Items.Count - 1;
                        }
                    }
                    catch (Exception ex)
                    {
                        string msg = ex.Message;
                    }
                    //string UserName = sc.UserId; //Convert.ToString(Session["User"]);
                    string UserName = Convert.ToString(Session["User"]);  /// Changes done by pooja
                    if (UserName != "")
                    {
                        //if (SessionContext.UserMobileNo != "")
                        //if (Convert.ToString(sc.Mobile) != "")
                        if (Convert.ToString(Session["Mobile"]) != "") ///Changes done by pooja
                        {
                            loggedin.Visible = true;
                            pnlMenu.Visible  = true;
                            pnlSMenu.Visible = false;
                            fnSetNewControls();
                        }
                        else
                        {
                            pnlMenu.Visible  = false;
                            pnlSMenu.Visible = true;
                            loggedin.Visible = false;
                        }
                    }
                    else
                    {
                        SessionContext.UserMobileNo   = "";
                        Session["Mobile"]             = "";
                        SessionContext.UserMiddleName = "";
                        Session["UserMiddleName"]     = "";
                        SessionContext.UserLastName   = "";
                        Session["UserLastNameN"]      = "";
                        SessionContext.UserFirstName  = "";
                        Session["UserFirstNameN"]     = "";
                        SessionContext.Password       = "";

                        pnlMenu.Visible  = false;
                        pnlSMenu.Visible = true;
                        sc.Mobile        = "";
                        sc.UserFName     = "";
                        sc.UserLName     = "";
                        sc.UserMName     = "";
                        Session["SC"]    = sc;
                    }
                }
                catch (Exception ex)
                {
                    SessionContext.UserMobileNo   = "";
                    Session["Mobile"]             = "";
                    SessionContext.UserMiddleName = "";
                    Session["UserMiddleName"]     = "";
                    SessionContext.UserLastName   = "";
                    Session["UserLastNameN"]      = "";
                    SessionContext.UserFirstName  = "";
                    Session["UserFirstNameN"]     = "";
                    SessionContext.Password       = "";
                    pnlMenu.Visible  = false;
                    pnlSMenu.Visible = true;
                    sc.Mobile        = "";
                    sc.UserFName     = "";
                    sc.UserLName     = "";
                    sc.UserMName     = "";
                    Session["SC"]    = sc;
                }

                //Test for CitySession

                try
                {
                    //string City = Convert.ToString(sc.CityId);
                    string City = Convert.ToString(Session["City"]); ///Chnges done by pooja
                    string Flag = Convert.ToString(Request.QueryString["Flag"]);
                    if (Flag != "1")
                    {
                        if (City == "")
                        {
                            SessionContext.CityId       = "";
                            Session["City"]             = "";
                            SessionContext.CityName     = "";
                            Session["CityNameN"]        = "";
                            SessionContext.DistrictId   = "";
                            SessionContext.DistrictName = "";
                            SessionContext.StateId      = "";
                            SessionContext.StateName    = "";
                            //Response.Redirect("../default.aspx");
                            sc.CityId     = "";
                            sc.CityName   = "";
                            Session["SC"] = sc;
                        }
                    }
                }
                catch (Exception ex)
                {
                    SessionContext.CityId       = "";
                    Session["City"]             = "";
                    SessionContext.CityName     = "";
                    Session["CityNameN"]        = "";
                    SessionContext.DistrictId   = "";
                    SessionContext.DistrictName = "";
                    SessionContext.StateId      = "";
                    SessionContext.StateName    = "";
                    // Response.Redirect("../default.aspx");
                    sc.CityId     = "";
                    sc.CityName   = "";
                    Session["SC"] = sc;
                }
            }
            ImageLoad();
        }
        catch (Exception ex)
        { }

        //smsactive.ServerClick += new EventHandler(fnSetNewControls_Click);
    }
예제 #5
0
 public void Autenticateuser()
 {
     try
     {
         // ds = cc.getLoginDetails(txtUserId.Text.ToString(), cc.DESEncrypt(txtPassword.Text.ToString()));
         CTdll.UserLogin ul = new CTdll.UserLogin();
         sc            = ul.getLoggedIn(txtUserId.Text.ToString(), cc.DESEncrypt(txtPassword.Text.ToString()), ConfigurationManager.AppSettings["ConnectionString"], "Login");
         Session["SC"] = sc;
         if (sc != null)
         {
             if (txtUserId.Text.Length == 10)
             {
                 Session["User"] = Convert.ToString(sc.UserId);
                 //Session["MobileNoN"] = Convert.ToString(ds.Tables[0].Rows[0]["MobileNo"]);
                 Session["UserFirstNameN"] = Convert.ToString(sc.UserFName);
                 Session["UserLastNameN"]  = Convert.ToString(sc.UserLName);
                 Session["UserMiddleName"] = Convert.ToString(sc.UserMName);
                 Session["CityNameN"]      = Convert.ToString(sc.CityName);
                 Session["City"]           = Convert.ToString(sc.CityId);
                 Session["Mobile"]         = Convert.ToString(sc.Mobile);
                 Session["lastLogin"]      = Convert.ToString(sc.LastLogin);
                 Session["MobileNo"]       = txtUserId.Text.ToString();
                 if (Convert.ToString(sc.UserId).Trim() == "")
                 {
                     lblMsg.Text = "Invalid User";
                     ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User Name or Password is Incorrect ...Please try again')", true);
                 }
                 else
                 {
                     string sql = "select id from [DBCome2myct].[come2mycity].[DemoOnline] where userid='" + sc.UserId + "'";
                     string id  = cc.ExecuteScalar(sql);
                     if (id == "" || id == null)
                     {
                         sql = "insert into [DBCome2myct].[come2mycity].[DemoOnline](userid,status)values('" + sc.UserId + "','Active')";
                         int a = cc.ExecuteNonQuery(sql);
                     }
                     else
                     {
                         sql = "update [DBCome2myct].[come2mycity].[DemoOnline] set status='Active' where userid='" + sc.UserId + "'";
                         int a = cc.ExecuteNonQuery(sql);
                     }
                     string hostipadd = HttpContext.Current.Request.UserHostAddress;
                     UserRegistrationBLL userRegBLL = new UserRegistrationBLL();
                     userRegBLL.usrUserId = Convert.ToString(Session["User"]);
                     //userRegBLL.IPAddress = hostipadd;
                     Response.Redirect("html/HomePage.aspx", false); ///changes done by pooja
                 }
             }
             else
             {
                 lblMsg.Text = "10 digit Mobile no";
                 ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('Please enter the 10 disit mobile No....!')", true);
             }
         }
         else
         {
             lblMsg.Text = "Invalid User";
             ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User Name or Password is Incorrect ...Please try again')", true);
         }
     }
     catch (Exception ex)
     {
         string msg = ex.Message;
         lblMsg.Text = "Invalid User";
         ScriptManager.RegisterStartupScript(this, typeof(Page), "msg", "alert('User Name or Password is Incorrect...Please try again')", true);
     }
 }