Exemplo n.º 1
0
        /// <summary>
        /// push下一步流程
        /// </summary>
        /// <returns></returns>
        private SortedList PushToNextWF()
        {
            SortedList result = new SortedList();

            try
            {
                SortedList cfmUser = new SortedList();
                cfmUser.Add("confirmUserId", cfmUserTxt.Tag != null ? cfmUserTxt.Tag : 0);
                if (OutputParameters.ContainsKey("confirmUserParams"))
                {
                    OutputParameters["confirmUserParams"] = cfmUser;
                }
                else
                {
                    OutputParameters.Add("confirmUserParams", cfmUser);
                }
                SortedList submit = new SortedList();
                submit.Add("SL_check", _checkList);
                submit.Add("sub_barcode", ScanBarCodes);
                submit.Add("user_id", packUserTxt.Tag != null ? packUserTxt.Tag : 0);
                submit.Add("Par2_info", new SortedList());
                submit.Add("Par3_Dialog", OutputParameters);
                result = _workflowServer.GetWorkflowParametersValue(1001, 1001, submit, null, null);
            }
            catch (Exception)
            {
                result["rec_result"] = "1";
                result["rec_data02"] = "创建标签条码成功,提交下一步流程失败";
            }
            return(result);
        }
Exemplo n.º 2
0
        private void submitwf()
        {
            SL_Submit.Clear();
            SL_Submit.Add("SL_check", SL_check);
            SL_Submit.Add("sub_barcode", SL_barcode);
            SL_Submit.Add("user_id", _userInfo != null ? _userInfo.UserID.ToString() : "1");
            SL_Submit.Add("Par2_info", SL_parametersinfo);
            SL_Submit.Add("Par3_Dialog", configDialogParames);

            SortedList sl_rec009 = CnasHCSWorkflowInterface01.GetWorkflowParametersValue(1001, 1001, SL_Submit, null, null);
            int        intrec01  = int.Parse(sl_rec009["rec_result"].ToString());

            if (intrec01 == 0)
            {
                //Cnas.wns.CnasMetroFramework.MetroMessageBox.Show(this, "恭喜你!提交成功。", "信息提示");
                this.Close();
            }
            else
            {
                string strrec = "";
                if (sl_rec009["rec_data01"] != null)
                {
                    strrec = sl_rec009["rec_data01"].ToString();
                }
                if (sl_rec009["rec_data02"] != null)
                {
                    strrec = strrec + sl_rec009["rec_data02"].ToString();
                }

                mlab_info.Text = intrec01.ToString() + "-" + strrec;
            }
        }
Exemplo n.º 3
0
        private void submitwf()
        {
            SL_Submit.Clear();
            SL_Submit.Add("SL_check", SL_check);
            SL_Submit.Add("sub_barcode", SL_barcode);
            SL_Submit.Add("user_id", "1");
            SL_Submit.Add("Par2_info", SL_parametersinfo);

            SortedList sl_rec009 = CnasHCSWorkflowInterface01.GetWorkflowParametersValue(1001, 1001, SL_Submit, null, null);
            string     strrec01  = sl_rec009["rec_result"].ToString();

            if (strrec01 == "0")
            {
                Cnas.wns.CnasMetroFramework.MetroMessageBox.Show(this, "恭喜你!提交成功。", "信息提示");
                this.Close();
            }
            else
            {
                mlab_info.Text = strrec01 + "-" + sl_rec009["rec_data01"].ToString();
            }
        }
Exemplo n.º 4
0
        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));
            }
        }