/// <summary> /// 保存 /// </summary> /// <returns></returns> private string PageSave() { string msg = string.Empty; //获得保存内容的类型 EyouSoft.Model.EnumType.ComStructure.ContainProjectType containProjectType = (EyouSoft.Model.EnumType.ComStructure.ContainProjectType)Utils.GetInt(Utils.GetQueryStringValue("proType")); EyouSoft.Model.EnumType.ComStructure.ProjectType projectType = Utils.GetQueryStringValue("type") == "" ? EyouSoft.Model.EnumType.ComStructure.ProjectType.包含项目 : (EyouSoft.Model.EnumType.ComStructure.ProjectType)Utils.GetInt(Utils.GetQueryStringValue("type")); string txtNewInfo = Utils.GetFormValue("txtNewInfo"); if (txtNewInfo.Trim() == "") { msg = UtilsCommons.AjaxReturnJson("0", "保存内容不能为空!"); return(msg); } EyouSoft.BLL.ComStructure.BComProject bll = new EyouSoft.BLL.ComStructure.BComProject(); EyouSoft.Model.ComStructure.MComProject model = new EyouSoft.Model.ComStructure.MComProject(); model.CompanyId = SiteUserInfo.CompanyId; model.Content = txtNewInfo; model.IssueTime = DateTime.Now; model.ItemType = containProjectType; model.OperatorId = SiteUserInfo.UserId; model.Type = projectType; if (bll.Add(model)) { msg = UtilsCommons.AjaxReturnJson("1", "保存成功!"); } else { msg = UtilsCommons.AjaxReturnJson("0", "保存失败!"); } return(msg); }
/// <summary> /// 生成带option的计调项目 /// </summary> /// <param name="selectValue"></param> /// <returns></returns> protected string GetOptionByPlanProject(string selectValue) { StringBuilder sb = new StringBuilder(); IList <EnumObj> list = EnumObj.GetList(typeof(EyouSoft.Model.EnumType.ComStructure.ContainProjectType)); if (list != null) { for (int i = 0; i < list.Count; i++) { EyouSoft.Model.EnumType.ComStructure.ContainProjectType model = (EyouSoft.Model.EnumType.ComStructure.ContainProjectType)Utils.GetInt(list[i].Value); //if (model == EyouSoft.Model.EnumType.ComStructure.ContainProjectType.用车 || model == EyouSoft.Model.EnumType.ComStructure.ContainProjectType.导服) //{ // sb.AppendFormat("<option {0} value='" + list[i].Value + "|2'>" + list[i].Text + "</option>", list[i].Value == selectValue ? "selected=selected" : ""); //} //else if (model == EyouSoft.Model.EnumType.ComStructure.ContainProjectType.其它) //{ // sb.AppendFormat("<option {0} value='" + list[i].Value + "|1'>" + list[i].Text + "</option>", list[i].Value == selectValue ? "selected=selected" : ""); //} //else //{ // sb.AppendFormat("<option {0} value='" + list[i].Value + "|0'>" + list[i].Text + "</option>", list[i].Value == selectValue ? "selected=selected" : ""); //} sb.AppendFormat("<option {0} value='" + list[i].Value + "|2'>" + list[i].Text + "</option>", list[i].Value == selectValue ? "selected=selected" : ""); } } return(sb.ToString()); }
/// <summary> /// 获得小类型枚举 /// </summary> /// <returns></returns> public EyouSoft.Model.EnumType.ComStructure.ContainProjectType GetContainProjectType() { EyouSoft.Model.EnumType.ComStructure.ContainProjectType ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.大交通; switch (ItemType) { case "1": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.大交通; break; case "2": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.用车; break; case "3": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.房; break; case "4": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.餐; break; case "5": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.导服; break; case "6": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.景点; break; case "7": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.保险; break; case "8": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.小交通; break; case "9": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.综费; break; case "10": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.其它; break; case "11": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.国内段; break; case "12": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.签证; break; case "13": ContainProjectType = EyouSoft.Model.EnumType.ComStructure.ContainProjectType.游船; break; } return(ContainProjectType); }
/// <summary> /// 页面初始化 /// </summary> protected void PageInit() { ReturnTitle(); EyouSoft.Model.EnumType.ComStructure.ProjectType ProjectType = GetProjectType(); EyouSoft.Model.EnumType.ComStructure.ContainProjectType ContainProjectType = GetContainProjectType(); IList <EyouSoft.Model.ComStructure.MComProject> list = null; if (string.IsNullOrEmpty(ItemType)) { list = new EyouSoft.BLL.ComStructure.BComProject().GetList(ProjectType, null, SiteUserInfo.CompanyId); } else { list = new EyouSoft.BLL.ComStructure.BComProject().GetList(ProjectType, ContainProjectType, SiteUserInfo.CompanyId); } this.repList.DataSource = list; this.repList.DataBind(); }