using System.Collections.Generic;
|
using Model;
|
|
using BLL;
|
using System.Text;
|
using System.Diagnostics;
|
using System.Runtime.CompilerServices;
|
using BLL.DAL;
|
using System.Data;
|
|
namespace Lib
|
{
|
public partial class LocalHelper
|
{
|
|
/// <summary>
|
/// 获得角色的下拉列表
|
/// </summary>
|
/// <param name="roleNum">角色编号</param>
|
/// <returns></returns>
|
public static string GetRoleList(string roleNum)
|
{
|
IDALRoles provider = new DALRoles();
|
IList<Roles> list = provider.GetList();
|
StringBuilder sb = new StringBuilder();
|
string roleTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(roleTemplate, "", "", "请选择角色");
|
if (list.Count>0)
|
{
|
foreach (Roles role in list)
|
{
|
sb.AppendFormat(roleTemplate, role.guid, role.guid == roleNum ? "selected='selected'" : string.Empty, role.RoleName);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获得部门的下拉列表
|
/// </summary>
|
/// <param name="departNum"></param>
|
/// <returns></returns>
|
public static string GetDepartList(string departNum)
|
{
|
IDALDepartMent provider = new DALDepartMent();
|
IList<DepartMent> list = provider.GetList();
|
StringBuilder sb = new StringBuilder();
|
string departTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(departTemplate, "", "", "请选择部门");
|
if (list.Count>0)
|
{
|
foreach (DepartMent depart in list)
|
{
|
sb.AppendFormat(departTemplate, depart.guid, depart.guid == departNum ? "selected='selected'" : string.Empty, depart.DepartName);
|
}
|
}
|
return sb.ToString();
|
}
|
|
|
/// <summary>
|
/// 获得父级菜单的下拉列表
|
/// </summary>
|
/// <param name="departNum"></param>
|
/// <returns></returns>
|
public static string GetResMenuList(string ResNum)
|
{
|
IDALResMenu provider = new DALResMenu();
|
IList<ResMenu> list = provider.GetParentList();
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "请选择父级菜单");
|
if (list.Count > 0)
|
{
|
foreach (ResMenu resMenu in list)
|
{
|
resMenu.ParentName = resMenu.ParentName.Replace(">", "");
|
resMenu.ParentName = resMenu.ParentName.Replace(" ", "");
|
sb.AppendFormat(resMenuTemplate, resMenu.ParentName, resMenu.ParentName == ResNum ? "selected='selected'" : string.Empty, resMenu.ParentName);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 取得父级菜单
|
/// </summary>
|
/// <param name="ResNum"></param>
|
/// <returns></returns>
|
public static string GetResMenuListTo(string ResNum)
|
{
|
DALResMenu provider = new DALResMenu();
|
IList<ResMenu> list = provider.GetParentList();
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "请选择父级菜单");
|
if (list.Count > 0)
|
{
|
foreach (ResMenu resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.ResNum, resMenu.ParentName == ResNum ? "selected='selected'" : string.Empty, resMenu.ParentName);
|
}
|
}
|
return sb.ToString();
|
}
|
|
public static string GetParentMenu(string RoleNum)
|
{
|
DALRoles dALRoles = new DALRoles();
|
IList<ResMenu> list = dALRoles.GetParentMenu(RoleNum);
|
StringBuilder sbStr = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}'>{1}</option>";
|
sbStr.AppendFormat(resMenuTemplate, "NULL", "请选择菜单");
|
if (list.Count > 0)
|
{
|
foreach (ResMenu resMenu in list)
|
{
|
sbStr.AppendFormat(resMenuTemplate, resMenu.ResNum , resMenu.ResName);
|
}
|
}
|
|
return sbStr.ToString();
|
}
|
|
/// <summary>
|
/// 获取存储条件
|
/// </summary>
|
/// <param name="StoreConditon"></param>
|
/// <returns></returns>
|
public static string GetStoreConditon(string ResNum)
|
{
|
List<string> stroeConditon = new List<string>
|
{
|
"普通",
|
"阴凉",
|
"冷冻"
|
};
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "请选择存储条件");
|
if (stroeConditon.Count > 0)
|
{
|
foreach (string resMenu in stroeConditon)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu, resMenu == ResNum ? "selected='selected'" : string.Empty, resMenu);
|
}
|
}
|
return sb.ToString();
|
}
|
/// <summary>
|
/// 获取计量单位列表
|
/// </summary>
|
/// <param name="StoreConditon"></param>
|
/// <returns></returns>
|
public static string GetUnitList(string UnitNum)
|
{
|
DALUnit provider = new DALUnit();
|
IList<Unit> list = provider.GetUnitList();
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (list.Count > 0)
|
{
|
foreach (Unit resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.Guid, resMenu.Guid == UnitNum ? "selected='selected'" : string.Empty, resMenu.UnitNum + "-" + resMenu.UnitName);
|
}
|
}
|
return sb.ToString();
|
}
|
/// <summary>
|
/// 获得物料轻重
|
/// </summary>
|
/// <param name="MatWeightType"></param>
|
/// <returns></returns>
|
public static string GetMatWeightType(string ResNum)
|
{
|
List<string> stroeConditon = new List<string>
|
{
|
"一般",
|
"重",
|
"轻"
|
};
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "请选择物料轻重");
|
if (stroeConditon.Count > 0)
|
{
|
foreach (string resMenu in stroeConditon)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu, resMenu == ResNum ? "selected='selected'" : string.Empty, resMenu);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获得物料频率
|
/// </summary>
|
/// <param name="UseFreq"></param>
|
/// <returns></returns>
|
public static string GetUseFreq(string ResNum)
|
{
|
List<string> stroeConditon = new List<string>
|
{
|
"一般",
|
"快",
|
"慢"
|
};
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "请选择物料使用频率");
|
if (stroeConditon.Count > 0)
|
{
|
foreach (string resMenu in stroeConditon)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu, resMenu == ResNum ? "selected='selected'" : string.Empty, resMenu);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获得审核列表
|
/// </summary>
|
/// <param name="Audit"></param>
|
/// <returns></returns>
|
public static string GetAuditList(string ResNum)
|
{
|
List<string> stroeConditon = new List<string>
|
{
|
"未审核",
|
"已审核",
|
"已拒绝",
|
};
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "请选择审核结果");
|
if (stroeConditon.Count > 0)
|
{
|
foreach (string resMenu in stroeConditon)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu, resMenu == ResNum ? "selected='selected'" : string.Empty, resMenu);
|
}
|
}
|
return sb.ToString();
|
}
|
/// <summary>
|
///获取托盘
|
/// </summary>
|
public static string GetPalnoList(string Addre,string Palno)
|
{
|
DALErpIn addre = new DALErpIn();
|
IList<ErpMat> list = addre.GetList(Addre);
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "请选择");
|
if (list.Count > 0)
|
{
|
foreach (ErpMat resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.Palno, resMenu.Palno == Palno ? "selected='selected'" : string.Empty, resMenu.Palno);
|
}
|
}
|
return sb.ToString();
|
}
|
/// <summary>
|
/// 获得库排列表
|
/// </summary>
|
/// <param name="Pai"></param>
|
/// <returns></returns>
|
public static string GetPaiList(string Pai)
|
{
|
IDALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsPos> list = provider.GetPaiList(Pai);
|
|
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "库排");
|
if (list.Count > 0)
|
{
|
foreach (GoodsPos resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.pai, resMenu.pai == Pai ? "selected='selected'" : string.Empty, resMenu.pai);
|
}
|
}
|
return sb.ToString();
|
}
|
|
public static string GetPLCList(string value,string Name,string StorageAraeNo)
|
{
|
try
|
{
|
IDALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsPos> list = new List<GoodsPos>();
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "库排");
|
|
switch (Name)
|
{
|
case "Pai":
|
list= provider.GetPaiList(StorageAraeNo);
|
if (list.Count > 0)
|
{
|
foreach (GoodsPos resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.pai, resMenu.pai == value ? "selected='selected'" : string.Empty, resMenu.pai);
|
}
|
}
|
break;
|
case "Lie":
|
list = provider.GetLieList(StorageAraeNo);
|
if (list.Count > 0)
|
{
|
foreach (GoodsPos resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.pai, resMenu.lie == value ? "selected='selected'" : string.Empty, resMenu.lie);
|
}
|
}
|
break;
|
case "Ceng":
|
list = provider.GetCengList(StorageAraeNo);
|
if (list.Count > 0)
|
{
|
foreach (GoodsPos resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.pai, resMenu.ceng == value ? "selected='selected'" : string.Empty, resMenu.ceng);
|
}
|
}
|
break;
|
default:
|
break;
|
}
|
|
return sb.ToString();
|
}
|
catch (System.Exception)
|
{
|
|
throw;
|
}
|
}
|
|
|
/// <summary>
|
/// 获得库列列表
|
/// </summary>
|
/// <param name="Lie"></param>
|
/// <returns></returns>
|
public static string GetlieList(string Lie)
|
{
|
IDALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsPos> list = provider.GetLieList(Lie);
|
|
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "库列");
|
if (list.Count > 0)
|
{
|
foreach (GoodsPos resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.lie, resMenu.lie == Lie ? "selected='selected'" : string.Empty, resMenu.lie);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获得库层列表
|
/// </summary>
|
/// <param name="Ceng"></param>
|
/// <returns></returns>
|
public static string GetCengList(string Ceng)
|
{
|
IDALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsPos> list = provider.GetCengList(Ceng);
|
|
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "库层");
|
if (list.Count > 0)
|
{
|
foreach (GoodsPos resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.ceng, resMenu.ceng == Ceng ? "selected='selected'" : string.Empty, resMenu.ceng);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获得状态列表
|
/// </summary>
|
/// <param name="Statu"></param>
|
/// <returns></returns>
|
public static string GetStatuList(string StatuNo)
|
{
|
IDALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsStatu> list = provider.GetStatuList();
|
|
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (list.Count > 0)
|
{
|
foreach (GoodsStatu resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.StatuNo, resMenu.StatuNo == StatuNo ? "selected='selected'" : string.Empty, resMenu.StatuName);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获得入库单状态列表
|
/// </summary>
|
/// <param name="Statu"></param>
|
/// <returns></returns>
|
public static string GetErpStatuList(string StatuName)
|
{
|
DALErpIn provider = new DALErpIn();
|
IList<ErpStatu> list = provider.GetErpStatuList();
|
|
|
//stroeConditon.Add("普通");
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (list.Count > 0)
|
{
|
foreach (ErpStatu resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.StatuNo, resMenu.StatuName == StatuName ? "selected='selected'" : string.Empty, resMenu.StatuName);
|
}
|
}
|
return sb.ToString();
|
}
|
/// <summary>
|
/// 获得属性列表
|
/// </summary>
|
/// <param name="Property"></param>
|
/// <returns></returns>
|
public static string GetPropertyList(string PropertyNO)
|
{
|
IDALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsProperty> list = provider.GetPropertyList();
|
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (list.Count > 0)
|
{
|
foreach (GoodsProperty resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.PropertyNo, resMenu.PropertyNo == PropertyNO ? "selected='selected'" : string.Empty, resMenu.PropertyName);
|
}
|
}
|
return sb.ToString();
|
}
|
/// <summary>
|
/// 获得锁定列表
|
/// </summary>
|
/// <param name="Alock"></param>
|
/// <returns></returns>
|
public static string GetALockList(string LockNo)
|
{
|
IDALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsALock> list = provider.GetALockList();
|
|
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (list.Count > 0)
|
{
|
foreach (GoodsALock resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.AlockNo, resMenu.AlockNo == LockNo ? "selected='selected'" : string.Empty, resMenu.AlockName);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获得库区列表
|
/// </summary>
|
/// <param name="Area"></param>
|
/// <returns></returns>
|
public static string GetAreaList(string AreaNo)
|
{
|
IDALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsArea> list = provider.GetAreaList();
|
|
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (list.Count > 0)
|
{
|
foreach (GoodsArea resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.AreaNo, resMenu.AreaNo == AreaNo ? "selected='selected'" : string.Empty, resMenu.AreaName);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获取库位列表
|
/// </summary>
|
/// <returns></returns>
|
public static string GetAddreList(string AreaNo,string addreNo)
|
{
|
DALGoodsPos provider = new DALGoodsPos();
|
IList<GoodsPos> list = provider.GetAddreList(AreaNo);
|
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (list.Count > 0)
|
{
|
foreach (GoodsPos resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.Addre, resMenu.Addre == addreNo ? "selected='selected'" : string.Empty, resMenu.Addre);
|
}
|
}
|
return sb.ToString();
|
}
|
|
/// <summary>
|
/// 获得订单类型
|
/// </summary>
|
/// <param name="GetOrdTypeList"></param>
|
/// <returns></returns>
|
public static string GetOrdTypeList(string OrdTypeName)
|
{
|
IDALOrdType provider = new DALOrdType();
|
IList<OrdType> list = provider.GetList();
|
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (list.Count > 0)
|
{
|
foreach (OrdType resMenu in list)
|
{
|
sb.AppendFormat(resMenuTemplate, resMenu.OrdTypeName, resMenu.OrdTypeName == OrdTypeName ? "selected='selected'" : string.Empty, resMenu.OrdTypeName);
|
}
|
}
|
return sb.ToString();
|
}
|
/// <summary>
|
/// 获取空托盘类型
|
/// </summary>
|
/// <param name="TypeName"></param>
|
/// <param name="Code"></param>
|
/// <returns></returns>
|
public static string PalletStore(string TypeName, string Code = "")
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
sb.AppendFormat(resMenuTemplate, "A", "", "有护栏");
|
sb.AppendFormat(resMenuTemplate, "B", "", "无护栏");
|
//DALDepotsLocation dAL = new DALDepotsLocation();
|
//DataTable dt = dAL.GetDictionaryItems();
|
//foreach (DataRow row in dt.Select("topCode = '" + TypeName + "'"))
|
//{
|
// sb.AppendFormat(resMenuTemplate, row["Code"].ToString(), row["Code"].ToString() == Code ? "selected='selected'" :
|
// string.Empty, row["TypeName"].ToString());
|
//}
|
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
#region AutoWMS 公共方法
|
/// <summary>
|
/// 获取区域下拉框
|
/// </summary>
|
/// <param name="RegionId">默认值</param>
|
/// <returns></returns>
|
public static string GetRegionItemsHtml(string RegionId = "")
|
{
|
try
|
{
|
DALRegion dalRegion = new DALRegion();
|
IList<Region> regions = dalRegion.GetRegionItems();
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (regions.Count > 0)
|
{
|
foreach (Region region in regions)
|
{
|
sb.AppendFormat(resMenuTemplate, region.Guid, region.Guid == RegionId ? "selected='selected'" :
|
string.Empty, (region.RegionCode+"-"+region.RegionName));
|
}
|
}
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 获取数据字典下拉框
|
/// </summary>
|
/// <param name="TypeName">数据类型</param>
|
/// <param name="Code">默认选中项编码</param>
|
/// <returns></returns>
|
public static string GetDictionaryHtml(string TypeName,string Code = "")
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
DALDepotsLocation dAL = new DALDepotsLocation();
|
DataTable dt = dAL.GetDictionaryItems();
|
foreach (DataRow row in dt.Select("topCode = '" + TypeName + "'"))
|
{
|
//sb.AppendFormat(resMenuTemplate, row["guid"].ToString(), row["guid"].ToString() == Code ? "selected='selected'" :
|
// string.Empty, row["code"].ToString()+"-"+row["TypeName"].ToString());
|
sb.AppendFormat(resMenuTemplate, row["guid"].ToString(), row["guid"].ToString() == Code ? "selected='selected'" :
|
string.Empty, row["TypeName"].ToString());
|
}
|
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 获取数据字典下拉框主键code
|
/// </summary>
|
/// <param name="TypeName"></param>
|
/// <param name="Code"></param>
|
/// <returns></returns>
|
public static string GetDictionaryCodeHtml(string TypeName, string Code = "")
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
DALDepotsLocation dAL = new DALDepotsLocation();
|
DataTable dt = dAL.GetDictionaryItems();
|
foreach (DataRow row in dt.Select("topCode = '" + TypeName + "'"))
|
{
|
// 只有出库会有03等待回库操作
|
if (Code != "-03" && row["code"].ToString() == "04")
|
{
|
continue;
|
}
|
sb.AppendFormat(resMenuTemplate, row["Code"].ToString(), row["Code"].ToString() == Code ? "selected='selected'" :
|
string.Empty, row["TypeName"].ToString());
|
}
|
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 获取是否自动
|
/// </summary>
|
/// <param name="TypeName"></param>
|
/// <param name="Code"></param>
|
/// <returns></returns>
|
public static string GetIsAuto(string TypeName, string Code = "")
|
{
|
try
|
{
|
var fh = "";
|
//StringBuilder sb = new StringBuilder();
|
//string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
//sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
DALDepotsLocation dAL = new DALDepotsLocation();
|
DataTable dt = dAL.GetDictionaryItems();
|
foreach (DataRow row in dt.Select("topCode = '" + TypeName + "'"))
|
{
|
// 只有出库会有03等待回库操作
|
if (Code == "-03" && row["code"].ToString() == "03")
|
{
|
continue;
|
}
|
|
//sb.AppendFormat(resMenuTemplate, row["Code"].ToString(), row["Code"].ToString() == Code ? "selected='selected'" :
|
//string.Empty, row["TypeName"].ToString());
|
fh = row["Code"].ToString();
|
}
|
|
return fh;
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 获取用户下拉
|
/// </summary>
|
/// <param name="TypeName"></param>
|
/// <param name="Code"></param>
|
/// <returns></returns>
|
public static string GetUserHtml(string Code = "")
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
DAL_OperationRecord dAL = new DAL_OperationRecord();
|
DataTable dt = dAL.GetUserItems();
|
foreach (DataRow row in dt.Rows)
|
{
|
sb.AppendFormat(resMenuTemplate, row["UserCode"].ToString(), row["UserCode"].ToString() == Code ? "selected='selected'" :
|
string.Empty, row["UserCode"].ToString());
|
}
|
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
public static string GetCertificateHtml()
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
sb.AppendFormat(resMenuTemplate, "有", "", "有");
|
sb.AppendFormat(resMenuTemplate, "无", "", "无");
|
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 获取数据类别
|
/// </summary>
|
/// <param name="Code"></param>
|
/// <returns></returns>
|
public static string GetDictionarysHtml(string Code = "")
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
DALDictionary dAL = new DALDictionary();
|
DataTable dt = dAL.GetDictionarys();
|
foreach (DataRow row in dt.Rows)
|
{
|
sb.AppendFormat(resMenuTemplate, row["Code"].ToString(), row["Code"].ToString() == Code ? "selected='selected'" :
|
string.Empty, row["TypeName"].ToString());
|
}
|
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 获取库区下拉框
|
/// </summary>
|
/// <param name="Guid"></param>
|
/// <returns></returns>
|
public static string GetDepotsAreaHtml(string Guid = "")
|
{
|
try
|
{
|
DALDepotsArea dalDepotsArea = new DALDepotsArea();
|
IList<DepotsArea> depotsAreas = dalDepotsArea.GetDepotsAreaItems("",Guid);
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
if (depotsAreas.Count > 0)
|
{
|
foreach (DepotsArea depotsArea in depotsAreas)
|
{
|
sb.AppendFormat(resMenuTemplate, depotsArea.Guid, depotsArea.Guid == Guid ? "selected='selected'" :
|
string.Empty, (depotsArea.DepotsCode + "-" + depotsArea.DepotsName));
|
}
|
}
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 获取库区排、列、层数
|
/// </summary>
|
/// <param name="Type"></param>
|
/// <param name="Guid">库区ID</param>
|
/// <param name="Num"></param>
|
/// <returns></returns>
|
public static string GetDepotsNumHtml(string Type, string Guid = "",int vlue = 0)
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
|
if (Guid == "")
|
{
|
switch (Type)
|
{
|
case "DepotsRow":
|
for (int i = 1; i <= 10; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i, "", i);
|
}
|
; break;
|
case "DepotsColumn":
|
for (int i = 1; i <= 10; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i, "", i);
|
}
|
; break;
|
case "DepotsLayer":
|
for (int i = 1; i <= 10; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i, "", i);
|
}
|
; break;
|
default: break;
|
}
|
}
|
else
|
{
|
DALDepotsArea dalDepotsArea = new DALDepotsArea();
|
IList<DepotsArea> depotsAreas = dalDepotsArea.GetDepotsAreaItems(Guid);
|
|
if (depotsAreas.Count > 0)
|
{
|
foreach (DepotsArea depotsArea in depotsAreas)
|
{
|
switch (Type)
|
{
|
case "DepotsRow":
|
for (int i = 1; i <= depotsArea.DepotsRow; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i,
|
i == vlue ? "selected='selected'" :string.Empty, i);
|
}
|
; break;
|
case "DepotsColumn":
|
for (int i = 1; i <= depotsArea.DepotsColumn; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i,
|
i == vlue ? "selected='selected'" : string.Empty, i);
|
}
|
; break;
|
case "DepotsLayer":
|
for (int i = 1; i <= depotsArea.DepotsLayer; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i,
|
i == vlue ? "selected='selected'" : string.Empty, i);
|
}
|
; break;
|
default: break;
|
}
|
}
|
}
|
}
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
/// <summary>
|
/// 获取库区排、列、层数
|
/// </summary>
|
/// <param name="Type"></param>
|
/// <param name="Guid">库区ID</param>
|
/// <param name="Num"></param>
|
/// <returns></returns>
|
public static string GetDepotsNumHtml2(string Type, int vlue = 0)
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
|
DALDepotsArea dalDepotsArea = new DALDepotsArea();
|
IList<DepotsArea> depotsAreas = dalDepotsArea.GetDepotsAreaItems();
|
|
if (depotsAreas.Count > 0)
|
{
|
foreach (DepotsArea depotsArea in depotsAreas)
|
{
|
switch (Type)
|
{
|
case "DepotsRow":
|
for (int i = 1; i <= depotsArea.DepotsRow; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i,
|
i == vlue ? "selected='selected'" : string.Empty, i);
|
}
|
; break;
|
case "DepotsColumn":
|
for (int i = 1; i <= depotsArea.DepotsColumn; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i,
|
i == vlue ? "selected='selected'" : string.Empty, i);
|
}
|
; break;
|
case "DepotsLayer":
|
for (int i = 1; i <= depotsArea.DepotsLayer; i++)
|
{
|
sb.AppendFormat(resMenuTemplate, i,
|
i == vlue ? "selected='selected'" : string.Empty, i);
|
}
|
; break;
|
default: break;
|
}
|
}
|
}
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
/// <summary>
|
/// 获取物料品牌
|
/// </summary>
|
/// <param name="Guid"></param>
|
/// <returns></returns>
|
public static string GetBrandItemsHtml(string Guid = "",string bdName ="")
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
DALBrand dAL = new DALBrand();
|
IList<Brand> list = dAL.GetBrandList(bdName);
|
|
if (list.Count > 0)
|
{
|
foreach (Brand bdmodel in list)
|
{
|
sb.AppendFormat(resMenuTemplate, bdmodel.Guid, bdmodel.Guid == Guid ? "selected='selected'" :
|
string.Empty, bdmodel.BrandCode + "-" + bdmodel.BrandName);
|
}
|
}
|
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
public static string GetUserIsDelHtml()
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
|
sb.AppendFormat(resMenuTemplate, "-1", "selected = 'selected'", "选择");
|
sb.AppendFormat(resMenuTemplate, "0", "", "启用");
|
sb.AppendFormat(resMenuTemplate, "1", "", "停用");
|
return sb.ToString();
|
}
|
|
public static string GetMatIsDelHtml()
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "-1", "selected = 'selected'", "选择");
|
sb.AppendFormat(resMenuTemplate, "0", "", "在用");
|
sb.AppendFormat(resMenuTemplate, "1", "", "删除");
|
return sb.ToString();
|
}
|
|
public static string GetPaiHtml()
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "1", "", "第一排");
|
sb.AppendFormat(resMenuTemplate, "2", "", "第二排");
|
return sb.ToString();
|
}
|
|
public static string GetCmdIsDelHtml()
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
sb.AppendFormat(resMenuTemplate, "0", "selected = 'selected'", "未完成");
|
sb.AppendFormat(resMenuTemplate, "1", "", "已完成");
|
|
return sb.ToString();
|
}
|
|
public static string GetOrdNoTypeHtml()
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
|
sb.AppendFormat(resMenuTemplate, "OUT", "selected = 'selected'", "出库单");
|
sb.AppendFormat(resMenuTemplate, "IN", "", "入库单");
|
|
return sb.ToString();
|
}
|
#endregion
|
|
public static string GetDjHtml(string type = "")
|
{
|
try
|
{
|
StringBuilder sb = new StringBuilder();
|
string resMenuTemplate = "<option value='{0}' {1}>{2}</option>";
|
sb.AppendFormat(resMenuTemplate, "", "", "选择");
|
|
var list = new List<DicOption>();
|
list.Add(new DicOption()
|
{
|
Val = "R01",
|
Text = "跺机1"
|
});
|
list.Add(new DicOption()
|
{
|
Val = "R02",
|
Text = "跺机2"
|
});
|
|
foreach (var row in list)
|
{
|
sb.AppendFormat(resMenuTemplate, row.Val, row.Val == type ? "selected='selected'" :
|
string.Empty, row.Text);
|
}
|
|
return sb.ToString();
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
}
|
}
|