| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- 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
- {
- /// <summary>
- /// 获取产线
- /// </summary>
- /// <param name="validDataPurviewIds">数据权限</param>
- /// <param name="Ob"></param>
- /// <returns>字符串数组</returns>
- 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] { "" };
- }
- }
- /// <summary>
- /// 获取工艺文件路径
- /// </summary>
- /// <param name="arr"></param>
- /// <param name="Ob"></param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 获取Mps文件路径
- /// </summary>
- /// <param name="arr"></param>
- /// <param name="Ob"></param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 产线
- /// </summary>
- /// <param name="uce"></param>
- /// <param name="jurisdictions"></param>
- 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;
- }
- /// <summary>
- /// 仓库数据权限
- /// </summary>
- /// <param name="customInfo">页面配制信息(自定义参数)</param>
- /// <param name="validDataPurviewIds">用户数据权限</param>
- /// <returns>可查看仓库组成的字符串</returns>
- 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] { "" };
- }
- }
- }
- }
|