Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataLogHistory.UpdateLogHistory(SessionManager.GetUserLogID(HttpContext.Current), System.DateTime.Now);

            Response.Cache.SetNoStore();
            Response.Redirect("VendorLogin.aspx");
        }
        public void MaintainLogHistory()
        {
            // LOG ALL THE ENTRIES OF THE USER
            DataLogHistory loghi = new DataLogHistory();

            loghi.LoginUserID    = Convert.ToInt32(SessionManager.GetUserID(HttpContext.Current));
            loghi.LoginInTime    = System.DateTime.Now;
            loghi.AccessActivity = 2; // Vendor Registion Page access
            int result = DataLogHistory.InsertLogHistory(loghi);
            // dont close the when page is not accessed.
            //SessionManager.AddToUserLogID(HttpContext.Current, result);
        }
Esempio n. 3
0
        public string IsValid(string UserID, string Password)
        {
            //DataTable dtUsers = objSQLServer.Fill_Datatable(objSQL.VendorConn, "LoginCredentials", new string[] { UserID, Password });
            //if (dtUsers.Rows.Count > 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}

            string Success    = "Success";
            string SuccessApp = "SuccessApp";

            string Fail = "Fail";
            Vendor obj  = Vendor.LoginCredentials(UserID, Password);

            if (obj != null)
            {
                HttpContext.Current.Session["VendorName"] = obj.VendorName;
                SessionManager.AddToUserSession(HttpContext.Current, obj.VendorName);
                SessionManager.AddToNavUserSession(HttpContext.Current, obj.NavUserName);
                SessionManager.AddToNavUserPasswordSession(HttpContext.Current, obj.NavPassword);
                SessionManager.AddToUserID(HttpContext.Current, obj.ID);
                SessionManager.AddTypeOfUser(HttpContext.Current, obj.UserType);

                // LOG ALL THE ENTRIES OF THE USER
                DataLogHistory loghi = new DataLogHistory();
                loghi.LoginUserID    = obj.ID;
                loghi.LoginInTime    = System.DateTime.Now;
                loghi.AccessActivity = 1;
                int result = DataLogHistory.InsertLogHistory(loghi);
                SessionManager.AddToUserLogID(HttpContext.Current, result);
                // MAIN USER LOG SUMMARY

                if (obj.AccountActivated == false)
                {
                    return(Fail);
                }
                else
                {
                    return(Success);
                }
            }
            else
            {
                return(Fail);
            }
        }
Esempio n. 4
0
        public static string LoginCredential(string Username, string Password)
        {
            try
            {
                string Success    = "Success";
                string SuccessApp = "SuccessApp";

                string Fail = "Fail";
                Vendor obj  = Vendor.LoginCredentials(Username, Password);
                if (obj != null)
                {
                    HttpContext.Current.Session["VendorName"] = obj.VendorName;
                    SessionManager.AddToUserSession(HttpContext.Current, obj.VendorName);
                    SessionManager.AddToNavUserSession(HttpContext.Current, obj.NavUserName);
                    SessionManager.AddToNavUserPasswordSession(HttpContext.Current, obj.NavPassword);
                    SessionManager.AddToUserID(HttpContext.Current, obj.ID);
                    SessionManager.AddTypeOfUser(HttpContext.Current, obj.UserType);

                    // LOG ALL THE ENTRIES OF THE USER
                    DataLogHistory loghi = new DataLogHistory();
                    loghi.LoginUserID    = obj.ID;
                    loghi.LoginInTime    = System.DateTime.Now;
                    loghi.AccessActivity = 1;
                    int result = DataLogHistory.InsertLogHistory(loghi);
                    SessionManager.AddToUserLogID(HttpContext.Current, result);
                    // MAIN USER LOG SUMMARY

                    if (obj.AccountActivated == false)
                    {
                        return(Fail);
                    }
                    else
                    {
                        return(Success);
                    }
                }
                else
                {
                    return(Fail);
                }
            }
            catch (Exception ex)
            {
                //throw ex;
                return(ex.Message);
            }
        }