예제 #1
0
        protected void AddAuditInformation()
        {
            Int16 moduleNo = 0;

            Enums.ModuleConstant masterPage = Enums.ModuleConstant.HouseKeeping;
            if (SessionStore.ContainsKey(Params.SYS_SELECT_MODULE))                                 //if (Session["LoadSelectedModule"] != null)
            {
                masterPage = (Enums.ModuleConstant)SessionStore.GetValue(Params.SYS_SELECT_MODULE); //Session["LoadSelectedModule"].ToString();
            }

            switch (masterPage)
            {
            case Enums.ModuleConstant.AccountsService:
                moduleNo = 1;
                break;

            case Enums.ModuleConstant.GeneralLedger:
                moduleNo = 2;
                break;

            case Enums.ModuleConstant.HouseKeeping:
                moduleNo = 2;
                break;

            case Enums.ModuleConstant.Booth:
                moduleNo = 3;
                break;
            //case Enums.ModuleConstant.HumanResource:
            //    moduleNo = 3;
            //    break;
            //case Enums.ModuleConstant.Inventory:
            //    moduleNo = 4;
            //    break;

            //case Enums.ModuleConstant.OffBooth:
            //    moduleNo = 7;
            //    break;
            default:
                moduleNo = 1;
                break;
            }

            var dto = new A2ZAUDITDTO();

            dto.UserId         = Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_ID));
            dto.EmpCode        = Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_EMP_CODE));
            dto.UserIP         = Converter.GetString(SessionStore.GetValue(Params.SYS_USER_IP));
            dto.UserServerIP   = Converter.GetString(SessionStore.GetValue(Params.SYS_USER_SERVER_IP));
            dto.UserServerName = Converter.GetString(SessionStore.GetValue(Params.SYS_USER_SERVER_NAME));

            //dto.AudRecordNo = 1;
            //dto.ModuleNo = moduleNo;
            //dto.AudRemarks = "Log In";
            //dto.AudProcessDate = DateTime.Now.Date;
            //dto.AudOldDate = DateTime.Now.Date;
            //dto.AudNewDate = DateTime.Now.Date;

            //A2ZAUDITDTO.InsertAuditInformation(dto);
        }
예제 #2
0
        protected void Page_PreInit(object sender, EventArgs e)
        {
            //Put default value from enum
            Enums.ModuleConstant masterPage = Enums.ModuleConstant.HouseKeeping;
            if (SessionStore.ContainsKey(Params.SYS_SELECT_MODULE))                                 //if (Session["LoadSelectedModule"] != null)
            {
                masterPage = (Enums.ModuleConstant)SessionStore.GetValue(Params.SYS_SELECT_MODULE); //Session["LoadSelectedModule"].ToString();
            }
            switch (masterPage)
            {
            case Enums.ModuleConstant.AccountsService:
                this.Page.MasterPageFile = "~/MasterPages/CustomerServicesMenuMasterPage.Master";
                break;

            case Enums.ModuleConstant.GeneralLedger:
                this.Page.MasterPageFile = "~/MasterPages/GLMenuMasterPage.Master";
                break;

            case Enums.ModuleConstant.HouseKeeping:
                this.Page.MasterPageFile = "~/MasterPages/HKMenuMasterPage.Master";
                break;

            case Enums.ModuleConstant.HumanResource:
                this.Page.MasterPageFile = "~/MasterPages/HRMenuMasterPage.Master";
                break;

            case Enums.ModuleConstant.Inventory:
                this.Page.MasterPageFile = "~/MasterPages/INVMenuMasterPage.Master";
                break;

            case Enums.ModuleConstant.Booth:
                this.Page.MasterPageFile = "~/MasterPages/BoothMenuMasterPage.Master";
                break;

            case Enums.ModuleConstant.OffBooth:
                this.Page.MasterPageFile = "~/MasterPages/OffBoothMenuMasterPage.Master";
                break;

            default:
                Response.Redirect("A2ZERP.aspx");
                break;
            }
        }
