public static string HtmlDropDownLiss_Ba_AreaID1(string val, string NameCn, SoftProjectAreaEntity item) { var str = HtmlHelpers.DropDownList(null, "Item.Ba_AreaID1", SoftProjectAreaEntityDomain.Ba_Area_AreaID1s, "Ba_AreaID", "AreaName", val, "", "", "form-control", " data-changeurl='/BaseInfoAreas/Ba_Area/GetSubBa_AreaIDs1s' data-textfield='AreaName' data-valuefield='Ba_AreaID' data-targetdom='#Item_Ba_AreaID2' "); return(str.ToString()); }
public static string QueryHtmlDropDownList_Ba_AreaID1(string val, string NameCn, SoftProjectAreaEntity item) { var str = HtmlHelpers.DropDownList(null, "Ba_AreaID1___equal", SoftProjectAreaEntityDomain.Ba_Area_AreaID1s, "Ba_AreaID", "AreaName", val, "", "==省(市)==", "form-control", " data-changeurl='/BaseInfoAreas/Ba_Area/GetSubBa_AreaIDs1s' data-textfield='AreaName' data-valuefield='Ba_AreaID' data-targetdom='#Ba_AreaID2___equal' data-optionlabel='市(区、县)' "); return(str.ToString()); }
public static string HtmlDropDownLiss_MG_MemberGradeID(string val, string NameCn, SoftProjectAreaEntity item) { //必须知道是公司、企业、顾客功能,从而进行过滤 var MG_MemberGradesTemp = MG_MemberGrades.Where(p => p.Pre_CompanyID == SoftProjectAreaEntityDomain.LoginInfostatic.CompanyID); var str = HtmlHelpers.DropDownList(null, "Item.MG_MemberGradeID", MG_MemberGradesTemp, "MG_MemberGradeID", "MemberGradeName", val, ""); return(str.ToString()); }
public static string HtmlDropDownLiss_Pre_RoleID(string val, string NameCn, SoftProjectAreaEntity item) { //必须知道是公司、企业、顾客功能,从而进行过滤 var Pre_RolesTemp = Pre_Roles.Where(p => p.LoginCategoryID == item.LoginCategoryID); var str = HtmlHelpers.DropDownList(null, "Item.Pre_RoleID", Pre_RolesTemp, "Pre_RoleID", "RoleName", val, ""); return(str.ToString()); }
public static string QueryHtmlDropDownList_MG_MemberGradeID(string val, string NameCn, SoftProjectAreaEntity item) { //var Pre_Roles = ProjectCache.Caches["MG_MemberGradeID"]; var MG_MemberGradesTemp = MG_MemberGrades.Where(p => p.Pre_CompanyID == SoftProjectAreaEntityDomain.LoginInfostatic.CompanyID); var str = HtmlHelpers.DropDownList(null, "MG_MemberGradeID___equal", MG_MemberGradesTemp, "MG_MemberGradeID", "MemberGradeName", val, "", "==" + NameCn + "=="); var strDrop = str.ToString(); return(strDrop); }
public static string QueryHtmlDropDownList_Pre_RoleID(string val, string NameCn, SoftProjectAreaEntity item) { //var Pre_Roles = ProjectCache.Caches["Pre_RoleID"]; var Pre_RolesTemp = Pre_Roles.Where(p => p.LoginCategoryID == item.LoginCategoryID); var str = HtmlHelpers.DropDownList(null, "Pre_RoleID___equal", Pre_RolesTemp, "Pre_RoleID", "RoleName", val, "", "==" + NameCn + "=="); var strDrop = str.ToString(); return(strDrop); }
private static void HtmlDropDownLisByTable(HtmlHelper helper, SoftProjectAreaEntity data, StringBuilder sbHtml, Type type, SoftProjectAreaEntity field, ref PropertyInfo property, ref object value, ref string val, string css = "") { #region 拉列表框 property = type.GetProperty(field.name); value = property.GetValue(data, null); if (value != null) { var strval = value.ToString(); val = strval; } var dict = field.name; if (!string.IsNullOrEmpty(field.Dicts)) { dict = field.Dicts; } if (ProjectCache.IsExistyCategory(dict)) { var str = HtmlHelpers.DropDownList(helper, field.name, ProjectCache.GetByCategory(dict), "DValue", "DText", val, css); sbHtml.AppendLine(str.ToString()); } else { if (ProjectCache.HtmlDropDownLiss.ContainsKey(field.name)) { var str = ProjectCache.HtmlDropDownLiss[field.name](val, field.NameCn, data); sbHtml.AppendLine(str.ToString()); } } //else if (field.name == "Pre_RoleID") //{ // var Pre_Roles = ProjectCache.Pre_Roles; // var str = HtmlHelpers.DropDownList(helper, "Item." + field.name, Pre_Roles, "Pre_RoleID", "RoleName", val, ""); // sbHtml.AppendLine(str.ToString()); //} //else if (field.name == "Comp_RoleID") //{ // var Comp_Roles = ProjectCache.Comp_Roles; // var str = HtmlHelpers.DropDownList(helper, "Item." + field.name, Comp_Roles, "Comp_RoleID", "CompRoleName", val, ""); // sbHtml.AppendLine(str.ToString()); //} #endregion }
public static string QueryHtmlDropDownList_Ba_AreaID3(string val, string NameCn, SoftProjectAreaEntity item) { #region Ba_AreaID3 if (!string.IsNullOrEmpty(val)) {//==市(区、县)== var Ba_AreaID = Convert.ToInt32(val); var str = HtmlHelpers.DropDownList(null, "Ba_AreaID3___equal", SoftProjectAreaEntityDomain.Ba_Area_GetBrotherBa_AreaIDss(Ba_AreaID), "Ba_AreaID", "AreaName", val, "", "==市(区、县)==", "form-control"); return(str.ToString()); } else {//<option value='' selected=''>==市(区、县)==</option> var str = string.Format("<select id='Ba_AreaID3___equal' name='Ba_AreaID3___equal' class='form-control' ><option value=''>==市(区、县)==</option></select>"); return(str.ToString()); } #endregion }
public static string QueryHtmlDropDownList_Ba_AreaID2(string val, string NameCn, SoftProjectAreaEntity item) { if (!string.IsNullOrEmpty(val)) {//data-optionlabel='市(区、县)' var Ba_AreaID = Convert.ToInt32(val); var str = HtmlHelpers.DropDownList(null, "Ba_AreaID2___equal", SoftProjectAreaEntityDomain.Ba_Area_GetBrotherBa_AreaIDss(Ba_AreaID), "Ba_AreaID", "AreaName", val, "", "==市(区、县)==", "form-control", " data-changeurl='/BaseInfoAreas/Ba_Area/GetSubBa_AreaIDs2s' data-textfield='AreaName' data-valuefield='Ba_AreaID' data-targetdom='#Ba_AreaID3___equal' data-optionlabel='市(区、县)' "); return(str.ToString()); } else { //var str = string.Format("<select id='Item_{0}' name='Item.{0}' class='form-control' data-changeurl='/BaseInfoAreas/Ba_Area/GetSubBa_AreaIDs2s' data-textfield='AreaName' data-valuefield='Ba_AreaID' data-targetdom='#Item_Ba_AreaID3' ><option value='' selected=''>==市(区、县)==</option></select>", field.QueryEn); var str = string.Format("<select id='Ba_AreaID2___equal' name='Ba_AreaID2___equal' class='form-control' data-changeurl='/BaseInfoAreas/Ba_Area/GetSubBa_AreaIDs2s' data-textfield='AreaName' data-valuefield='Ba_AreaID' data-targetdom='#Ba_AreaID3___equal' data-optionlabel='市(区、县)'><option value=''>==市(区、县)==</option></select>"); return(str.ToString()); } }
//public static MvcHtmlString Menu(this HtmlHelper helper, object obj)// MyResponseBase Model)// string ModularOrFunCode) //{ // var Items = new List<SoftProjectAreaEntity>(); // //var past = new List<SoftProjectAreaEntity>(); // var conts = helper.ViewContext.Controller as BaseController; // var CurrMenu = conts.CurrMenu; // Items = conts.Menu(); // var roots = Items.Where(p => p.ParentPremID == 0).OrderBy(p => p.Sort).ToList(); // if (conts.MenuIdent != "") // roots = Items; // roots = roots.OrderBy(p=>p.Sort).ToList(); // StringBuilder sb = new StringBuilder(); // foreach (var item in roots) // { // //如果有子节点 // var action = ""; // if (item.ActionPath == CurrMenu) // action = "active"; // var childs = Items.Where(p => item.Design_ModularOrFunID == p.ParentPremID).OrderBy(p => p.PremSort).ToList(); // if (childs.Count > 0) // { // sb.AppendLine("<li class=''>"); // sb.AppendLine(" <a href='#'>"); // sb.AppendLine(" <i class='glyphicon glyphicon-th-large'></i>"); // sb.AppendLine(string.Format(" <span>{0}</span>",item.ModularName)); // sb.AppendLine(" <b class='icon-angle-down'></b></a>"); // sb.AppendLine(" <ul style='display: none;' class='submenu'>"); // foreach (var item1 in childs) // { // action = ""; // if (item1.ActionPath == CurrMenu) // action = "active"; // #region 参数 // var strParam = ""; // if (item1.ParamName != null && item1.ParamName.Length > 0 && obj != null) // { // #region 对象数据类型 // Type type = obj.GetType(); // #endregion // var paramNames = item1.ParamName.Split(','); // foreach (var param in paramNames) // { // PropertyInfo property = type.GetProperty(param); // var value = property.GetValue(obj, null); // strParam += "item1." + param + "=" + value; // //var val=item1. // } // } // if (strParam.Length > 0) // strParam = "?" + strParam; // #endregion // var ActionPath = item1.ActionPath + strParam; // //sb.AppendLine(" <li>"); // //sb.AppendLine(" <a class='' href='/PurchaseOrderAreas/Pu_PurchaseOrder/WaitExamineIndex'>"); // //sb.AppendLine(" <span>待审核采购订单管理</span>"); // //sb.AppendLine(" </a>"); // //sb.AppendLine(" </li>"); // if (item1.BUrlNva == 1) // sb.AppendLine(string.Format("<li class='" + action + "'><a href='{0}'><span>{1}</span></a></li>", ActionPath, item1.ModularName)); // else // sb.AppendLine(string.Format("<li class='" + action + "'><a href='{0}'><span>{1}</span></a></li>", ActionPath, item1.MenuName)); // } // sb.AppendLine(" </ul>"); // sb.AppendLine(" </a>"); // sb.AppendLine("</li>"); // } // else // { // #region 参数 // var strParam = ""; // if (item.ParamName != null && item.ParamName.Length > 0 && obj != null) // { // #region 对象数据类型 // Type type = obj.GetType(); // #endregion // var paramNames = item.ParamName.Split(','); // foreach (var param in paramNames) // { // PropertyInfo property = type.GetProperty(param); // var value = property.GetValue(obj, null); // strParam += "Item." + param + "=" + value; // //var val=item. // } // } // if (strParam.Length > 0) // strParam = "?" + strParam; // #endregion // var ActionPath = item.ActionPath + strParam; // if (item.BUrlNva == 1) // sb.AppendLine(string.Format("<li class='" + action + "'><a href='{0}'><i class='glyphicon glyphicon-th-large'></i><span>{1}</span></a></li>", ActionPath, item.ModularName)); // else // sb.AppendLine(string.Format("<li class='" + action + "'><a href='{0}'><i class='glyphicon glyphicon-th-large'></i><span>{1}</span></a></li>", ActionPath, item.MenuName)); // } // } // // <li> // // <a href="/P_ProductAreas/P_Product/IndexTechnology"> // // <i class="glyphicon glyphicon-th-large"></i> // // <span>待完善商品描述</span> // // </a> // //</li> // MvcHtmlString mstr = new MvcHtmlString(sb.ToString()); // return mstr; //} #region 界面控件的辅助方法 /// <summary> /// 查询的下拉列表框:1015-7-5 /// </summary> /// <param name="helper"></param> /// <param name="Querys"></param> /// <param name="item"></param> /// <param name="strDrop"></param> /// <returns></returns> private static string QueryHtmlDropDownList(HtmlHelper helper, Querys Querys, SoftProjectAreaEntity data, SoftProjectAreaEntity item, string strDrop) { #region 拉列表框 var val = Querys.GetValue(item.name + "___equal"); var Dicts = item.name; if (!string.IsNullOrEmpty(item.Dicts)) { Dicts = item.Dicts; } if (ProjectCache.IsExistyCategory(Dicts)) { var str = HtmlHelpers.DropDownList(helper, item.name + "___equal", ProjectCache.GetByCategory(Dicts), "DValue", "DText", val, "", "==" + item.NameCn + "=="); strDrop = str.ToString(); } else { if (ProjectCache.QueryHtmlDropDownLists.ContainsKey(item.name)) { strDrop = ProjectCache.QueryHtmlDropDownLists[item.name](val, item.NameCn, data); } } //else if (item.name == "Pre_RoleID") //{ // var Pre_Roles = ProjectCache.Pre_Roles; // var str = HtmlHelpers.DropDownList(helper, item.name + "___equal", Pre_Roles, "Pre_RoleID", "RoleName", val, "", "==" + item.NameCn + "=="); // //var str = HtmlHelpers.DropDownList(helper, "Item." + Item.name, Pre_Roles, "Pre_RoleID", "RoleName", val, ""); // //sbHtml.AppendLine(str.ToString()); // strDrop = str.ToString(); //} //else if (item.name == "Comp_RoleID") //{ // var Pre_Roles = ProjectCache.Comp_Roles; // var str = HtmlHelpers.DropDownList(helper, item.name + "___equal", Pre_Roles, "Comp_RoleID", "CompRoleName", val, "", "==" + item.NameCn + "=="); // //var str = HtmlHelpers.DropDownList(helper, "Item." + Item.name, Pre_Roles, "Pre_RoleID", "RoleName", val, ""); // //sbHtml.AppendLine(str.ToString()); // strDrop = str.ToString(); //} #endregion return(strDrop); }
public static string HtmlDropDownLiss_Ba_AreaID3(string val, string NameCn, SoftProjectAreaEntity item) { #region Ba_AreaID3 if (!string.IsNullOrEmpty(val)) {//==市(区、县)== var Ba_AreaID = Convert.ToInt32(val); var str = HtmlHelpers.DropDownList(null, "Item.Ba_AreaID3", SoftProjectAreaEntityDomain.Ba_Area_GetBrotherBa_AreaIDss(Ba_AreaID), "Ba_AreaID", "AreaName", val, "", "", "form-control"); return(str.ToString()); } else {//<option value='' selected=''>==市(区、县)==</option> var str = string.Format("<select id='Item_Ba_AreaID3' name='Item.Ba_AreaID3' class='form-control' ></select>"); return(str.ToString()); } #endregion //必须知道是公司、企业、顾客功能,从而进行过滤 //var Pre_RolesTemp = Pre_Roles.Where(p => p.LoginCategoryID == item.LoginCategoryID); //var str = HtmlHelpers.DropDownList(null, "Item.Pre_RoleID", Pre_RolesTemp, "Pre_RoleID", "RoleName", val, ""); //return str.ToString(); //return ""; }