/// <summary>
        /// 加载数据
        /// </summary>
        private void RefreshDataGrid()
        {
            setDataGrid.Rows.Clear();
            if (string.IsNullOrEmpty(PdCode) || string.IsNullOrEmpty(_MachineCode))
            {
                return;
            }
            else
            {
                //dgv_01 数据
                SortedList condition = new SortedList();
                condition.Add(1, PdCode);
                condition.Add(2, "0");

                string setBarCodes = BarCodeHelper.GetBarCodeByType("BCC", ScanBarCodes);
                setBarCodes = setBarCodes.Replace(",", "','");
                condition.Add(3, setBarCodes);
                string    testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-work-set-sec003", condition);
                DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-work-set-sec003", condition);
                if (data != null && data.Rows.Count > 0)
                {
                    for (int i = 0; i < data.Rows.Count; i++)
                    {
                        DataConverter.ConvertSetData(setDataGrid, data.Rows[i]);
                    }
                }
                AppendTempBCCSet();
                setNumTxt.Text = setDataGrid.RowCount.ToString();
            }
        }
Esempio n. 2
0
        private void GetLocation()
        {
            SortedList condition    = new SortedList();
            string     locationCode = BarCodeHelper.GetBarCodeByType("BCE", ScanBarCodes);

            if (string.IsNullOrEmpty(locationCode))
            {
                locationCode = BarCodeHelper.GetBarCodeByType("BCF", ScanBarCodes);
            }
            if (string.IsNullOrEmpty(locationCode))
            {
                return;
            }
            condition.Add(1, locationCode);
            string    sqlTest = RemoteClient.RemotInterface.CheckSelectData("HCS-use-location-sec004", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-use-location-sec004", condition);

            if (data != null && data.Rows.Count > 0)
            {
                DataRow row = data.Rows[0];
                if (row["type_name"] != null && row["u_uname"] != null)
                {
                    areaTxt.Text = (row["u_locationtype"] != null && row["u_locationtype"].ToString() != "5") ? row["type_name"].ToString() : row["u_uname"].ToString();
                }
            }
        }
Esempio n. 3
0
        private void RefreshWorkSets()
        {
            setDataGrid.Rows.Clear();
            SortedList condition = new SortedList();

            condition.Add(1, PdCode);
            condition.Add(2, "0");

            string setBarCodes = BarCodeHelper.GetBarCodeByType("BCC", ScanBarCodes);

            setBarCodes = setBarCodes.Replace(",", "','");
            condition.Add(3, setBarCodes);
            string    testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-work-set-sec003", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-work-set-sec003", condition);

            if (data != null)
            {
                foreach (DataRow item in data.Rows)
                {
                    DataConverter.ConvertSetData(setDataGrid, item);
                }
            }
            AppendTempBCCSet();
            setNumTxt.Text = setDataGrid.RowCount.ToString();
        }
Esempio n. 4
0
        /// <summary>
        /// 查看包的详情
        /// </summary>
        public virtual void ShowSetPackDetail()
        {
            DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid");

            if (setDataGrid != null)
            {
                if (setDataGrid.SelectedRows != null && setDataGrid.SelectedRows.Count == 1)
                {
                    if (setDataGrid.Columns.Contains("setBarCodeCol") &&
                        setDataGrid.SelectedRows[0].Cells["setBarCodeCol"] != null)
                    {
                        string code = setDataGrid.SelectedRows[0].Cells["setBarCodeCol"].Value.ToString();
                        if (code.Length > 3)
                        {
                            SortedList condition = new SortedList();
                            condition.Add(BarCodeHelper.GetBarCodeByType("BCV", ScanBarCodes), "BCV");
                            condition.Add(code, code.Substring(0, 3));
                            HCSWF_set_detail detail = new HCSWF_set_detail(condition);
                            detail.ShowDialog();
                        }
                    }
                }
                else
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("selectset", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("notfindSetGrid", EnumPromptMessage.error), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 5
0
        private void InitalizeSetInfo()
        {
            SortedList condition = new SortedList();

            condition.Add(1, PdCode);
            condition.Add(2, "0");

            string setBarCodes = BarCodeHelper.GetBarCodeByType("BCC", ScanBarCodes);

            setBarCodes = setBarCodes.Replace(",", "','");
            condition.Add(3, setBarCodes);
            string    testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-work-set-sec003", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-work-set-sec003", condition);

            if (data != null && data.Rows.Count > 0)
            {
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    if (data.Rows[i]["bar_code"] != null)
                    {
                        if (data.Rows[i]["ca_name"] != null)
                        {
                            setNameTxt.Text = Convert.ToString(data.Rows[i]["ca_name"]);
                        }
                        setNameTxt.Tag = data.Rows[i]["bar_code"];
                        //if (data.Rows[i]["pa_type"] != null) setTypeTxt.Text = data.Rows[i]["pa_type"].ToString();
                        //if (data.Rows[i]["pa_priorty"] != null) setPriortyTxt.Text = data.Rows[i]["pa_priorty"].ToString();
                        //if (data.Rows[i]["st_pr_Name"] != null) setSterilizerTxt.Text = data.Rows[i]["st_pr_Name"].ToString();
                        //if (data.Rows[i]["wa_pr_Name"] != null) setWashingTxt.Text = data.Rows[i]["wa_pr_Name"].ToString();
                        if (data.Rows[i]["location_name"] != null)
                        {
                            useLocationTxt.Text = data.Rows[i]["location_name"].ToString();
                        }
                        if (data.Rows[i]["base_set_id"] != null)
                        {
                            int.TryParse(data.Rows[i]["base_set_id"].ToString(), out _packingSetBaseId);
                        }
                        if (data.Rows[i]["id"] != null)
                        {
                            _setId = Convert.ToString(data.Rows[i]["id"]);
                        }
                        if (data.Rows[i]["expiration_time"] != null)
                        {
                            int.TryParse(data.Rows[i]["expiration_time"].ToString(), out _expirationTime);
                        }
                        break;
                    }
                }
            }

            useLocationLbl.Visible = string.IsNullOrEmpty(setBarCodes) ? false : true;
            //setBarCodeTxt.Visible = string.IsNullOrEmpty(setBarCodes) ? false : true;
            setLbl.Visible     = string.IsNullOrEmpty(setBarCodes) ? false : true;
            setNameTxt.Visible = string.IsNullOrEmpty(setBarCodes) ? false : true;
            //setTypeTxt.Visible = string.IsNullOrEmpty(setBarCodes) ? false : true;
            //setPriortyTxt.Visible = string.IsNullOrEmpty(setBarCodes) ? false : true;
            //setSterilizerTxt.Visible = string.IsNullOrEmpty(setBarCodes) ? false : true;
            //setWashingTxt.Visible = string.IsNullOrEmpty(setBarCodes) ? false : true;
            useLocationTxt.Visible = string.IsNullOrEmpty(setBarCodes) ? false : true;
        }
Esempio n. 6
0
        /// <summary>
        /// 初始化win
        /// </summary>
        /// <param name="codeList"></param>
        public HCSWF_set_detail_new(SortedList codeList)
        {
            InitializeComponent();
            string setBarCodes = BarCodeHelper.GetBarCodeByType("BCC", codeList);

            setBarCodes = setBarCodes.Replace(",", "','");
            _bccCode    = setBarCodes;
        }
        public void InitalizeMachine()
        {
            string deviceSql = string.Empty;

            if (WorkflowServer != null && WorkflowServer.Add_washing_count.Contains(PdCode))
            {
                deviceSql    = "HCS-washing-program-sec003";
                _MachineType = 1;
            }
            else if (WorkflowServer != null && WorkflowServer.Add_setandsterilizer_count.Contains(PdCode))
            {
                deviceSql    = "HCS-sterilizer-program-sec003";
                _MachineType = 2;
            }

            SortedList condition = new SortedList();

            condition.Add(1, _MachineCode);
            condition.Add(2, CnasBaseData.SystemID);
            condition.Add(3, BarCodeHelper.GetBarCodeByType("BCP", ScanBarCodes));
            //1 清洗  2 装载灭菌

            DataTable getMachinedt = RemoteClient.RemotInterface.SelectData(deviceSql, condition);

            //getdt不知道会不会出现多个Row
            if (getMachinedt != null && getMachinedt.Rows.Count > 0)
            {
                machineTxt.Text     = GetValueStr(getMachinedt.Rows[0]["dev_name"]);
                txtProgramName.Text = GetValueStr(getMachinedt.Rows[0]["pr_name"]);

                int.TryParse(GetValueStr(getMachinedt.Rows[0]["dev_runtimes"]), out _runtimes);
                condition.Clear();
                condition.Add(1, PdCode);
                condition.Add(2, _MachineCode);
                condition.Add(3, 0);
                string testSQL = string.Empty;
                try
                {
                    testSQL = RemoteClient.RemotInterface.CheckSelectData("HCS-machine-release-sec001", condition);

                    DataTable data = RemoteClient.RemotInterface.SelectData("HCS-machine-release-sec001", condition);
                    if (data != null && data.Rows.Count > 0)
                    {
                        btnChange.Enabled = false;
                    }
                    else
                    {
                        _runtimes = _runtimes + 1;
                    }

                    txtBatch.Text = _runtimes.ToString();
                }
                catch (Exception ex)
                {
                    Logger.Error("Error on HCS-workset-sec003:", ex);
                }
            }
        }
        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);
        }
Esempio n. 9
0
 public override void InitalizeControl()
 {
     base.InitalizeControl();
     if (UserInfo == null)
     {
         UserInfo = UserBaseHelper.GetUserByBarCode(BarCodeHelper.GetBarCodeByType("BCB", ScanBarCodes))
                    ?? CnasBaseData.UserBaseInfo;
     }
     userNameTxt.Text = UserInfo.UserName;
     SetCarName();
     RefreshWorkSets();
 }
Esempio n. 10
0
        /// <summary>
        /// 查看包的闲情
        /// </summary>
        public override void ShowSetPackDetail()
        {
            string code = Convert.ToString(setNameTxt.Tag);

            if (code.Length > 3)
            {
                SortedList condition = new SortedList();
                condition.Add(BarCodeHelper.GetBarCodeByType("BCV", ScanBarCodes), "BCV");
                condition.Add(code, code.Substring(0, 3));
                HCSWF_set_detail detail = new HCSWF_set_detail(condition);
                detail.ShowDialog();
            }
        }
Esempio n. 11
0
        public virtual void InitalizeControl()
        {
            TextBox userNameTxt = CnasUtilityTools.FindControl <TextBox>(this, "userNameTxt");

            if (userNameTxt != null)
            {
                if (UserInfo == null && UserInfo.UserID == 0)
                {
                    UserInfo = UserBaseHelper.GetUserByBarCode(BarCodeHelper.GetBarCodeByType("BCB", ScanBarCodes))
                               ?? CnasBaseData.UserBaseInfo;
                }
                //userBarCodeTxt.Text = UserInfo.Userbcode;
                userNameTxt.Text = UserInfo.UserName;
            }
        }
Esempio n. 12
0
 public BaseForm(SortedList scanCodes)
 {
     InitializeComponent();
     Icon   = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO));
     Logger = LogManager.GetLogger("CnasWNSClient");
     if (scanCodes != null)
     {
         _scanBarCodes = scanCodes;
         string wfCode = BarCodeHelper.GetBarCodeByType("BCV", _scanBarCodes);
         PdCode = string.IsNullOrEmpty(wfCode) ? "" : wfCode.Substring(9, 4);
     }
     else
     {
         Logger.Error(string.Format("Scan code is null."));
     }
 }
Esempio n. 13
0
        public override void InitalizeControl()
        {
            //base.InitalizeControl();
            DataRow[] data = CnasBaseData.SystemBaseData.Select("key_code='CheckedSetInstrument' and type_code='HCS-system-settings'");
            if (data.Length > 0)
            {
                _isNeedCheckAll = data[0]["value_code"].ToString().Equals("1");
            }
            instrumentGrid.Columns["isPackagedCol"].Visible = _isNeedCheckAll;
            if (!_isNeedCheckAll)
            {
                txtConfirmName.Focus();
                //txtConfirmCode.Focus();
            }

            DataRow[] defaultType = CnasBaseData.SystemBaseData.Select("key_code ='DefaultPackInstrmentType' and type_Code ='HCS-system-settings'");
            if (defaultType.Length > 0 && defaultType[0]["value_code"] != null)
            {
                _defaluePackInstrumentType = defaultType[0]["value_code"].ToString();
            }
            string bcbCodes = BarCodeHelper.GetBarCodeByType("BCB", ScanBarCodes);

            string[] bcbCodeItems = bcbCodes.Split(',');
            if (bcbCodeItems.Length > 0)
            {
                UserInfo = UserBaseHelper.GetUserByBarCode(bcbCodeItems[0])
                           ?? CnasBaseData.UserBaseInfo;
                //userBarCodeTxt.Text = UserInfo.Userbcode;
                userNameTxt.Text = UserInfo.UserName;
                if (bcbCodeItems.Length > 1)
                {
                    _confirmUser = UserBaseHelper.GetUserByBarCode(bcbCodeItems[1]);
                    if (_confirmUser != null)
                    {
                        //userBarCodeTxt.Text = UserInfo.Userbcode;
                        userNameTxt.Text = UserInfo.UserName;
                    }
                }
            }

            InitalizeSetInfo();
            RefreshDataGrid();
        }
