public CustomApply Edit(CustomApply model) { DALBase <CustomApply, DataContext> bll = new DALBase <CustomApply, DataContext>(); if (model.id == 0) { model = bll.AddReturnModel(model); } else { bll.AddOrUpdate(model); } return(model); }
protected void Page_Load(object sender, EventArgs e) { switch (GetRequest.GetString("Action", Method.All, "")) { case "apply": try { Service_CustomApply.CustomApplyClient customBll = new Service_CustomApply.CustomApplyClient(); CustomApply customInfo = new CustomApply() { CompanyId = LoginCompanyId, Remark = GetRequest.GetRequestValue("Remark", Method.Post), UserName = GetRequest.GetRequestValue("Name", Method.Post), Tel = GetRequest.GetRequestValue("Tel", Method.Post), State = 0, AddDate = DateTime.Now }; customBll.Edit(customInfo); Response.Write("ok"); } catch (Exception ex) { Response.Write(ex.ToString()); } Response.End(); break; default: Service_CompanyModule.CompanyModuleClient cmBll = new Service_CompanyModule.CompanyModuleClient(); __ModuleList = cmBll.List(LoginCompanyId); __ModuleList = cmBll.ListByDomain("968xxkj"); foreach (V_CompanyModule item in __ModuleList) { __ModuleIds += item.ModuleId + ","; } cmBll.Abort(); cmBll.Close(); Service_CompanyFastModule.CompanyFastModuleClient cfmBll = new Service_CompanyFastModule.CompanyFastModuleClient(); __FastModuleList = cfmBll.List(LoginCompanyId); cfmBll.Abort(); cfmBll.Close(); break; } }