/// <summary> /// 保存执行方法 /// </summary> private string PageSave() { EyouSoft.BLL.ComStructure.BComArea bll = new EyouSoft.BLL.ComStructure.BComArea(); EyouSoft.Model.ComStructure.MComArea model = new EyouSoft.Model.ComStructure.MComArea(); string areaName = Utils.GetFormValue(this.txtAreaName.UniqueID); string planerName = Utils.GetFormValue(SellsSelect1.SellsNameClient); string planerID = Utils.GetFormValue(SellsSelect1.SellsIDClient); string areatype = Utils.GetFormValue("selecttype"); if (string.IsNullOrEmpty(planerName.Trim())) { return(EyouSoft.Common.UtilsCommons.AjaxReturnJson("0", "请选择责任计调")); } model.AreaName = areaName; model.CompanyId = this.SiteUserInfo.CompanyId; model.IssueTime = DateTime.Now; model.OperatorId = this.SiteUserInfo.UserId; model.Type = (EyouSoft.Model.EnumType.ComStructure.AreaType)Utils.GetInt(areatype); //责任计调 MComAreaPlan plan = new MComAreaPlan(); if (planerName.Split(',').Length > 0) { for (int i = 0; i < planerName.Split(',').Length; i++) { plan.OperatorId = planerName.Split(',')[i].ToString(); } } else { plan.OperatorId = planerName; } IList <MComAreaPlan> planlist = new List <MComAreaPlan>(); planlist.Add(plan); model.Plan = planlist; string msg = string.Empty; int result = bll.Add(model); if (result > 0) { Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("id", result); dic.Add("type", model.Type); dic.Add("name", model.AreaName); msg = UtilsCommons.AjaxReturnJson("1", "新增成功", dic); } else { msg = UtilsCommons.AjaxReturnJson("0", "新增失败"); } return(msg); }
private IList <MComAreaPlan> GetPlanByXml(string xml) { if (string.IsNullOrEmpty(xml)) { return(null); } IList <MComAreaPlan> list = new List <MComAreaPlan>(); MComAreaPlan item = null; System.Xml.Linq.XElement xRoot = System.Xml.Linq.XElement.Parse(xml); var xRows = Utils.GetXElements(xRoot, "row"); foreach (var xRow in xRows) { item = new MComAreaPlan() { Planer = Utils.GetXAttributeValue(xRow, "Planer"), OperatorId = Utils.GetXAttributeValue(xRow, "PlanerId") }; list.Add(item); } return(list); }