using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Core.Mes.Client.Comm.Server;
using CoreFS.CA06;
using Core.Mes.Client.Comm.Control;
using Infragistics.Win.UltraWinEditors;
namespace Core.StlMes.Client.Mcp.Common
{
class McpBaseHelper
{
///
/// 获取产线
///
/// 数据权限
///
/// 字符串数组
public static string[] GetPCodePline(string arr, OpeBase ob)
{
string[] arr1 = null;
DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.McpBaseHelper.GetPCode", new Object[] { arr }, ob);
if (dt != null && dt.Rows.Count > 0)
{
arr1 = new string[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
arr1[i] = dt.Rows[i][0].ToString();
}
return arr1;
}
else
{
return new string[1] { "" };
}
}
///
/// 获取工艺文件路径
///
///
///
///
public static string GetGyUrl(string arr, OpeBase ob)
{
string path = "";
DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getCraftPathById", new object[] { arr }, ob);
if (dt.Rows.Count > 0)
{
path = dt.Rows[0]["CRAFT_PATH"].ToString();
FormFileDown down = new FormFileDown(ob, path);
down.CtrlFileDown1.Button3.Visible = false;
down.ShowDialog();
}
else { }
return path;
}
///
/// 获取Mps文件路径
///
///
///
///
public static string GetMpsUrl(string arr, OpeBase ob)
{
string path = "";
DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getCraftPathById", new object[] { arr }, ob);
if (dt.Rows.Count > 0)
{
path = dt.Rows[0]["CRAFT_PATH"].ToString();
FormFileDown down = new FormFileDown(ob, path);
down.CtrlFileDown1.Button3.Visible = false;
down.ShowDialog();
}
else { }
return path;
}
///
/// 产线
///
///
///
public static void InitPlineUnit(UltraComboEditor uce, string[] plinCode, OpeBase ob,string gx)
{
if (plinCode.Length == 0)
{
uce.DataSource = null;
return;
}
DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryPlineCode", new object[] { plinCode, gx }, ob);
uce.DataSource = dt;
uce.DisplayMember = "PLINE_NAME";
uce.ValueMember = "PLINE_CODE";
//uce.SelectedIndex = 0;
}
///
/// 仓库数据权限
///
/// 页面配制信息(自定义参数)
/// 用户数据权限
/// 可查看仓库组成的字符串
public static string[] WarehousePermissions(String customInfo, String[] validDataPurviewIds, OpeBase ob)
{
string storageType = "";//仓库类别
string storageAttr = "";//仓库类型
if (customInfo.Length >= 0 && customInfo.Contains(","))
{
string[] strflg = customInfo.ToString().Split(new char[] { ',' });
storageType = strflg[0];
storageAttr = strflg[1];
}
DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.common.WarehousePermissions.getWarehousePermissions", new object[] { storageType, storageAttr, validDataPurviewIds }, ob);
if (dt != null && dt.Rows.Count > 0)
{
string[] storages = new string[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
storages[i] = dt.Rows[i]["STORAGE_NO"].ToString();
}
return storages;
}
else
{
return new string[1] { "" };
}
}
}
}