示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.HttpMethod.ToLower() == "post")
        {
            Service_CompanyModule.CompanyModuleClient cmBll = new Service_CompanyModule.CompanyModuleClient();
            cmBll.Delete(CompanyId);
            string[] moduleIdsArr = Request.Form["module"].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string item in moduleIdsArr)
            {
                cmBll.Edit(new CompanyModule()
                {
                    CompanyId         = CompanyId,
                    ModuleId          = Convert.ToInt32(item),
                    ValidityDateEnd   = DateTime.MaxValue,
                    ValidityDateStart = DateTime.Now.AddDays(-1)
                });
            }

            cmBll.Abort();
            cmBll.Close();
            Response.Redirect("SetCompanyModule.aspx");
        }
        else
        {
            Service_SystemModule.SystemModuleClient moduleBll = new Service_SystemModule.SystemModuleClient();
            __ModuleList = moduleBll.List();
            moduleBll.Abort();
            moduleBll.Close();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Service_SystemModule.SystemModuleClient bll = new Service_SystemModule.SystemModuleClient();
        switch (GetRequest.GetRequestValue("action"))
        {
        case "UpdateDefault":
            bll.SetDefault(GetRequest.GetInt32("id"), GetRequest.GetInt32("isDefault") == 1);
            bll.Abort();
            bll.Close();
            Success();
            break;

        case "UpdateType":
            bll.SetNeedCompany(GetRequest.GetInt32("id"), GetRequest.GetInt32("needCompany") == 1);
            bll.Abort();
            bll.Close();
            Success();
            break;

        default:
            list = bll.List();
            bll.Abort();
            bll.Close();
            break;
        }
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = GetRequest.GetInt32("id", Method.All, 0);

        Service_SystemModuleSetMealDetail.SystemModuleSetMealDetailClient bll = new Service_SystemModuleSetMealDetail.SystemModuleSetMealDetailClient();
        if (Request.HttpMethod.ToLower() == "post")
        {
            if (id > 0)
            {
                __Model = bll.Info(id);
            }
            else
            {
                __Model.SystemModuleSetMealId = GetRequest.GetInt32("SystemModuleSetMealId", Method.All, 0);
            }
            __Model.Day            = GetRequest.GetInt32("Day", Method.All, 0);
            __Model.SystemModuleId = GetRequest.GetInt32("Module", Method.All, 0);
            bll.Edit(__Model);
            Success();
        }
        else
        {
            if (id > 0)
            {
                __Model = bll.Info(id);
            }
            else
            {
                __Model.SystemModuleSetMealId = setMealId;
            }
            Service_SystemModule.SystemModuleClient moduleBll = new Service_SystemModule.SystemModuleClient();
            __ModuleList = moduleBll.List();
            Service_SystemModuleSetMealDetail.SystemModuleSetMealDetailClient setMealDetailBll = new Service_SystemModuleSetMealDetail.SystemModuleSetMealDetailClient();
            V_SystemModuleSetMealDetail[] setMealModuleList = setMealDetailBll.List(setMealId);
            string setMealModuleIds = ",";
            foreach (V_SystemModuleSetMealDetail item in setMealModuleList)
            {
                if (item.SystemModuleId == __Model.SystemModuleId)
                {
                    continue;
                }
                setMealModuleIds += item.SystemModuleId + ",";
            }
            __ModuleList = __ModuleList.Where(m => !setMealModuleIds.Contains("," + m.id + ",")).ToArray();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = GetRequest.GetInt32("id", Method.All, 0);

        if (Request.HttpMethod.ToLower() == "post")
        {
            Service_SystemModuleSetMeal.SystemModuleSetMealClient bll = new Service_SystemModuleSetMeal.SystemModuleSetMealClient();
            if (id > 0)
            {
                __SetMeal = bll.Info(id);
            }
            else
            {
                __SetMeal.AddDate = DateTime.Now;
            }
            __SetMeal.Enable = GetRequest.GetRequestValue("Enable", Method.Post) == "1";
            __SetMeal.Name   = GetRequest.GetRequestValue("Name", Method.Post);
            __SetMeal.Day    = GetRequest.GetInt32("Day", Method.Post, 0);
            __SetMeal.Price  = GetRequest.GetDecimal("Price", Method.Post, 0);
            bll.Edit(__SetMeal, GetRequest.GetRequestValue("Module"));
            Response.Write("ok");
            Response.End();
        }
        else
        {
            Service_SystemModule.SystemModuleClient moduleBll = new Service_SystemModule.SystemModuleClient();
            __ModuleList = moduleBll.List();
            if (id > 0)
            {
                Service_SystemModuleSetMeal.SystemModuleSetMealClient             setMealBll       = new Service_SystemModuleSetMeal.SystemModuleSetMealClient();
                Service_SystemModuleSetMealDetail.SystemModuleSetMealDetailClient setMealDetailBll = new Service_SystemModuleSetMealDetail.SystemModuleSetMealDetailClient();
                __SetMeal       = setMealBll.Info(id);
                __SetMealDetail = setMealDetailBll.List(id);
                foreach (V_SystemModuleSetMealDetail item in __SetMealDetail)
                {
                    __setMealIds += item.SystemModuleId + ",";
                }
                setMealBll.Abort();
                setMealBll.Close();
                setMealDetailBll.Abort();
                setMealDetailBll.Close();
            }
            moduleBll.Abort();
            moduleBll.Close();
        }
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        switch (GetRequest.GetRequestValue("action"))
        {
        case "HasNewMsg":
            NameValueCollection Pars = new NameValueCollection();
            Pars.Add("LoginUserId", LoginUserId.ToString());
            Response.Write(GetHTML("http://person.968ch.com/Message/HasNew", Pars, Method.Get));
            Response.End();
            return;

        default:
            break;
        }

        try
        {
            Service_CompanyFastModule.CompanyFastModuleClient fastModuleBll = new Service_CompanyFastModule.CompanyFastModuleClient();
            __FastModule = fastModuleBll.ListByUser(LoginCompanyId, LoginUserId).OrderBy(m => m.ModuleId).ToArray();
            fastModuleBll.Abort();
            fastModuleBll.Close();
            Service_OEMAgent.AgentServiceClient oemBll = new Service_OEMAgent.AgentServiceClient();
            __OEMInfo = oemBll.AgentGetByComId(LoginCompanyId);
            Service_SystemModule.SystemModuleClient systemModuleBll = new Service_SystemModule.SystemModuleClient();
            __AllList = systemModuleBll.ListByCompany(LoginCompanyId, "", LoginUserId).OrderBy(m => m.OrderBy).ToArray();
            systemModuleBll.Abort();
            systemModuleBll.Close();
            Service_Company.CompanyServiceClient companyBll = new Service_Company.CompanyServiceClient();
            __Company   = companyBll.GetCompany(LoginCompanyId);
            __IsCompany = companyBll.CompanyValid(LoginCompanyId);
            companyBll.Abort();
            companyBll.Close();
            Service_PublicUser.UserServiceClient puBll = new Service_PublicUser.UserServiceClient();
            __userInfo       = puBll.CompanyManageGet(LoginCompanyId, LoginUserId);
            __HasMoreCompany = puBll.CompanyManageListAll(LoginUserId).Length > 1;
            puBll.Abort();
            puBll.Close();
            if (__userInfo == null)
            {
                Response.Redirect("http://m.968ch.com/admin/login.aspx");
                return;
            }

            if (__AllList != null)
            {
                foreach (SystemModule item in __AllList)
                {
                    if (item.State == 3 ||//未购买
                        (__userInfo.RoleTypeId != 1 && __userInfo._UserPowerExLst.Where(m => m.ModuleId == item.id).ToArray().Length == 0)   //无操作权限
                        )
                    {
                        continue;
                    }

                    if (item.State == 0)
                    {
                        switch (item.Type)
                        {
                        case 1:
                            __OpenModule_1.Add(item);
                            break;

                        case 2:
                            __OpenModule_2.Add(item);
                            break;

                        case 3:
                            __OpenModule_3.Add(item);
                            break;

                        default:
                            break;
                        }
                    }
                    else if (__userInfo.RoleTypeId == 1)
                    {
                        switch (item.Type)
                        {
                        case 1:
                            __NotOpenModule_1.Add(item);
                            break;

                        case 2:
                            __NotOpenModule_2.Add(item);
                            break;

                        case 3:
                            __NotOpenModule_3.Add(item);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            oemBll.Abort();
            oemBll.Close();
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }