public HCSWF_procedure_manual(string in_pdcode, string in_setcode, CnasHCSWorkflowInterface indata) { PD_Code = in_pdcode; Set_Code = in_setcode; SortedList stdata01 = new SortedList(); CnasRemotCall reCnasRemotCall = new CnasRemotCall(); SortedList sttemp01 = new SortedList(); sttemp01.Add(1, in_pdcode); DtmanualData = reCnasRemotCall.RemotInterface.SelectData("HCS-proceduremanual-sec01", sttemp01); if (DtmanualData == null) { this.Close(); } else { Rec_data = 0; for (int i = 0; i < DtmanualData.Rows.Count; i++) { //if (DtmanualData.Rows[i]["manual_type"] != null && DtmanualData.Rows[i]["manual_type"].ToString().Equals("2")) //{ stdata01.Add("BCXP90000000" + DtmanualData.Rows[i]["manual_id"].ToString(), DtmanualData.Rows[i]["manual_name"].ToString()); //} } } InitializeComponent(); Icon = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO)); CnasHCSWorkflowInterface01 = indata; if (stdata01.Count > 0) { AutoImage(stdata01); } }
public HttpResponseMessage CheckScanCode(dynamic content) { HttpResponseMessage result = null; try { string sessionKey = Convert.ToString(content.SessionKey); HttpSessionState session = HttpContext.Current.Application[sessionKey] as HttpSessionState; CnasHCSWorkflowInterface wfLogic = WFHelper.Instance.GetWFLogic(session); string barCode = Convert.ToString(content.BarCode); Dictionary <string, string> condition = JsonHelper.GetJsonObject <Dictionary <string, string> >(content.ScanCodes.ToString()); Dictionary <string, dynamic> resultData = new Dictionary <string, dynamic>(); SortedList checkResult = null; if (!string.IsNullOrEmpty(barCode)) { checkResult = wfLogic.CheckBusinessLogic(barCode, condition); resultData.Add("Result", checkResult); } else { resultData.Add("ResultMessage", "无法验证当前条码,重新扫描"); } result = Request.CreateResponse <Dictionary <string, dynamic> >(HttpStatusCode.OK, resultData); return(result); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ex)); } }
/// <summary> /// /// </summary> /// <param name="grid"></param> public HCSSM_send_new_order_create(SortedList orderList, CnasHCSWorkflowInterface cnasHCSWorkflowInterface01) { InitializeComponent(); SetDicData(); _cnasHCSWorkflowInterface01 = cnasHCSWorkflowInterface01; SendOrderNum = GetSendOrderNum(); if (orderList != null && orderList.Count > 0) { for (int i = 0; i < orderList.Count; i++) { object rowObj = orderList.GetByIndex(i); if (rowObj != null && rowObj is SortedList) { SortedList tempRow = (SortedList)rowObj; if (tempRow.Count == 8) { int index = dgv_orderBcu.Rows.Add(); string codeType = Convert.ToString(tempRow[1]); string c_codeType = Convert.ToString(tempRow[2]); dgv_orderBcu.Rows[index].Cells["bid"].Value = index + 1; dgv_orderBcu.Rows[index].Cells["codeType"].Value = codeType; dgv_orderBcu.Rows[index].Cells["c_codeType"].Value = c_codeType; dgv_orderBcu.Rows[index].Cells["t_b_bar_code"].Value = tempRow[3]; dgv_orderBcu.Rows[index].Cells["b_bar_code"].Value = tempRow[4]; dgv_orderBcu.Rows[index].Cells["b_ca_name"].Value = tempRow[5]; dgv_orderBcu.Rows[index].Cells["send_count"].Value = tempRow[6]; dgv_orderBcu.Rows[index].Cells["b_remark"].Value = tempRow[7]; dgv_orderBcu.Rows[index].Cells["instrument_code"].Value = tempRow[8]; dgv_orderBcu.Rows[index].Cells["codeTypeName"].Value = OrderHelper.GetEnumInstrumentTypeName(codeType, c_codeType, _dicInstrumentType, _dicChildInstrumentType); //类型名称 } } } } StartBarCodeHook(); }
public HCSWF_dialog_container(SortedList scanCodes, SortedList sl_Check, CnasHCSWorkflowInterface workflowServer, string pd_code, SortedList sL_parametertmp02, DataTable dtpartvalue, SortedList sL_parametersinfo) : base(scanCodes) { _sl_Check = sl_Check; _sL_parametertmp02 = sL_parametertmp02; _pdcode = pd_code; _sL_parametersinfo = sL_parametersinfo; _dtpartvalue = dtpartvalue; Logger = Logger ?? LogManager.GetLogger("CnasWNSClient"); InitializeComponent(); ControlViewBase viewBase = WorkFlowDialogGenerator.Instance.GeneratorWFDialog(PdCode); if (viewBase != null) { _workFlowView = viewBase; DialogResultStatus = viewBase.IsShown ? 1 : 0; _workFlowView.Sl_check = this._sl_Check; _workFlowView.Dock = DockStyle.Fill; infoPanel.Controls.Add(viewBase); infoPanel.SetRow(viewBase, 0); _workFlowView.PdCode = PdCode; _workFlowView.ScanBarCodes = ScanBarCodes; _workFlowView.WorkflowServer = workflowServer as WorkflowArithmeticClass; if (ViewData.ContainsKey("UserInfo") && ViewData["UserInfo"] is UserBase) { viewBase.UserInfo = ViewData["UserInfo"] as UserBase; } else { UserBase userInfo = UserBaseHelper.GetUserByBarCode(BarCodeHelper.GetBarCodeByType("BCB", ScanBarCodes)); if (userInfo != null) { ViewData.Add("UserInfo", userInfo); viewBase.UserInfo = userInfo; } else { Logger.Error(string.Format("Can not get user info. User barCode:{0}", BarCodeHelper.GetBarCodeByType("BCB", ScanBarCodes))); } } MinimumSize = new Size((int)(_workFlowView.Width + mainPanel.ColumnStyles[1].Width + 100), viewBase.Height + 180); } else { DialogResultStatus = 0; } confirmBtn.Height = buttonGroup.ItemHeight - 3; buttonPanel.Height = confirmBtn.Margin.Top + confirmBtn.Margin.Bottom + confirmBtn.Height * 2 + cancelBtn.Margin.Top + cancelBtn.Margin.Bottom; cancelBtn.Height = confirmBtn.Height; confirmBtn.BackgroundImage = BarCodeHelper.GetBarcodeImage(_okBarCode, "确 认", confirmBtn.Width, confirmBtn.Height); cancelBtn.BackgroundImage = BarCodeHelper.GetBarcodeImage(_closeBarCode, "关 闭", cancelBtn.Width, cancelBtn.Height); }
public HCSSM_procedure_manual(string in_pdcode, string in_setcode, CnasHCSWorkflowInterface indata) { PD_Code = in_pdcode; Set_Code = in_setcode; SortedList stdata01 = new SortedList(); CnasRemotCall reCnasRemotCall = new CnasRemotCall(); SortedList sttemp01 = new SortedList(); sttemp01.Add(1, in_pdcode); DtmanualData = reCnasRemotCall.RemotInterface.SelectData("HCS-proceduremanual-sec01", sttemp01); if (indata is WorkflowArithmeticClass) { WorkflowArithmeticClass wfLogic = indata as WorkflowArithmeticClass; string[] recycleWFs = wfLogic.Recyle_set_wf.Split(','); string[] createBCUWFs = wfLogic.Cre_BCU_wf.Split(','); foreach (string item in recycleWFs) { int pdCode = 0; if (int.TryParse(item, out pdCode) && !_recycleWF.Contains(pdCode)) { _recycleWF.Add(pdCode); } } foreach (string item in createBCUWFs) { int pdCode = 0; if (int.TryParse(item, out pdCode) && !_createBCUWF.Contains(pdCode) && pdCode > 0) { _createBCUWF.Add(pdCode); } } } if (DtmanualData == null) { this.Close(); } else { Rec_data = 0; for (int i = 0; i < DtmanualData.Rows.Count; i++) { stdata01.Add("BCXP90000000" + DtmanualData.Rows[i]["manual_id"].ToString(), DtmanualData.Rows[i]["manual_name"].ToString()); } } InitializeComponent(); CnasHCSWorkflowInterface01 = indata; if (stdata01.Count > 0) { AutoImage(stdata01); } Icon = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO)); }
private void loadclass() { object result = null; Type typeofControl = null; Assembly tempAssembly; tempAssembly = Assembly.LoadFrom("CnasWorkflowArithmetic.dll"); typeofControl = tempAssembly.GetType("Cnas.wns.CnasWorkflowArithmetic.WorkflowArithmeticClass"); result = Activator.CreateInstance(typeofControl); CnasHCSWorkflowInterface01 = (CnasHCSWorkflowInterface)result; }
/// <summary> /// 初始化类构造函数 /// </summary> /// <param name="indata">算法类</param> /// <param name="userbarcode">用户条码</param> /// <param name="dtpdpartin">所有参数集合</param> /// <param name="dtapppddata">当前工作台流程集合</param> public HCSSM_scanbarcode(CnasHCSWorkflowInterface indata, string userbarcode, DataTable dtpdpartdata, DataTable dtapppddata, DataTable dtpartvaluedata) { InitializeComponent(); if (dtpdpartdata == null || dtapppddata == null) { Cnas.wns.CnasMetroFramework.MetroMessageBox.Show(this, "对不起!流程参数数据获取失败,不能继续。", "信息提示"); this.Close(); } dtpartvalue = dtpartvaluedata; for (int i = 0; i < dtapppddata.Rows.Count; i++) { string str_pdname = "", str_pdbcode = ""; if (dtapppddata.Rows[i]["pd_bcode"] != null) { str_pdbcode = dtapppddata.Rows[i]["pd_bcode"].ToString(); } if (dtapppddata.Rows[i]["pd_name"] != null) { str_pdname = dtapppddata.Rows[i]["pd_name"].ToString(); } SL_AppPD.Add(str_pdbcode, str_pdname); } if (SL_AppPD.Count > 0) { AutoImage(SL_AppPD); } //pic_01.Image = GetBarcodeImage("BCX0000008998", "接收登记"); //pic_02.BackgroundImage = GetBarcodeImage("BCX0000008998", "清洗"); BCXP900000002.BackgroundImage = GetBarcodeImage("BCXP900000002", "退出扫码"); BCXP900000001.BackgroundImage = GetBarcodeImage("BCXP900000001", "确认操作"); SL_main.Add("BCXP900000001", BCXP900000001); SL_main.Add("BCXP900000002", BCXP900000002); //SL_main.Add("BCXP900000003", BCXP900000003); dtpdpart = dtpdpartdata; dtapppd = dtapppddata; CnasHCSWorkflowInterface01 = indata; SL_barcode.Add(userbarcode, "BCB"); addtodgv(userbarcode, "用户"); //检查参数:用来存储判断参数 SL_check.Add("pd_code", ""); SL_check.Add("pd_name", ""); SL_check.Add("pd_barcode", ""); SL_check.Add("pd_scan", ""); SL_check.Add("pd_par1", ""); SL_check.Add("pd_par2", ""); }
public HCSSM_order_specialset_pack(CnasHCSWorkflowInterface workFlowServer, DataTable pdData, DataTable pdparameters, string orderNum, string batch, string packSetName = "", int packageType = 0) { _workflowServer = workFlowServer; _pdData = pdData; _pdparameters = pdparameters; _orderNum = orderNum; _batch = batch; _packSetName = packSetName; _packageType = packageType; InitializeComponent(); isSplitLbl.Visible = _packageType == 1; isSplitCbx.Visible = _packageType == 1; }
public HCSWF_specialset_pack(CnasHCSWorkflowInterface workInterface, DataTable pdData, DataTable pdparameters, string appId) { InitializeComponent(); Icon = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO)); if (specialSetPacking != null) { specialSetPacking.WorkflowServer = workInterface as WorkflowArithmeticClass; specialSetPacking.PdData = pdData; specialSetPacking.Pdparameters = pdparameters; specialSetPacking.ScanBarCodes.Add("BCV0000003020", "BCV"); specialSetPacking.AppId = appId; specialSetPacking.GenerateCheckList(); } _barCodeHook.BarCodeEvent += OnBarCodeEvent; _barCodeHook.Start(false); }
/// <summary> /// /// </summary> /// <param name="inappid"></param> public HCSSM_order_undone_manager(string inappid, CnasHCSWorkflowInterface cnasHCSWorkflowInterface01) : this() { _inappid = inappid; _cnasHCSWorkflowInterface01 = cnasHCSWorkflowInterface01; }
/// <summary> /// 订单处理 /// </summary> /// <param name="orderNum"></param> /// <param name="batch"></param> /// <param name="inappid"></param> public HCSSM_order_new_order_handle(string orderNum, string batch, string inappid, CnasHCSWorkflowInterface cnasHCSWorkflowInterface01) : this(orderNum, batch) { _inappid = inappid; _cnasHCSWorkflowInterface01 = cnasHCSWorkflowInterface01; }
/// <summary> /// 初始化类构造函数 /// </summary> /// <param name="indata">算法类</param> /// <param name="userbarcode">用户条码</param> /// <param name="dtpdpartin">所有参数集合</param> /// <param name="dtapppddata">当前工作台流程集合</param> public HCSSM_scanbarcode(CnasHCSWorkflowInterface indata, UserBase userInfo, DataTable dtpdpartdata, DataTable dtapppddata, DataTable dtpartvaluedata) { InitializeComponent(); Icon = new Icon(ResourcesImageHelper.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO)); if (dtpdpartdata == null || dtapppddata == null) { if (dtpdpartdata == null) { dtpdpartdata = new DataTable(); if (!dtpdpartdata.Columns.Contains("pd_code")) { dtpdpartdata.Columns.Add("pd_code", typeof(string)); } } else { IsInternalError = true; Cnas.wns.CnasMetroFramework.MetroMessageBox.Show(this, "对不起!流程参数数据获取失败,不能继续。", "信息提示"); this.Close(); return; } } dtpartvalue = dtpartvaluedata; _userInfo = userInfo ?? new UserBase(); //_scanUserInfo = (new DBServer()).GetUserByBarCode(userbarcode); for (int i = 0; i < dtapppddata.Rows.Count; i++) { string str_pdname = "", str_pdbcode = ""; if (dtapppddata.Rows[i]["pd_bcode"] != null) { str_pdbcode = dtapppddata.Rows[i]["pd_bcode"].ToString(); } if (dtapppddata.Rows[i]["pd_name"] != null) { str_pdname = dtapppddata.Rows[i]["pd_name"].ToString(); } SL_AppPD.Add(str_pdbcode, str_pdname); } if (SL_AppPD.Count > 0) { AutoImage(SL_AppPD); } //pic_01.Image = GetBarcodeImage("BCX0000008998", "接收登记"); //pic_02.BackgroundImage = GetBarcodeImage("BCX0000008998", "清洗"); BCXP900000002.BackgroundImage = GetBarcodeImage("BCXP900000002", "退出扫码"); BCXP900000001.BackgroundImage = GetBarcodeImage("BCXP900000001", "确认操作"); SL_main.Add("BCXP900000001", BCXP900000001); SL_main.Add("BCXP900000002", BCXP900000002); //SL_main.Add("BCXP900000003", BCXP900000003); dtpdpart = dtpdpartdata; dtapppd = dtapppddata; CnasHCSWorkflowInterface01 = indata; SL_barcode.Add(userInfo.Userbcode, "BCB"); addtodgv(userInfo.Userbcode, userInfo.UserName); //检查参数:用来存储判断参数 SL_check.Add("pd_code", ""); SL_check.Add("pd_name", ""); SL_check.Add("pd_barcode", ""); SL_check.Add("pd_scan", ""); SL_check.Add("pd_par1", ""); SL_check.Add("pd_par2", ""); IsInternalError = false; }
public HttpResponseMessage PostWorkSet(dynamic content) { HttpResponseMessage result = null; try { string sessionKey = Convert.ToString(content.SessionKey); HttpSessionState session = HttpContext.Current.Application[sessionKey] as HttpSessionState; Dictionary <string, dynamic> resultData = new Dictionary <string, dynamic>(); if (session != null) { CnasHCSWorkflowInterface wfLogic = WFHelper.Instance.GetWFLogic(session); UserBase loginUser = session["UserInfo"] as UserBase; SortedList scanCodes = JsonHelper.GetJsonObject <SortedList>(content.ScanCodes.ToString()); string pdCode = BarCodeHelper.GetBarCodeByType("BCV", scanCodes); DataTable accessProcedure = null; DataTable procedureParameters = null; CnasRemotCall remoteCall = new CnasRemotCall(); if (HttpContext.Current.Session != null && !string.IsNullOrEmpty(pdCode)) { accessProcedure = session["AccessProcedure"] as DataTable; if (accessProcedure == null) { SortedList filter = new SortedList(); filter.Add(1, loginUser.UserID); string testSql = remoteCall.RemotInterface.CheckSelectData("HCS-user-procedure-sec001", filter); accessProcedure = remoteCall.RemotInterface.SelectData("HCS-user-procedure-sec001", filter); } procedureParameters = session["ProcedureParameters"] as DataTable; if (procedureParameters == null) { SortedList filter = new SortedList(); filter.Add(1, pdCode.Substring(9, 4)); string testSql = remoteCall.RemotInterface.CheckSelectData("HCS-pdparametervalue-sec003", filter); procedureParameters = remoteCall.RemotInterface.SelectData("HCS-pdparametervalue-sec003", filter); } } SortedList slCheck = new SortedList(); slCheck.Add("pd_code", ""); slCheck.Add("pd_barcode", ""); slCheck.Add("pd_name", ""); slCheck.Add("pd_par1", ""); slCheck.Add("pd_par2", ""); slCheck.Add("pd_scan", ""); if (accessProcedure != null) { DataRow[] procedure = accessProcedure.Select(string.Format("pd_bcode='{0}'", pdCode)); if (procedure.Length > 0) { if (!(procedure[0]["pd_code"] is DBNull)) { slCheck["pd_code"] = procedure[0]["pd_code"].ToString(); } if (!(procedure[0]["pd_bcode"] is DBNull)) { slCheck["pd_barcode"] = procedure[0]["pd_bcode"].ToString(); } if (!(procedure[0]["pd_name"] is DBNull)) { slCheck["pd_name"] = procedure[0]["pd_name"].ToString(); } if (!(procedure[0]["pd_scan"] is DBNull)) { string scanParam = procedure[0]["pd_scan"].ToString(); if (!string.IsNullOrEmpty(scanParam)) { SortedList scans = new SortedList(); string[] scanParams = scanParam.Split(';'); foreach (string item in scanParams) { if (item.Length > 3 && !scans.ContainsKey(item.Substring(0, 3))) { scans.Add(item.Substring(0, 3), int.Parse(item.Substring(3))); } } slCheck["pd_scan"] = scans; } } } } SortedList parameter01 = new SortedList(); SortedList parameter02 = new SortedList(); slCheck["pd_par1"] = parameter01; slCheck["pd_par2"] = parameter02; if (procedureParameters != null) { foreach (DataRow dr in procedureParameters.Rows) { string parameterName = dr["par_name"].ToString(); string parameterType = dr["par_type"].ToString(); string parameterDescription = dr["par_description"].ToString(); if (parameterType == "2") { parameter02.Add(parameterName, parameterDescription); } else { parameter02.Add(parameterName, parameterDescription); } } } SortedList submit = new SortedList(); SortedList params01 = new SortedList(); SortedList params02 = new SortedList(); SortedList params03 = new SortedList(); if (content.Parameter01 != null) { params01 = JsonHelper.GetJsonObject <SortedList>(content.Parameter01.ToString()); } if (content.Parameter02 != null) { params02 = JsonHelper.GetJsonObject <SortedList>(content.Parameter02.ToString()); } if (content.Parameter03 != null) { params03 = JsonHelper.GetJsonObject <SortedList>(content.Parameter03.ToString()); } string userId = Convert.ToString(content.UserId); submit.Add("Par1_info", params01); submit.Add("Par2_info", params02); submit.Add("Par3_Dialog", params03); submit.Add("SL_check", slCheck); submit.Add("sub_barcode", scanCodes); submit.Add("user_id", userId); SortedList postResult = wfLogic.GetWorkflowParametersValue(1001, 1001, submit, null, null); resultData.Add("Result", postResult); result = Request.CreateResponse <Dictionary <string, dynamic> >(HttpStatusCode.OK, resultData); } else { SortedList postResult = new SortedList(); postResult.Add("Message", "登录超时,请重新登录"); result = Request.CreateResponse <Dictionary <string, dynamic> >(HttpStatusCode.GatewayTimeout, resultData); } return(result); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ex)); } }