예제 #3
0
        /* © 2013 AtoZ Computer Services */
        //Oni: September 22, 2013
        /// <summary>
        /// Thsi page is Log Out page.
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            Application.Lock();

            if (Application["HitCount"] != null)
            {
                Application["HitCount"] = (int)Application["HitCount"] - 1;
                Application.UnLock();
            }
            else
            {
                Application["HitCount"] = 1;
            }
            Application.UnLock();

            try
            {
                //Put default value from enum
                Enums.ModuleConstant masterPage = Enums.ModuleConstant.HouseKeeping;
                if (SessionStore.ContainsKey(Params.SYS_SELECT_MODULE))                                 //if (Session["LoadSelectedModule"] != null)
                {
                    masterPage = (Enums.ModuleConstant)SessionStore.GetValue(Params.SYS_SELECT_MODULE); //Session["LoadSelectedModule"].ToString();
                }
                switch (masterPage)
                {
                case Enums.ModuleConstant.AccountsService:
                    //AddAuditInformation(1);
                    A2ZSYSIDSDTO.UpdateUserCSLoginFlag(Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_ID)), 0);
                    Session["LogOutFlag"] = "1";
                    ClearSession();    //Session.Abandon();
                    Response.Redirect("A2ZERP.aspx", false);
                    break;

                //case Enums.ModuleConstant.GeneralLedger:
                //    //AddAuditInformation(2);
                //    A2ZSYSIDSDTO.UpdateUserGLLoginFlag(Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_ID)), 0);
                //    Session["LogOutFlag"] = "1";
                //    ClearSession();//Session.Abandon();
                //    Response.Redirect("A2ZERP.aspx", false);
                //    break;
                case Enums.ModuleConstant.HouseKeeping:
                    //AddAuditInformation(3);
                    A2ZSYSIDSDTO.UpdateUserHKLoginFlag(Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_ID)), 0);
                    Session["LogOutFlag"] = "1";
                    ClearSession();    //Session.Abandon();
                    Response.Redirect("A2ZERP.aspx", false);
                    break;
                    //case Enums.ModuleConstant.Booth:
                    //    //AddAuditInformation(3);
                    //    A2ZSYSIDSDTO.UpdateUserBTLoginFlag(Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_ID)), 0);
                    //    Session["LogOutFlag"] = "1";
                    //    ClearSession();//Session.Abandon();
                    //    Response.Redirect("A2ZERP.aspx", false);
                    //    break;
                    //case Enums.ModuleConstant.OffBooth:
                    //    AddAuditInformation(3);
                    //    A2ZSYSIDSDTO.UpdateUserOBTLoginFlag(Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_ID)), 0);
                    //    Session["LogOutFlag"] = "1";
                    //    ClearSession();//Session.Abandon();
                    //    Response.Redirect("A2ZERP.aspx", false);
                    //    break;
                    //case Enums.ModuleConstant.HumanResource:
                    //    //AddAuditInformation(4);
                    //    A2ZSYSIDSDTO.UpdateUserHRLoginFlag(Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_ID)), 0);
                    //    Session["LogOutFlag"] = "1";
                    //    ClearSession();//Session.Abandon();
                    //    Response.Redirect("A2ZERP.aspx", false);
                    //    break;
                    //case Enums.ModuleConstant.Inventory:
                    //    AddAuditInformation(5);
                    //    A2ZSYSIDSDTO.UpdateUserLoginFlag(Converter.GetInteger(SessionStore.GetValue(Params.SYS_USER_ID)), 0);
                    //    ClearSession();//Session.Abandon();
                    //    Response.Redirect("A2ZERP.aspx", false);
                    //    break;
                }
            }
            catch (Exception ex)
            {
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Err.Load Problem');</script>");
                ClearSession();
                //throw ex;
            }
        }