Esempio n. 14
0
        public void SetCarName()
        {
            SortedList condition = new SortedList();

            condition.Add(1, BarCodeHelper.GetBarCodeByType("BCD", ScanBarCodes));
            string    sqlTest = RemoteClient.RemotInterface.CheckSelectData("HCS-transprot-device-sec001", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-transprot-device-sec001", condition);

            if (data != null)
            {
                foreach (DataRow row in data.Rows)
                {
                    Dictionary <string, string> car = new Dictionary <string, string>();
                    if (row["ca_name"] != null)
                    {
                        carNameTxt.Text = row["ca_name"].ToString();
                    }
                    break;
                }
            }
        }
        /// <summary>
        /// 返回 0未知1清洗2灭菌
        /// </summary>
        /// <returns></returns>
        private int GetReleaseMachineType()
        {
            string washingMachineCode    = BarCodeHelper.GetBarCodeByType("BCW", ScanBarCodes);
            string sterilizerMachineCode = BarCodeHelper.GetBarCodeByType("BCZ", ScanBarCodes);

            if ((!string.IsNullOrEmpty(washingMachineCode) && !string.IsNullOrEmpty(sterilizerMachineCode)) ||
                (string.IsNullOrEmpty(washingMachineCode) && string.IsNullOrEmpty(sterilizerMachineCode)))
            {
                return(0);
            }
            if (!string.IsNullOrEmpty(washingMachineCode))
            {
                return(2);
            }
            if (!string.IsNullOrEmpty(sterilizerMachineCode))
            {
                return(1);
            }

            return(0);
        }
        private void SetLocationName()
        {
            SortedList condition = new SortedList();

            condition.Add(1, BarCodeHelper.GetBarCodeByType("BCS", ScanBarCodes));
            string    sqlTest = RemoteClient.RemotInterface.CheckSelectData("HCS-storage-sec005", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-storage-sec005", condition);

            if (data != null)
            {
                foreach (DataRow row in data.Rows)
                {
                    Dictionary <string, string> car = new Dictionary <string, string>();
                    if (row["s_name"] != null)
                    {
                        areaTxt.Text = row["s_name"].ToString();
                    }
                    break;
                }
            }
        }
Esempio n. 17
0
        private void RefreshDataGrid()
        {
            SortedList condition = new SortedList();

            condition.Add(1, PdCode);
            condition.Add(2, "0");

            string setBarCodes = BarCodeHelper.GetBarCodeByType("BCD", ScanBarCodes);

            if (string.IsNullOrEmpty(setBarCodes))
            {
                return;
            }
            setBarCodes = setBarCodes.Replace(",", "','");
            if (!setBarCodes.Contains("','"))
            {
                SortedList paraCondition = new SortedList();
                paraCondition.Add(1, 1);
                paraCondition.Add(2, setBarCodes);
                paraCondition.Add(3, CnasBaseData.SystemID);
                string    testParaSql = RemoteClient.RemotInterface.CheckSelectData("HCS-transport-device-sec003", paraCondition);
                DataTable dataPara    = RemoteClient.RemotInterface.SelectData("HCS-transport-device-sec003", paraCondition);
                if (dataPara != null && dataPara.Rows.Count > 0)
                {
                    carNameTxt.Text = Convert.ToString(dataPara.Rows[0]["ca_name"]);
                }
            }
            condition.Add(3, setBarCodes);
            string    testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-work-set-sec005", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-work-set-sec005", condition);

            if (data != null)
            {
                foreach (DataRow item in data.Rows)
                {
                    DataConverter.ConvertSetData(setDataGrid, item);
                }
                setNumTxt.Text = setDataGrid.RowCount.ToString();
            }
        }
Esempio n. 18
0
        public void RefreshSetGrid()
        {
            SortedList condition = new SortedList();

            condition.Add(1, PdCode);
            condition.Add(2, "0");

            string setBarCodes = BarCodeHelper.GetBarCodeByType("BCC", ScanBarCodes);

            setBarCodes = setBarCodes.Replace(",", "','");
            condition.Add(3, setBarCodes);
            string    testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-work-set-sec003", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-work-set-sec003", condition);

            if (data != null && data.Rows.Count > 0)
            {
                foreach (DataRow item in data.Rows)
                {
                    DataConverter.ConvertSetData(setDataGrid, item);
                }
            }
        }
Esempio n. 19
0
        /// <summary>
        /// 设置包的基本信息
        /// </summary>
        private void InitalizeSetInfo()
        {
            SortedList condition = new SortedList();

            condition.Add(1, "0");
            string setBarCodes = BarCodeHelper.GetBarCodeByType("BCC", ScanBarCodes);

            setBarCodes = setBarCodes.Replace(",", "','");
            condition.Add(2, setBarCodes);
            string    testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-work-set-sec004", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-work-set-sec004", condition);

            if (data != null && data.Rows.Count > 0)
            {
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    if (data.Rows[i]["bar_code"] != null)
                    {
                        setBarCodeTxt.Text = data.Rows[i]["bar_code"].ToString();
                        if (data.Rows[i]["ca_name"] != null)
                        {
                            setNameTxt.Text = data.Rows[i]["ca_name"].ToString();
                        }
                        //if (data.Rows[i]["pa_type"] != null) setTypeTxt.Text = data.Rows[i]["pa_type"].ToString();
                        //if (data.Rows[i]["pa_priorty"] != null) setPriortyTxt.Text = data.Rows[i]["pa_priorty"].ToString();
                        //if (data.Rows[i]["st_pr_Name"] != null) setSterilizerTxt.Text = data.Rows[i]["st_pr_Name"].ToString();
                        //if (data.Rows[i]["wa_pr_Name"] != null) setWashingTxt.Text = data.Rows[i]["wa_pr_Name"].ToString();
                        //if (data.Rows[i]["cost_center_name"] != null) costCenterTxt.Text = data.Rows[i]["cost_center_name"].ToString();
                        //if (data.Rows[i]["location_name"] != null) setUseTxt.Text = data.Rows[i]["location_name"].ToString();
                        //if (data.Rows[i]["base_set_id"] != null) int.TryParse(data.Rows[i]["base_set_id"].ToString(), out _packingSetBaseId);
                        break;
                    }
                }
            }
            _setImages = GetSetImages();
        }
