Ejemplo n.º 1
0
        private void tsm_hand_Click(object sender, EventArgs e)
        {
            if (dgv_01.CurrentRow != null)
            {
                string str_pdcode = dgv_01.CurrentRow.Cells["wf_code_back"].Value.ToString();
                string bccCode    = Convert.ToString(dgv_01.CurrentRow.Cells["set_code"].Value);
                string bcuCode    = Convert.ToString(dgv_01.CurrentRow.Cells["bcuCode"].Value);
                string setCode    = string.IsNullOrEmpty(bcuCode) ? bccCode : CnasUtilityTools.ConcatTwoString(bcuCode, bccCode);

                HCSSM_procedure_manual HCSSM_procedure_manual01 = new HCSSM_procedure_manual(str_pdcode, setCode, CnasHCSWorkflowInterface01);
                if (HCSSM_procedure_manual01.Rec_data > -1)
                {
                    HCSSM_procedure_manual01.ShowDialog();

                    if (HCSSM_procedure_manual01.Rec_data == 0)
                    {
                        GetWorkSets();
                    }
                }
                else
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("notconfigmanWf", EnumPromptMessage.warning, new string[] { str_pdcode }),
                                    "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    HCSSM_procedure_manual01.Dispose();
                }
            }
            else
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("secdealset", EnumPromptMessage.warning),
                                "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 2
0
        private void mett_01_Click(object sender, EventArgs e)
        {
            Next_PDcode = "";
            SL_returnparametersinfo.Clear();
            SL_returnparametersvalue.Clear();
            string str_01 = string.Empty;

            //开始第一个参数选择
            DataRow[] arrayDR03 = dtpartvalueconfig.Select("par_code='" + Current_parcode + "'");
            if (arrayDR03 != null && arrayDR03.Count() > 0)
            {
                str_par_description = arrayDR03[0]["par_description"].ToString();
                str_parname         = arrayDR03[0]["par_name"].ToString();
                mlab_next.Text      = str_par_description;
                str_01        = arrayDR03[0]["par_code"].ToString();
                str_next_code = dtpartvalueconfig.Rows[0]["next_code"].ToString();
            }
            DataRow[] arrayDR = dtpartvalue.Select("par_code='" + str_01 + "'");
            mcb_result.Items.Clear();
            foreach (DataRow dr in arrayDR)
            {
                if (IsExitParcodeValue(Current_parcode, Convert.ToString(dr["v_value"])))
                {
                    mcb_result.Items.Add(CnasUtilityTools.ConcatTwoString(dr["v_value"].ToString(), dr["v_name"].ToString()));
                }
            }
            //默认选择为第一个
            if (mcb_result.Items.Count > 0)
            {
                mcb_result.SelectedIndex = 0;
            }
        }
