Example #1
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            site    = new Site_Supplier();
            backurl = RequestTool.RequestString("url").Replace("<", "").Replace(">", "");
            if (backurl.ToLower().IndexOf("http") > -1 || backurl.ToLower().IndexOf("login.aspx") > -1 || backurl == "")
            {
                backurl = site.AdminPath + "/default.aspx?desk=1";
            }
            path      = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a>" + Tag("É̼Ò×¢²á") + "</a>";
            verifieds = B_Lebi_Supplier_Verified.GetList("", "Sort desc");
            logintype = RequestTool.RequestString("logintype", "");

            List <Lebi_Supplier> suppliers = B_Lebi_Supplier.GetList("User_id=" + CurrentUser.id + "", "id desc");

            if (logintype == "" && suppliers.Count > 0)
            {
                supplier = suppliers.FirstOrDefault();
                Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(supplier.Supplier_Group_id);
                logintype = group.type;
            }
            else
            {
                foreach (Lebi_Supplier sup in suppliers)
                {
                    Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(sup.Supplier_Group_id);
                    if (logintype == group.type)
                    {
                        supplier = sup;
                    }
                }
            }
            logintype = logintype == "" ? "supplier" : logintype;
            if (supplier == null)
            {
                supplier             = new Lebi_Supplier();
                supplier.Address     = CurrentUser.Address;
                supplier.Area_id     = CurrentUser.Area_id;
                supplier.Fax         = CurrentUser.Fax;
                supplier.Email       = CurrentUser.Email;
                supplier.MobilePhone = CurrentUser.MobilePhone;
                supplier.Msn         = CurrentUser.Msn;
                supplier.Phone       = CurrentUser.Phone;
                supplier.Postalcode  = CurrentUser.Postalcode;
                supplier.QQ          = CurrentUser.QQ;
                supplier.RealName    = CurrentUser.RealName;
                supplier.UserName    = CurrentUser.UserName;
                supplier.User_id     = CurrentUser.id;
                status = Tag("ÐÂ×¢²á");
            }
            else
            {
                if (supplier.Type_id_SupplierStatus == 442)
                {
                    Response.Redirect(site.AdminPath + "/login.aspx");
                }
                status = TypeName(supplier.Type_id_SupplierStatus);
            }
        }
Example #2
0
        public SupplierBase()
        {
            site            = new Site_Supplier();
            CurrentLanguage = Language.CurrentLanguage();

            DefaultCurrency = B_Lebi_Currency.GetModel("IsDefault=1");
            if (DefaultCurrency == null)
            {
                DefaultCurrency = B_Lebi_Currency.GetList("", "Sort desc").FirstOrDefault();
            }

            CurrentCurrency = DefaultCurrency;
            site            = new Site_Supplier();

            langs   = Language.Languages();
            reqPage = RequestTool.GetRequestUrl().ToLower();
        }