Esempio n. 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;
        }
    }
Esempio n. 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();
        }
    }