Ejemplo n.º 3
0
        public virtual void AddSets()
        {
            DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid");

            if (setDataGrid != null)
            {
                HCSWF_set_choose chooseDialog = new HCSWF_set_choose(PdCode);
                chooseDialog.ShowDialog();
                if (chooseDialog.SelectItems != null)
                {
                    setDataGrid.ClearSelection();
                    for (int i = 0; i < chooseDialog.SelectItems.Count; i++)
                    {
                        DataRow item    = chooseDialog.SelectItems[i] as DataRow;
                        bool    isExist = false;

                        foreach (DataGridViewRow row in setDataGrid.Rows)
                        {
                            if (setDataGrid.Columns.Contains("setBarCodeCol") && row.Cells["setBarCodeCol"] != null &&
                                row.Cells["setBarCodeCol"].Value != null && item["bar_code"] != null &&
                                row.Cells["setBarCodeCol"].Value.ToString() == item["bar_code"].ToString())
                            {
                                isExist      = true;
                                row.Selected = isExist;
                                break;
                            }
                        }
                        if (!isExist)
                        {
                            int rowIndex = DataConverter.ConvertSetData(setDataGrid, item);
                            setDataGrid.Rows[rowIndex].Selected = true;
                            string bccCode = setDataGrid.Rows[rowIndex].Cells["setBarCodeCol"].Value.ToString();
                            string bcuCode = string.Empty;
                            if (item.Table.Columns.Contains("bcuCode") && !(item["bcuCode"] is DBNull))
                            {
                                bcuCode = item["bcuCode"].ToString();
                            }
                            string key = string.IsNullOrEmpty(bcuCode) ? bccCode : CnasUtilityTools.ConcatTwoString(bcuCode, bccCode);
                            if (!ScanBarCodes.ContainsKey(key))
                            {
                                ScanBarCodes.Add(key, key.Substring(0, 3));
                            }
                        }
                    }
                    TextBox setNumTxt = CnasUtilityTools.FindControl <TextBox>(this, "setNumTxt");
                    if (setNumTxt != null)
                    {
                        setNumTxt.Text = setDataGrid.RowCount.ToString();
                    }
                }
            }
            else
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("notfindSetGrid", EnumPromptMessage.error), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        public HCSWF_parameters_select(string strwfid, SortedList sl_par02, DataTable dtpartvaluedata)
        {
            InitializeComponent();
            Icon        = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO));
            str_wfid    = strwfid;
            dtpartvalue = dtpartvaluedata;

            //HCS-pdparametervalue-sec04
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, strwfid);
            //string aaa = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-pdparametervalue-sec04", sttemp01);
            dtpartvalueconfig = reCnasRemotCall.RemotInterface.SelectData("HCS-pdparametervalue-sec04", sttemp01);
            if (dtpartvalueconfig == null)
            {
                MessageBox.Show(this, "编号为“" + str_wfid + "”的流程配置参数错误,请联系管理员!!!", "信息提示");
                Int_rec            = -1;
                DialogResultStatus = 3;
            }
            else
            {
                //开始第一个参数选择
                _dialogResultStatus = 1;
                mlab_next.Text      = dtpartvalueconfig.Rows[0]["par_description"].ToString();
                Current_parcode     = dtpartvalueconfig.Rows[0]["par_code"].ToString();
                str_next_code       = dtpartvalueconfig.Rows[0]["next_code"].ToString();
                str_parname         = dtpartvalueconfig.Rows[0]["par_name"].ToString();
                DataRow[] arrayDR = dtpartvalue.Select("par_code='" + Current_parcode + "'");

                mcb_result.Items.Clear();
                SortedList sl_picdata = new SortedList();
                foreach (DataRow dr in arrayDR)
                {
                    if (IsExitParcodeValue(Current_parcode, Convert.ToString(dr["v_value"])))
                    {
                        mcb_result.Items.Add(CnasUtilityTools.ConcatTwoString(dr["v_value"].ToString(), dr["v_name"].ToString()));
                        sl_picdata.Add("BCXP90000000" + dr["v_value"].ToString(), dr["v_name"].ToString());
                    }
                }
                //默认选择为第一个
                if (mcb_result.Items.Count > 0)
                {
                    mcb_result.SelectedIndex = 0;
                    this.AutoImage(sl_picdata);
                }
            }
            InitializeButtonImage();
            if (_scanerHook == null)
            {
                _scanerHook = new BarCodeHook();
            }
            _scanerHook.Start(false);
            _scanerHook.BarCodeEvent += OnBarCodeEvent;
        }
Ejemplo n.º 5
0
 private string select_nextpardata(string in_strcuparcode, string in_value)
 {
     DataRow[] arrayDR01 = dtpartvalueconfig.Select("par_code='" + in_strcuparcode + "' and v_value='" + in_value + "'");
     if (arrayDR01.Length < 1)
     {
         return("");
     }
     else
     {
         selectPanel.Controls.Clear();
         mcb_result.Items.Clear();
         string str_01 = arrayDR01[0]["next_code"].ToString();
         Current_parcode = str_01.Substring(1);
         if (str_01.Length > 0 && str_01.Substring(0, 1) == "A")
         {
             //显示下一个参数按键
             DataRow[]  arrayDR    = dtpartvalue.Select("par_code='" + Current_parcode + "'");
             SortedList sl_picdata = new SortedList();
             foreach (DataRow dr in arrayDR)
             {
                 if (IsExitParcodeValue(Current_parcode, Convert.ToString(dr["v_value"])))
                 {
                     mcb_result.Items.Add(CnasUtilityTools.ConcatTwoString(dr["v_value"].ToString(), dr["v_name"].ToString()));
                     sl_picdata.Add("BCXP90000000" + dr["v_value"].ToString(), dr["v_name"].ToString());
                 }
             }
             if (sl_picdata.Count > 0)
             {
                 mcb_result.SelectedIndex = 0;
                 this.AutoImage(sl_picdata);
             }
             DataRow[] arrayDR03 = dtpartvalueconfig.Select("par_code='" + Current_parcode + "'");
             if (arrayDR03 != null && arrayDR03.Count() > 0)
             {
                 str_par_description = arrayDR03[0]["par_description"].ToString();
                 str_parname         = arrayDR03[0]["par_name"].ToString();
                 mlab_next.Text      = str_par_description;
             }
             else
             {
                 str_01 = "99";                        //表示流程配置错误
             }
         }
         return(str_01);
     }
 }
