Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["QuotationId"] != null && Request["QuotationId"] != string.Empty)
            {
                quotationId = Convert.ToInt32(Request["QuotationId"]);
            }
            if (Request["InvoiceId"] != null && Request["InvoiceId"] != string.Empty)
            {
                invoiceId = Convert.ToInt32(Request["InvoiceId"]);
            }

            if (Session["AdminId"] == null || Session["AdminId"].ToString() == string.Empty)
            {
                Response.Redirect("LoginWithGoogle.aspx");
            }
            if (Session["AccessRole"] != null || Session["AccessRole"].ToString() != "")
            {
                accessRole = (OC.Role)Session["AccessRole"];

                if (accessRole == OC.Role.SUPER_USER ||
                    accessRole == OC.Role.SALES_TL ||
                    accessRole == OC.Role.SALES ||
                    accessRole == OC.Role.ACCOUNTS_MANAGER ||
                    accessRole == OC.Role.ACCOUNTS ||
                    accessRole == OC.Role.IT_SOFTWARE ||
                    accessRole == OC.Role.IT_SOFTWARE_TL)
                {
                }
                else
                {
                    myPage = System.IO.Path.GetFileName(Request.Url.AbsolutePath);
                    Response.Redirect("UnauthorizedUser.aspx?Page=" + myPage);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AdminId"] == null || Convert.ToInt16(Session["AdminId"]) == 0)
            {
                Response.Redirect("/LoginWithGoogle.aspx?msg=your session has been expired please login again");
            }
            else
            {
                adminId = Convert.ToInt32(Session["AdminId"]);
            }
            if (Session["AccessRole"] != null || Session["AccessRole"].ToString() != "")
            {
                accessRole = (OC.Role)Session["AccessRole"];

                //if (accessRole == BlueKite.UserDefinedClasses.Role.SUPER_USER ||
                //     accessRole == BlueKite.UserDefinedClasses.Role.HR)
                //{

                //}
                //else
                //{
                //    currentPage = System.IO.Path.GetFileName(Request.Url.AbsolutePath);
                //    Response.Redirect("UnauthorizedUser.aspx?Page=" + currentPage);
                //}
            }
        }
Пример #3
0
        private OC.Role GetRole(string roleString)
        {
            OC.Role role = OC.Role.UNKNOWN;
            switch (roleString.Replace(" ", "").ToUpper())
            {
            case "SUPERUSER":
                role = OC.Role.SUPER_USER;
                break;

            case "UNKNOWN":
                role = OC.Role.UNKNOWN;
                break;

            case "SALESTL":
                role = OC.Role.SALES_TL;
                break;

            case "SALES":
                role = OC.Role.SALES;
                break;

            case "ACCOUNTSMANAGER":
                role = OC.Role.ACCOUNTS_MANAGER;
                break;

            case "ACCOUNTS":
                role = OC.Role.ACCOUNTS;
                break;

            case "CRMTL":
                role = OC.Role.CRM_TL;
                break;

            case "CRM":
                role = OC.Role.CRM;
                break;

            case "IT&S":
                role = OC.Role.IT_SOFTWARE;
                break;

            case "ITMANAGER":
                role = OC.Role.IT_SOFTWARE_TL;
                break;

            case "HR":
                role = OC.Role.HR;
                break;
            }
            return(role);
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AdminId"] == null || Session["AdminId"].ToString() == string.Empty)
            {
                Response.Redirect("LoginWithGoogle.aspx");
            }
            else
            {
                AdminId = Convert.ToInt32(Session["AdminId"]);
            }
            if (Session["AccessRole"] != null || Session["AccessRole"].ToString() != "")
            {
                accessRole = (OC.Role)Session["AccessRole"];

                if (accessRole == OC.Role.SUPER_USER ||
                    accessRole == OC.Role.SALES_TL ||
                    accessRole == OC.Role.SALES ||
                    accessRole == OC.Role.IT_SOFTWARE ||
                    accessRole == OC.Role.IT_SOFTWARE_TL)
                {
                }
                else
                {
                    myPage = System.IO.Path.GetFileName(Request.Url.AbsolutePath);
                    Response.Redirect("UnauthorizedUser.aspx?Page=" + myPage);
                }
            }
            if (Request["QuotationId"] != null && Request["QuotationId"] != string.Empty)
            {
                quotationId = Convert.ToInt32(Request["QuotationId"]);
            }
            if (Request["BillMode"] != null && Request["BillMode"] != string.Empty)
            {
                isPostPaid = Convert.ToByte(Request["BillMode"]);
            }
            if (Request["ID"] != null && Request["ID"] != string.Empty)
            {
                accountId = Convert.ToDecimal(Request["ID"]);
            }
            if (Request["productId"] != null && Request["productId"] != string.Empty)
            {
                productId = Convert.ToByte(Request["productId"]);
            }
            if (Request["address"] != null && Request["address"] != string.Empty)
            {
                address = Request["address"];
            }
            if (Request["contactName"] != null && Request["contactName"] != string.Empty)
            {
                contactName = Request["contactName"];
            }
            if (Request["country"] != null && Request["country"] != string.Empty)
            {
                country = Request["country"];
            }
            if (Request["registeredDate"] != null && Request["registeredDate"] != string.Empty)
            {
                registeredDate = Request["registeredDate"];
            }
            if (Request["company"] != null && Request["company"] != string.Empty)
            {
                companyName = Request["company"];
            }
            if (Request["email"] != null && Request["email"] != string.Empty)
            {
                email = Request["email"];
            }
            if (Request["mobile"] != null && Request["mobile"] != string.Empty)
            {
                mobile = Request["mobile"];
            }
            if (Request["state"] != null && Request["state"] != string.Empty)
            {
                stateId = Request["state"];
            }

            if (!String.IsNullOrEmpty(Request["AccountproductId"]))
            {
                AccountProductId = Convert.ToInt64(Request["AccountproductId"]);
            }
            if (!String.IsNullOrEmpty(Request["QuotationType"]))
            {
                QuotationType = Convert.ToString(Request["QuotationType"]);
            }
            if (!String.IsNullOrEmpty(Request["isFirstTime"]))
            {
                isFirstTime = Convert.ToString(Request["isFirstTime"]);
            }
            if (!String.IsNullOrEmpty(Request["gstin"]))
            {
                gstin = Convert.ToString(Request["gstin"]);
            }
            if (!String.IsNullOrEmpty(Request["AccountOwner"]))
            {
                AccountOwnerEmail = Convert.ToString(Request["AccountOwner"]);
            }
        }