Esempio n. 20
0
        public SortedList GetWorkSets()
        {
            _workSets.Clear();
            SortedList condition = new SortedList();

            condition.Add(1, "0");
            condition.Add(2, PdCode);
            condition.Add(6, BarCodeHelper.GetBarCodeByType("BCD", ScanBarCodes));
            string    sqlTest = RemoteClient.RemotInterface.CheckSelectData("HCS-work-set-sec001", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-work-set-sec001", condition);

            if (data != null)
            {
                int index = 0;
                foreach (DataRow row in data.Rows)
                {
                    Dictionary <string, string> workSet = new Dictionary <string, string>();
                    if (row["id"] != null)
                    {
                        workSet.Add("id", row["id"].ToString());
                    }
                    if (row["set_id"] != null)
                    {
                        workSet.Add("set_id", row["set_id"].ToString());
                    }
                    if (row["set_code"] != null)
                    {
                        workSet.Add("set_code", row["set_code"].ToString());
                    }
                    if (row["set_name"] != null)
                    {
                        workSet.Add("set_name", row["set_name"].ToString());
                    }
                    if (row["wf_code"] != null)
                    {
                        workSet.Add("wf_code", row["wf_code"].ToString());
                    }
                    if (row["user_id"] != null)
                    {
                        workSet.Add("user_id", row["user_id"].ToString());
                    }
                    if (row["info_serial"] != null)
                    {
                        workSet.Add("info_serial", row["info_serial"].ToString());
                    }
                    if (row["container_code"] != null)
                    {
                        workSet.Add("container_code", row["container_code"].ToString());
                    }
                    if (row["BCU_code"] != null)
                    {
                        workSet.Add("BCU_code", row["BCU_code"].ToString());
                    }
                    if (row["status"] != null)
                    {
                        workSet.Add("status", row["status"].ToString());
                    }
                    if (row["cre_date"] != null)
                    {
                        workSet.Add("cre_date", row["cre_date"].ToString());
                    }
                    if (row["mod_date"] != null)
                    {
                        workSet.Add("mod_date", row["mod_date"].ToString());
                    }
                    if (row["remark"] != null)
                    {
                        workSet.Add("remark", row["remark"].ToString());
                    }

                    _workSets.Add(index, workSet);
                    index++;
                }
            }

            return(_workSets);
        }
Esempio n. 21
0
        /// <summary>
        /// 初始化相应信息
        /// </summary>
        public void  GenerateCheckList()
        {
            string     pdCode       = string.Empty;
            string     pdBarCode    = BarCodeHelper.GetBarCodeByType("BCV", ScanBarCodes);
            SortedList sl_check     = new SortedList();
            SortedList parameters01 = new SortedList();
            SortedList parameters02 = new SortedList();

            if (!string.IsNullOrEmpty(pdBarCode) && pdBarCode.Length >= 13)
            {
                PdCode = pdBarCode.Substring(9, 4);
                SortedList condition = new SortedList();
                condition.Add(1, PdCode);
                //string testSql = remoteClient.RemotInterface.CheckSelectData("HCS-procedure-sec003", condition);
                DataTable data      = remoteClient.RemotInterface.SelectData("HCS-procedure-sec003", condition);
                string    scanParam = string.Empty;
                if (data != null && data.Rows.Count == 1)
                {
                    if (data.Rows[0]["pd_code"] != null)
                    {
                        pdCode = data.Rows[0]["pd_code"].ToString();
                    }
                    if (data.Rows[0]["pd_scan"] != null)
                    {
                        scanParam = data.Rows[0]["pd_scan"].ToString();
                    }
                    if (!string.IsNullOrEmpty(scanParam))
                    {
                        string[]   scanParams = scanParam.Split(';');
                        SortedList values     = new SortedList();
                        foreach (string item in scanParams)
                        {
                            if (item.Length > 3 && !values.ContainsKey(item.Substring(0, 3)))
                            {
                                values.Add(item.Substring(0, 3), int.Parse(item.Substring(3)));
                            }
                        }
                        sl_check["pd_scan"]    = values;
                        sl_check["pd_code"]    = data.Rows[0]["pd_code"].ToString(); //流程代码
                        sl_check["pd_name"]    = data.Rows[0]["pd_name"];            //流程名字
                        sl_check["pd_barcode"] = pdBarCode;                          //流程编码
                    }
                }
                else
                {
                    MessageBox.Show("初始化流程数据失败。", "信息提示");
                }
                sl_check["pd_par1"] = parameters01;                //所有流程参数为1的集合
                sl_check["pd_par2"] = parameters02;                //所有流程参数为2的集合
                if (_pdparameters != null && _pdparameters.Columns.Contains("pd_code"))
                {
                    DataRow[] pdParameters = _pdparameters.Select("pd_code=" + PdCode);
                    foreach (DataRow dr in pdParameters)
                    {
                        string parameterName        = dr["par_name"].ToString();
                        string parameterType        = dr["par_type"].ToString();
                        string parameterDescription = dr["par_description"].ToString();
                        if (parameterType == "2")
                        {
                            parameters01.Add(parameterName, parameterDescription);
                        }
                        else
                        {
                            parameters01.Add(parameterName, parameterDescription);
                        }
                    }
                }
            }
            _checkList = sl_check;
        }
Esempio n. 22
0
        public SortedList GetTransferCars()
        {
            SortedList condition = new SortedList();

            _tranferCars.Clear();
            condition.Add(1, BarCodeHelper.GetBarCodeByType("BCD", ScanBarCodes));
            string    sqlTest = RemoteClient.RemotInterface.CheckSelectData("HCS-transprot-device-sec001", condition);
            DataTable data    = RemoteClient.RemotInterface.SelectData("HCS-transprot-device-sec001", condition);

            if (data != null)
            {
                int index = 0;
                foreach (DataRow row in data.Rows)
                {
                    Dictionary <string, string> car = new Dictionary <string, string>();
                    if (row["id"] != null)
                    {
                        car.Add("id", row["id"].ToString());
                    }
                    if (row["ca_name"] != null)
                    {
                        car.Add("ca_name", row["ca_name"].ToString());
                    }
                    if (row["bar_code"] != null)
                    {
                        car.Add("bar_code", row["bar_code"].ToString());
                    }
                    if (row["ca_type"] != null)
                    {
                        car.Add("ca_type", row["ca_type"].ToString());
                    }
                    if (row["max_times"] != null)
                    {
                        car.Add("max_times", row["max_times"].ToString());
                    }
                    if (row["run_times"] != null)
                    {
                        car.Add("run_times", row["run_times"].ToString());
                    }
                    if (row["ca_vendor"] != null)
                    {
                        car.Add("ca_vendor", row["ca_vendor"].ToString());
                    }
                    if (row["mod_date"] != null)
                    {
                        car.Add("mod_date", row["mod_date"].ToString());
                    }
                    if (row["cre_date"] != null)
                    {
                        car.Add("cre_date", row["cre_date"].ToString());
                    }
                    if (row["ca_remarks"] != null)
                    {
                        car.Add("ca_remarks", row["ca_remarks"].ToString());
                    }
                    if (row["si_id"] != null)
                    {
                        car.Add("si_id", row["si_id"].ToString());
                    }
                    if (row["sales_id"] != null)
                    {
                        car.Add("sales_id", row["sales_id"].ToString());
                    }
                    if (row["state"] != null)
                    {
                        car.Add("state", row["state"].ToString());
                    }

                    _tranferCars.Add(index, car);
                    index++;
                }
            }
            return(_tranferCars);
        }
Esempio n. 23
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));
            }
        }