Ejemplo n.º 6
0
        public void PrintBCUCode()
        {
            if (WorkflowServer != null)
            {
                SortedList parameters = new SortedList();
                if (string.IsNullOrEmpty(_bcuCode))
                {
                    _bcuCode = WorkflowServer.Get_BCU_Code(PdCode, Convert.ToString(setNameTxt.Tag));
                }
                DateTime createDate = DateTime.Now;

                parameters.Add("BarcodeValue", _bcuCode);
                parameters.Add("P014", _bcuCode);
                parameters.Add("P017", _createDate.ToString("yyyy-MM-dd"));
                parameters.Add("P018", _createDate.AddDays(_expirationTime).ToString("yyyy-MM-dd"));
                parameters.Add("P019", userNameTxt.Text.Trim());
                parameters.Add("P020", txtConfirmName.Text.Trim());
                parameters.Add("P013", Convert.ToString(setNameTxt.Text));
                parameters.Add("P016", Convert.ToString(useLocationTxt.Text));
                string printResult = BarCodeHelper.PrintBarCode(_bcuCode, parameters);
                if (!string.IsNullOrEmpty(printResult))
                {
                    MessageBox.Show(printResult, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    _isPrintedBCU = true;
                }

                string key = CnasUtilityTools.ConcatTwoString(_bcuCode, Convert.ToString(setNameTxt.Tag));
                if (ScanBarCodes.ContainsKey(Convert.ToString(setNameTxt.Tag)))
                {
                    ScanBarCodes.Remove(Convert.ToString(setNameTxt.Tag));
                }
                if (!ScanBarCodes.ContainsKey(key))
                {
                    ScanBarCodes.Add(key, "BCU");
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CnasMain_Load(object sender, EventArgs e)
        {
            //设置窗体图标
            this.Icon = new Icon(ResourcesImageHelper.Instance.GetResourcesStream("Common.icon", "MainIco", EnumImageType.ICO));



            this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true);         // 双缓冲

            this.pnlBackground.BorderStyle = BorderStyle.None;
            this.radPageViewContent.ViewElement.ShowItemCloseButton = true;

            //更换皮肤
            //ThemeResolutionService.ApplyThemeToControlTree(this, "Windows7");

            //Telerik.WinControls.Themes.Office2010BlueTheme s = new Telerik.WinControls.Themes.Office2010BlueTheme();

            //Telerik.WinControls.Themes.TelerikMetroBlueTheme buleTheme = new Telerik.WinControls.Themes.TelerikMetroBlueTheme();

            Telerik.WinControls.Themes.Office2007SilverTheme officeTheme = new Telerik.WinControls.Themes.Office2007SilverTheme();

            this.ApplyTheme(officeTheme.ThemeName);

            //this.radPageViewContent.ThemeName = s.ThemeName;
            this.radPageViewContent.ThemeName = officeTheme.ThemeName;

            //this.LeftMenu.ThemeName = s.ThemeName;
            this.LeftMenu.ThemeName = officeTheme.ThemeName;

            //this.toolLeft.AllowedDockState &= ~AllowedDockState.All;
            //this.toolLeft.AllowedDockState &= ~AllowedDockState.Floating;
            //this.toolLeft.AllowedDockState &= ~AllowedDockState.TabbedDocument;

            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();

            sttemp01.Add(1, CnasBaseData.SystemID);
            //一级目录菜单
            dtappall = reCnasRemotCall.RemotInterface.SelectData("HCS-app-sec001", sttemp01);
            SortedList sttemp02 = new SortedList();

            sttemp02.Add(1, CnasBaseData.UserName);

            //string aa = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-user_app-sec001", sttemp02);

            //二级目录菜单
            dtappuser = reCnasRemotCall.RemotInterface.SelectData("HCS-user_app-sec001", sttemp02);

            string up1 = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-app-sec001", sttemp01);
            string up2 = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-user_app-sec001", sttemp02);

            //判断一级二级目录是否有值
            if (dtappall != null && dtappuser != null)
            {
                #region 插入一级目录树
                DataRow[] arrayDR = dtappall.Select("app_type=0");
                foreach (DataRow dr in arrayDR)
                {
                    RadPageViewPage rpvPage = new RadPageViewPage();

                    rpvPage.Font = new Font(rpvPage.Font.FontFamily, 11);

                    rpvPage.Name          = dr["app_name"].ToString().Trim();
                    rpvPage.Tag           = dr["app_code"].ToString().Trim();
                    rpvPage.Image         = ResourcesImageHelper.Instance.GetResourcesImage("MenuIcon", dr["app_code"].ToString());
                    rpvPage.TextAlignment = ContentAlignment.MiddleCenter;
                    this.LeftMenu.Pages.Add(rpvPage);
                }

                #endregion

                #region 插入二级目录树

                try
                {
                    //插入二级目录
                    for (int i = 0; i < dtappuser.Rows.Count; i++)
                    {
                        string str_id = dtappuser.Rows[i]["app_id"].ToString();
                        //获得数据的详细数据
                        DataRow[] arrayDRdata = dtappall.Select("id=" + str_id);
                        if (arrayDRdata.Count() <= 0 || arrayDRdata[0]["state"].ToString() == "0")
                        {
                            continue;
                        }
                        string appBreifCode   = arrayDRdata[0]["app_briefcode"].ToString();
                        string str_app_code   = arrayDRdata[0]["app_code"].ToString();
                        string str_app_name   = arrayDRdata[0]["app_name"].ToString();
                        string str_app_parent = arrayDRdata[0]["app_parent"].ToString();
                        string str_app_ico    = arrayDRdata[0]["app_ico"].ToString();
                        string str_app_file   = arrayDRdata[0]["app_file"].ToString();

                        try
                        {
                            //获取父级的菜单
                            DataRow[] dtData     = dtappall.Select("app_code='" + str_app_parent + "'");
                            string    parentName = dtData[0]["app_name"].ToString().Trim();

                            RadPageViewPage parentPage = this.LeftMenu.Pages[parentName];


                            parentPage.Font = new Font(parentPage.Font.FontFamily, 11);


                            parentPage.AutoScroll = true;

                            RadLabel radLi = new RadLabel();

                            radLi.Font = LeftMenu.Font;

                            radLi.AutoSize = false;

                            radLi.Image          = ResourcesImageHelper.Instance.GetResourcesImage("MenuIcon", str_app_code);
                            radLi.ImageAlignment = ContentAlignment.TopCenter;

                            //radLi.TextImageRelation = TextImageRelation.Overlay;

                            radLi.Height = 70;
                            radLi.Width  = parentPage.Width - 10;

                            radLi.Text          = str_app_name;
                            radLi.TextAlignment = ContentAlignment.BottomCenter;

                            radLi.Tag = CnasUtilityTools.ConcatTwoString(appBreifCode, str_app_code);

                            radLi.Cursor = System.Windows.Forms.Cursors.Hand;
                            radLi.Click += radLi_Click;
                            //radLi.Left = 5;

                            if (parentPage.Controls.Count == 0)
                            {
                                radLi.Top = 10;
                            }
                            else
                            {
                                radLi.Top = parentPage.Controls.Count * 82;
                            }


                            parentPage.Controls.Add(radLi);
                            slappfile.Add(CnasUtilityTools.ConcatTwoString(appBreifCode, str_app_code), str_app_file);
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
                catch (Exception ex)
                {
                }
                #endregion
            }
            else
            {
                MessageBox.Show("对不起!请联系管理员先配置用户权限。");
            }
            this.Resize += CnasMain_Resize;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 初始化包装下框
        /// </summary>
        public void InitializeMaterialCbx()
        {
            materialCbx.Items.Clear();
            SortedList condition = new SortedList();

            condition.Add(1, CnasBaseData.SystemID);
            //string sqlTest = remoteClient.RemotInterface.CheckSelectData("HCS-setmaterial-type-sec001", condition);
            DataTable data = remoteClient.RemotInterface.SelectData("HCS-setmaterial-type-sec001", condition);

            if (data != null && data.Rows.Count > 0)
            {
                foreach (DataRow item in data.Rows)
                {
                    string id          = item["id"].ToString();
                    string name        = item["ca_name"].ToString();
                    string exipireDate = item["expiration_day"].ToString();
                    KeyValuePair <string, string> cbxItem = new KeyValuePair <string, string>(CnasUtilityTools.ConcatTwoString(id, exipireDate), name);
                    materialCbx.Items.Add(cbxItem);
                }
                materialCbx.SelectedIndex = 0;
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 提交流程
        /// </summary>
        /// <returns></returns>
        private bool CommitData()
        {
            bool result = false;

            try
            {
                if (dataGrid.RowCount > 0)
                {
                    SortedList sqlParameter = new SortedList();
                    SortedList workSets     = new SortedList();
                    SortedList workSetInfos = new SortedList();
                    sqlParameter.Add(1, workSets);
                    sqlParameter.Add(2, workSetInfos);
                    DateTime creDate  = DateTime.Now;
                    string   batchNum = string.Empty;
                    foreach (DataGridViewRow row in dataGrid.Rows)
                    {
                        batchNum = Convert.ToString(row.Cells["batchCol"].Value);
                        string     bccCode     = Convert.ToString(row.Cells["tempCodeCol"].Value);
                        string     bcuCode     = Convert.ToString(row.Cells["pbCodeCol"].Value);
                        SortedList workSet     = new SortedList();
                        SortedList workSetInfo = new SortedList();
                        workSet.Add(1, row.Cells["idCol"].Value);
                        workSet.Add(2, row.Cells["tempCodeCol"].Value);
                        workSet.Add(3, row.Cells["setNameCol"].Value);
                        workSet.Add(4, PdCode);
                        workSet.Add(5, packUserTxt.Tag != null ? packUserTxt.Tag : 0);
                        workSet.Add(6, row.Cells["batchCol"].Value);
                        workSet.Add(7, creDate.ToString("yyyy-MM-dd"));
                        workSet.Add(8, "");
                        workSet.Add(9, "");
                        workSet.Add(10, row.Cells["pbCodeCol"].Value);
                        workSet.Add(11, cfmUserTxt.Tag != null ? cfmUserTxt.Tag : 0);
                        workSets.Add(workSets.Count + 1, workSet);

                        workSetInfo.Add(1, row.Cells["batchCol"].Value);
                        workSetInfo.Add(2, "BCU");
                        workSetInfo.Add(3, CnasUtilityTools.ConcatTwoString(bcuCode, bccCode));
                        workSetInfo.Add(4, 3);
                        workSetInfo.Add(5, packUserTxt.Tag != null ? packUserTxt.Tag : 0);
                        workSetInfo.Add(6, "");
                        workSetInfos.Add(workSetInfos.Count + 1, workSetInfo);
                    }
                    SortedList dealCounts = new SortedList();
                    sqlParameter.Add(3, dealCounts);
                    //if (_packageType==2)
                    //{
                    //	SortedList dealCount = new SortedList();
                    //	dealCounts.Add(dealCounts.Count + 1, dealCount);
                    //	dealCount.Add(1, batchNum);
                    //	dealCount.Add(2, AppId);
                    //	dealCount.Add(3, packUserTxt.Tag != null ? packUserTxt.Tag : 0);
                    //	dealCount.Add(4, CnasBaseData.SystemID);
                    //	dealCount.Add(5, batchNum);
                    //}

                    string testSQL = remoteClient.RemotInterface.CheckUPDataList("HCS-workset-add008", sqlParameter);
                    int    rect    = remoteClient.RemotInterface.UPDataList("HCS-workset-add008", sqlParameter);
                    if (rect > 0)
                    {
                        for (int i = 0; i < ScanBarCodes.Count; i++)
                        {
                            if (ScanBarCodes.GetKey(i).ToString().StartsWith("BCU"))
                            {
                                ScanBarCodes.RemoveAt(i);
                                i--;
                            }
                        }
                        foreach (DataGridViewRow row in dataGrid.Rows)
                        {
                            string bccCode = row.Cells["tempCodeCol"].Value != null ? row.Cells["tempCodeCol"].Value.ToString() : string.Empty;
                            string bcuCode = row.Cells["pbCodeCol"].Value != null ? row.Cells["pbCodeCol"].Value.ToString() : string.Empty;
                            string key     = CnasUtilityTools.ConcatTwoString(bcuCode, bccCode);
                            if (!ScanBarCodes.ContainsKey(key))
                            {
                                ScanBarCodes.Add(key, "BCU");
                            }
                        }
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            catch (Exception)
            {
            }
            return(result);
        }
Ejemplo n.º 10
0
        public HCSRS_outside_set()
        {
            InitializeComponent();
            this.but_instrument.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "lookinstrument", EnumImageType.PNG);
            this.but_set.Image        = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "lookset", EnumImageType.PNG);
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            //获取客户表的数据
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-customer-sec002", null);

            if (getdt != null)
            {
                foreach (DataRow item in getdt.Rows)
                {
                    if (item["id"].ToString() != null && item["cu_name"].ToString().Trim() != null && item["bar_code"].ToString().Trim() != null)
                    {
                        RadListDataItem cbxItem = new RadListDataItem(item["cu_name"].ToString().Trim(), CnasUtilityTools.ConcatTwoString(item["id"].ToString().Trim(), item["bar_code"].ToString().Trim()));
                        cb_customer.Items.Add(cbxItem);
                    }
                }
                cb_customer.SelectedIndex = 0;
                cb_customer_TextChanged(null, null);
            }
        }
Ejemplo n.º 11
0
        private SortedList GenerateSQLParameter(ref string message)
        {
            SortedList sqlParameter              = new SortedList();
            SortedList sendOrderInfos            = new SortedList();
            SortedList updateWorkSets            = new SortedList();
            SortedList insertWorkSets            = new SortedList();
            SortedList updateWorkSpecialsetInfos = new SortedList();
            SortedList insertWorkSetInfos        = new SortedList();
            SortedList updateOrders              = new SortedList();

            sqlParameter.Add(1, sendOrderInfos);
            sqlParameter.Add(2, updateWorkSets);
            sqlParameter.Add(3, insertWorkSets);
            sqlParameter.Add(4, updateWorkSpecialsetInfos);
            sqlParameter.Add(5, insertWorkSetInfos);
            sqlParameter.Add(6, updateOrders);

            CnasRemotCall remoteCall = new CnasRemotCall();

            _sendOrderNum = GetSendOrderNum();
            string infoSerial = remoteCall.RemotInterface.Get_SerialNumber(1);
            string sendBatch = remoteCall.RemotInterface.Get_SerialNumber(2);
            int    doneCount = 0, totalSendNum = 0;

            foreach (DataGridViewRow row in dgv_Instrument.Rows)
            {
                string sendType       = Convert.ToString(row.Cells["codeType"].Value);           //codeType
                string subSendType    = Convert.ToString(row.Cells["c_codeType"].Value);
                string instrumentName = Convert.ToString(row.Cells["ca_name"].Value);
                string instrumentCode = Convert.ToString(row.Cells["instrument_code"].Value);
                string id             = Convert.ToString(row.Cells["id"].Value);
                int    sendNum        = 0;
                int.TryParse(Convert.ToString(row.Cells["send_count_now"].Value), out sendNum);
                int sentNum = 0;
                int.TryParse(Convert.ToString(row.Cells["send_count"].Value), out sentNum);
                int totalNum = 0;
                int.TryParse(Convert.ToString(row.Cells["num"].Value), out totalNum);
                totalSendNum += sendNum;

                if (totalNum >= sendNum + sentNum)
                {
                    if (sendNum + sentNum == totalNum)
                    {
                        doneCount++;
                    }
                }
                else
                {
                    message = string.Format("{0}发放的数量:不能超过{1}", instrumentName, totalNum - sentNum);
                    return(sqlParameter);
                }

                SortedList updateWorkSpecialsetInfo = GetUpdateWorkSpecialsetInfo((sendNum + sentNum).ToString(), id, sendType);
                updateWorkSpecialsetInfos.Add(updateWorkSpecialsetInfos.Count + 1, updateWorkSpecialsetInfo);

                if (sendNum > 0)
                {
                    SortedList sendOrderInfo = GetInsertSendOrderInfoList(_sendOrderNum, sendBatch, sendType, subSendType, "", "", instrumentName, sendNum.ToString(), _acceptDealWF, instrumentCode);
                    sendOrderInfos.Add(sendOrderInfos.Count + 1, sendOrderInfo);
                }
            }

            if (totalSendNum <= 0)
            {
                message = string.Format("此次数量必须超过0");
                return(sqlParameter);
            }

            if (doneCount == dgv_Instrument.RowCount)
            {
                SortedList UpOrderStatus = new SortedList();
                UpOrderStatus.Add(1, _tempStorageWF);
                UpOrderStatus.Add(2, txtOrderNum.Text);
                UpOrderStatus.Add(3, txtOrderNum.Text);
                updateOrders.Add(updateOrders.Count + 1, UpOrderStatus);
            }

            foreach (DataGridViewRow row in dgv_BcuData.Rows)
            {
                string     bccCode       = Convert.ToString(Convert.ToString(row.Cells["t_b_bar_code"].Value));
                string     bcuCode       = Convert.ToString(Convert.ToString(row.Cells["b_bar_code"].Value));
                string     setName       = Convert.ToString(Convert.ToString(row.Cells["b_ca_name"].Value)).Trim();
                string     subSendType   = Convert.ToString(Convert.ToString(row.Cells["setTypeCol"].Value));
                string     sendType      = subSendType.Substring(0, 1);
                SortedList sendOrderInfo = GetInsertSendOrderInfoList(_sendOrderNum, sendBatch, sendType, subSendType, bccCode, bcuCode, setName, "1", _acceptDealWF, "");
                sendOrderInfos.Add(sendOrderInfos.Count + 1, sendOrderInfo);

                SortedList updateWorkSet = GetUpdateWorkSet(_sendOrderNum, _batch, infoSerial, bccCode);
                updateWorkSets.Add(updateWorkSets.Count + 1, updateWorkSet);
                SortedList insertWorkSet = GetInsertWorkSet(_acceptDealWF, "", _sendOrderNum, _batch, bccCode);
                insertWorkSets.Add(insertWorkSets.Count + 1, insertWorkSet);

                SortedList insertWorkSetInfo = GetInsertWorkSetInfo(infoSerial, bcuCode.Substring(0, 3), CnasUtilityTools.ConcatTwoString(bcuCode, bccCode), "3", "");
                insertWorkSetInfos.Add(insertWorkSetInfos.Count + 1, insertWorkSetInfo);
            }

            SortedList insertWorkSetInfoBCO = GetInsertWorkSetInfo(infoSerial, _sendOrderNum.Substring(0, 3), _sendOrderNum, "3", "");

            insertWorkSetInfos.Add(insertWorkSetInfos.Count + 1, insertWorkSetInfoBCO);

            return(sqlParameter);
        }
 private void GetDialogGridParameters()
 {
     if (_workFlowView != null)
     {
         DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(_workFlowView, "setDataGrid") as DataGridView;
         if (setDataGrid != null && setDataGrid.Rows.Count > 0 && setDataGrid.Columns.Contains("setBarCodeCol") &&
             _workFlowView.WorkflowServer != null && !CnasUtilityTools.IsContains(_workFlowView.WorkflowServer.Unload_container_wf, PdCode))
         {
             SortedList bccCodeList = new SortedList();
             for (int i = 0; i < setDataGrid.Rows.Count; i++)
             {
                 DataGridViewRow dataRow    = setDataGrid.Rows[i];
                 DataRow         item       = dataRow.Tag as DataRow;
                 string          bccbarCode = Convert.ToString(dataRow.Cells["setBarCodeCol"].Value);
                 string          bccSetName = Convert.ToString(dataRow.Cells["setNameCol"].Value);
                 string          bcuCode    = item.Table.Columns.Contains("BCU_Code") ? Convert.ToString(item["BCU_Code"]) : string.Empty;
                 string          key        = string.IsNullOrEmpty(bcuCode) ? bccbarCode : CnasUtilityTools.ConcatTwoString(bcuCode, bccbarCode);
                 if (!string.IsNullOrEmpty(key))
                 {
                     if (!bccCodeList.ContainsKey(key))
                     {
                         bccCodeList.Add(key, dataRow.Tag);
                     }
                 }
             }
             if (bccCodeList != null && bccCodeList.Count > 0)
             {
                 if (OutputParameters.ContainsKey("DialogGridParamters"))
                 {
                     OutputParameters["DialogGridParamters"] = bccCodeList;
                 }
                 else
                 {
                     OutputParameters.Add("DialogGridParamters", bccCodeList);
                 }
             }
         }
     }
 }
Ejemplo n.º 13
0
        private SortedList sl_costcenter = new SortedList();//存储barcode,成本中心
        public HCSRS_cost_accounting()
        {
            InitializeComponent();

            this.but_import.Image = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "batchImportOld", EnumImageType.PNG);
            this.but_print.Image  = ResourcesImageHelper.Instance.GetResourcesImage("Common.Buttom", "printList", EnumImageType.PNG);
            //this.Font = new Font(this.Font.FontFamily, 11);
            ////表格栏底色
            //dgv_01.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
            //dgv_01.RowsDefaultCellStyle.BackColor = Color.White;
            ////DGV表格首行字段居中对齐
            //dgv_01.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            //dgv_01.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            //获取客户表的数据
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-customer-sec002", null);

            if (getdt != null)
            {
                foreach (DataRow item in getdt.Rows)
                {
                    if (item["id"].ToString() != null && item["cu_name"].ToString().Trim() != null && item["bar_code"].ToString().Trim() != null)
                    {
                        RadListDataItem cbxItem = new RadListDataItem(item["cu_name"].ToString().Trim(), CnasUtilityTools.ConcatTwoString(item["id"].ToString().Trim(), item["bar_code"].ToString().Trim()));
                        cb_customer.Items.Add(cbxItem);
                    }
                    cb_customer.SelectedIndex = 0;
                }
            }
            //cb_customer.Text = getdt.Rows[0]["cu_name"].ToString().Trim();
            //给年份的下拉列表赋值
            int index = 0;

            for (int i = 2000; i < DateTime.Now.Year + 1; i++)
            {
                RadListDataItem cbxItem = new RadListDataItem(i.ToString(), i.ToString());

                cb_year.Items.Add(cbxItem);
                if (i == DateTime.Now.Year)
                {
                    cb_year.SelectedIndex = index;
                }
                index++;
            }
            //给月份的下拉列表赋值
            for (int i = 1; i < 13; i++)
            {
                RadListDataItem cbxItem = new RadListDataItem(i.ToString(), i.ToString());
                cb_month.Items.Add(cbxItem);
                if (i == DateTime.Now.Month)
                {
                    cb_month.SelectedIndex = i - 1;
                }
            }
        }
Ejemplo n.º 14
0
        public void AddOrders()
        {
            DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid");

            if (setDataGrid != null)
            {
                HCSWF_order_choose orderChoose = new HCSWF_order_choose(PdCode);
                orderChoose.ShowDialog();
                if (orderChoose.SelectItems != null)
                {
                    setDataGrid.ClearSelection();
                    for (int i = 0; i < orderChoose.SelectItems.Count; i++)
                    {
                        DataRow item    = orderChoose.SelectItems[i] as DataRow;
                        bool    isExist = false;
                        foreach (DataGridViewRow row in setDataGrid.Rows)
                        {
                            if (row.Cells["setBarCodeCol"].Value != null && item["bar_code"] != null &&
                                row.Cells["setBarCodeCol"].Value.ToString() == item["bar_code"].ToString())
                            {
                                isExist      = true;
                                row.Selected = isExist;
                                break;
                            }
                        }
                        if (!isExist)
                        {
                            int rowIndex = setDataGrid.Rows.Add();
                            if (item.Table.Columns.Contains("id") && setDataGrid.Columns.Contains("setIdCol"))
                            {
                                setDataGrid.Rows[rowIndex].Cells["setIdCol"].Value = item["id"];
                            }
                            if (item.Table.Columns.Contains("bar_code") && setDataGrid.Columns.Contains("setBarCodeCol"))
                            {
                                setDataGrid.Rows[rowIndex].Cells["setBarCodeCol"].Value = item["bar_code"];
                            }
                            if (item.Table.Columns.Contains("ca_name") && setDataGrid.Columns.Contains("setNameCol"))
                            {
                                setDataGrid.Rows[rowIndex].Cells["setNameCol"].Value = item["ca_name"];
                            }
                            if (item.Table.Columns.Contains("order_type") && setDataGrid.Columns.Contains("setTypeCol"))
                            {
                                setDataGrid.Rows[rowIndex].Cells["setTypeCol"].Value = item["order_type"];
                            }
                            if (item.Table.Columns.Contains("pa_priorty") && setDataGrid.Columns.Contains("setPriortyCol"))
                            {
                                setDataGrid.Rows[rowIndex].Cells["setPriortyCol"].Value = item["pa_priorty"];
                            }
                            if (item.Table.Columns.Contains("location_name") && setDataGrid.Columns.Contains("setUseLoCol"))
                            {
                                setDataGrid.Rows[rowIndex].Cells["setUseLoCol"].Value = item["location_name"];
                            }
                            setDataGrid.Rows[rowIndex].Tag      = item;
                            setDataGrid.Rows[rowIndex].Selected = true;
                            string bccCode = setDataGrid.Rows[rowIndex].Cells["setBarCodeCol"].Value.ToString();
                            string bcuCode = string.Empty;
                            if (item.Table.Columns.Contains("bcuCode") && !(item["bcuCode"] is DBNull))
                            {
                                bcuCode = item["bcuCode"].ToString();
                            }
                            string key = string.IsNullOrEmpty(bcuCode) ? bccCode : CnasUtilityTools.ConcatTwoString(bcuCode, bccCode);
                            if (!ScanBarCodes.ContainsKey(key))
                            {
                                ScanBarCodes.Add(key, key.Substring(0, 3));
                            }
                        }
                    }

                    TextBox setNumTxt = CnasUtilityTools.FindControl <TextBox>(this, "setNumTxt");
                    if (setNumTxt != null)
                    {
                        setNumTxt.Text = setDataGrid.RowCount.ToString();
                    }
                }
            }
        }
Ejemplo n.º 15
0
        public virtual string HandleScanBarCode(string barCode)
        {
            HasManualHandle = false;

            if (barCode.StartsWith("BCC") || barCode.StartsWith("BCU"))
            {
                DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid") as DataGridView;
                if (setDataGrid != null && setDataGrid.Rows.Count > 0 && setDataGrid.Columns.Contains("setBarCodeCol"))
                {
                    bool isExit = false;
                    if (barCode.StartsWith("BCC") || barCode.StartsWith("BCU"))
                    {
                        string bccCode = barCode;
                        string keyCode = barCode;
                        if (barCode.StartsWith("BCU"))
                        {
                            SortedList sttemp01 = new SortedList();
                            sttemp01.Add(1, barCode);
                            string    testBcuSql = RemoteClient.RemotInterface.CheckSelectData("HCS-workset-sec004", sttemp01);
                            DataTable dataBcu    = RemoteClient.RemotInterface.SelectData("HCS-workset-sec004", sttemp01);
                            if (dataBcu == null || (dataBcu != null && dataBcu.Rows.Count == 0))
                            {
                                return("找不到该标签条码对应的器械包。");
                            }
                            else
                            {
                                bccCode = Convert.ToString(dataBcu.Rows[0]["set_code"]);
                                keyCode = CnasUtilityTools.ConcatTwoString(barCode, bccCode);
                            }
                        }
                        setDataGrid.ClearSelection();
                        for (int i = 0; i < setDataGrid.Rows.Count; i++)
                        {
                            string tempBar_Code = Convert.ToString(setDataGrid.Rows[i].Cells["setBarCodeCol"].Value);
                            if (tempBar_Code.Equals(bccCode))
                            {
                                setDataGrid.Rows[i].Selected = true;
                                isExit = true;
                                return("该条码已经存在,帮助你找到");
                            }
                        }
                        if (!isExit)
                        {
                            SortedList condition = new SortedList();
                            condition.Add(1, PdCode);
                            condition.Add(2, "0");
                            condition.Add(3, bccCode);
                            string    testSql = RemoteClient.RemotInterface.CheckSelectData("HCS-work-set-sec003", condition);
                            DataTable dataBcc = RemoteClient.RemotInterface.SelectData("HCS-work-set-sec003", condition);
                            if (dataBcc != null && dataBcc.Rows.Count == 1)
                            {
                                DataConverter.ConvertSetData(setDataGrid, dataBcc.Rows[0]);
                                setDataGrid.Rows[setDataGrid.Rows.Count - 1].Selected = true;
                                ScanBarCodes.Add(keyCode, keyCode.Substring(0, 3));
                                //if (_outputParametersAdd != null && !_outputParametersAdd.ContainsKey(bccCode))
                                //{
                                //	_outputParametersAdd.Add(bccCode, barCode);
                                //}
                            }
                            else
                            {
                                return("条码错误,请联系管理员");
                            }
                        }
                    }
                    TextBox setNumTxt = CnasUtilityTools.FindControl <TextBox>(this, "setNumTxt");
                    if (setNumTxt != null)
                    {
                        setNumTxt.Text = setDataGrid.RowCount.ToString();
                    }
                }
                return(PromptMessageXmlHelper.Instance.GetPromptMessage("scanpass", EnumPromptMessage.error));
            }

            return(PromptMessageXmlHelper.Instance.GetPromptMessage("scanpass", EnumPromptMessage.warning));
        }