Beispiel #1
0
        private void but_ok_Click_1(object sender, EventArgs e)
        {
            #region 验证
            if (this.tb_name.Text.Trim() == "")
            {
                MessageBox.Show("请填写灭菌流程名称。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.cb_program.Text.Trim() == "")
            {
                MessageBox.Show("请选择灭菌程序。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (tb_run_time.Text.Trim() == "")
            {
                MessageBox.Show("请填写运行时间。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.cb_type.SelectedItem == null)
            {
                MessageBox.Show("请选择灭菌类型。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //如果运行时间不为null,则表示需要验证输入的值是否正确
            if (!string.IsNullOrEmpty(tb_run_time.Text))
            {
                //如果用户输入的值不为正整数,则提示用户
                if (!CnasUtilityTools.IsNumeric(tb_run_time.Text))
                {
                    MessageBox.Show("运行时间输入的格式不正确,请输入正整数。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }

            #endregion
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();
            sttemp01.Add(1, Sterilizer_id);
            //string ggg = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-sterilizer-deviceprogram-sec001", sttemp01);
            getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-sterilizer-deviceprogram-sec001", sttemp01);
            try
            {
                if (Strselectid == "")//增加
                {
                    #region 判断这台灭菌器的灭菌程序是否重复


                    if (getdt != null)
                    {
                        int ii = getdt.Rows.Count;
                        if (ii <= 0)
                        {
                            return;
                        }
                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt.Rows[i]["p_id"].ToString() != null)
                            {
                                if (sl_ProgramType.GetKey(sl_ProgramType.IndexOfValue(cb_program.Text.Trim())).ToString() == getdt.Rows[i]["p_id"].ToString().Trim())
                                {
                                    MessageBox.Show("灭菌程序已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }

                    #endregion
                    #region 判断流程名字是否重复
                    if (getdt != null)
                    {
                        int ii = getdt.Rows.Count;
                        if (ii < 0)
                        {
                            return;
                        }
                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt.Rows[i]["dp_name"].ToString() != null)
                            {
                                if (tb_name.Text.Trim().ToString() == getdt.Rows[i]["dp_name"].ToString().Trim())
                                {
                                    MessageBox.Show("流程名称已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }
                    #endregion
                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp.Add(1, sl_ProgramType.GetKey(sl_ProgramType.IndexOfValue(cb_program.Text.Trim())).ToString());
                    sltmp.Add(2, tb_barcode.Text.Trim());
                    sltmp.Add(3, tb_name.Text.Trim());
                    sltmp.Add(4, cb_type.Text.Trim().Substring(0, 1));
                    sltmp.Add(5, tb_run_time.Text.Trim());
                    sltmp.Add(6, tb_remarks.Text.Trim());
                    sltmp.Add(7, Sterilizer_id);
                    sltmp01.Add(1, sltmp);
                    int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-sterilizer-deviceprogram-add001", sltmp01, null);
                    if (recint > -1)
                    {
                        MessageBox.Show("恭喜你,增加成功。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
                else
                {
                    if (cb_program.Text.Trim() != program_name)//如果灭菌程序被改变执行
                    {
                        #region 判断这台灭菌器的灭菌程序是否重复
                        if (getdt != null)
                        {
                            int ii = getdt.Rows.Count;
                            if (ii <= 0)
                            {
                                return;
                            }
                            for (int i = 0; i < ii; i++)
                            {
                                if (getdt.Rows[i]["p_id"].ToString() != null)
                                {
                                    if (sl_ProgramType.GetKey(sl_ProgramType.IndexOfValue(cb_program.Text.Trim())).ToString() == getdt.Rows[i]["p_id"].ToString().Trim())
                                    {
                                        MessageBox.Show("灭菌程序已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                    #endregion

                    #region 判断流程名字是否存在
                    if (this.tb_name.Text.Trim() != Strselectname)
                    {
                        if (getdt != null)
                        {
                            int ii = getdt.Rows.Count;
                            if (ii <= 0)
                            {
                                return;
                            }
                            for (int i = 0; i < ii; i++)
                            {
                                if (getdt.Rows[i]["dp_name"].ToString() != null)
                                {
                                    if (tb_name.Text.Trim().ToString() == getdt.Rows[i]["dp_name"].ToString().Trim())
                                    {
                                        MessageBox.Show("流程名称已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        return;
                                    }
                                }
                            }
                        }
                    }

                    #endregion
                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp01.Add(1, tb_name.Text.Trim());
                    sltmp01.Add(2, sl_ProgramType.GetKey(sl_ProgramType.IndexOfValue(cb_program.Text.Trim())));
                    sltmp01.Add(3, cb_type.Text.Trim().Substring(0, 1));
                    sltmp01.Add(4, tb_run_time.Text.Trim());
                    sltmp01.Add(5, tb_remarks.Text.Trim());
                    sltmp01.Add(6, Strselectid);
                    sltmp.Add(1, sltmp01);
                    int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-sterilizer-deviceprogram-up001", sltmp, null);
                    if (recint > -1)
                    {
                        MessageBox.Show("恭喜你,修改成功。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("出现未知错误:" + ex.Message + ",请联系管理员。", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
Beispiel #2
0
 private void but_reall_Click(object sender, EventArgs e)
 {
     CnasUtilityTools.MoveData(dgv_01, dgv_02, false, false);
     enable();
 }
 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);
                 }
             }
         }
     }
 }
Beispiel #4
0
        private void but_ok_Click(object sender, EventArgs e)
        {
            if (this.tb_name.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillname", EnumPromptMessage.warning, new string[] { "客户" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (this.cb_type.Text == null)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("filltype", EnumPromptMessage.warning, new string[] { "医院" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (!string.IsNullOrEmpty(tb_telephone.Text))
            {
                //如果用户输入的值不为正整数,则提示用户
                if (!CnasUtilityTools.IsNumeric(tb_telephone.Text))
                {
                    MessageBox.Show("联系电话输入的格式不正确,请输入正整数。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            if (!string.IsNullOrEmpty(tb_mail.Text))
            {
                //如果用户输入的值不为邮箱,则提示用户
                if (!CnasUtilityTools.IsEmail(tb_mail.Text))
                {
                    MessageBox.Show("电子邮箱输入的格式不正确,请输入正确格式,如:[email protected]。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            if (tb_mail.Text.Trim() == null)
            {
                tb_mail.Text = "";
            }
            if (tb_telephone.Text.Trim() == null)
            {
                tb_mail.Text = "";
            }
            if (tb_contacts.Text.Trim() == null)
            {
                tb_mail.Text = "";
            }


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

            sttemp01.Add(1, CnasBaseData.SystemID);
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-customer-sec001", sttemp01);

            try
            {
                if (Strselectid == "")//insert data
                {
                    #region 判断名字是否存在
                    //39
                    if (getdt != null)
                    {
                        int ii = getdt.Rows.Count;
                        if (ii <= 0)
                        {
                            return;
                        }
                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt.Rows[i]["cu_name"].ToString().Trim() != null)
                            {
                                if (tb_name.Text.Trim().ToString() == getdt.Rows[i]["cu_name"].ToString().Trim())
                                {
                                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("namerepetition", EnumPromptMessage.warning, new string[] { "医院" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }
                    #endregion

                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp01.Add(1, tb_name.Text.Trim());
                    sltmp01.Add(2, tb_barcode.Text.Trim());
                    sltmp01.Add(3, tb_address.Text.Trim());
                    sltmp01.Add(4, cb_type.Text.Trim().Substring(0, 1));
                    sltmp01.Add(5, tb_contacts.Text.Trim());
                    sltmp01.Add(6, tb_telephone.Text.Trim());
                    sltmp01.Add(7, tb_mail.Text.Trim());
                    sltmp01.Add(8, CnasBaseData.SystemID);

                    sltmp.Add(1, sltmp01);

                    //string str = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-customer-add001", sltmp, null);
                    int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-customer-add001", sltmp, null);
                    if (recint > -1)
                    {
                        MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("addsuccessful", EnumPromptMessage.warning, new string[] { "客户" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        this.Close();
                    }
                }
                else//update date
                {
                    #region 判断名字是否存在

                    if (this.tb_name.Text.Trim() != Strselectname)
                    {
                        if (getdt != null)
                        {
                            int ii = getdt.Rows.Count;
                            if (ii <= 0)
                            {
                                return;
                            }
                            for (int i = 0; i < ii; i++)
                            {
                                if (getdt.Rows[i]["cu_name"].ToString().Trim() != null)
                                {
                                    if (tb_name.Text.Trim().ToString() == getdt.Rows[i]["cu_name"].ToString().Trim())
                                    {
                                        MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("namerepetition", EnumPromptMessage.warning, new string[] { "医院" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        return;
                                    }
                                }
                            }
                        }
                    }


                    #endregion
                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp01.Add(1, tb_name.Text.Trim());
                    sltmp01.Add(2, tb_address.Text.Trim());
                    sltmp01.Add(3, cb_type.Text.Trim().Substring(0, 1));
                    sltmp01.Add(4, tb_contacts.Text.Trim());
                    sltmp01.Add(5, tb_telephone.Text.Trim());
                    sltmp01.Add(6, tb_mail.Text.Trim());
                    sltmp01.Add(7, Strselectid);
                    sltmp.Add(1, sltmp01);
                    //CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                    string str    = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-customer-up001", sltmp, null);
                    int    recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-customer-up001", sltmp, null);
                    if (recint > -1)
                    {
                        MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("updatesuccessful", EnumPromptMessage.warning, new string[] { "客户" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("unknowerror", EnumPromptMessage.warning, new string[] { ex.Message }), "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
Beispiel #5
0
        private void but_OK_Click_1(object sender, EventArgs e)
        {
            if (this.tb_program.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillname", EnumPromptMessage.warning, new string[] { "灭菌程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.cb_type.Text == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("filltype", EnumPromptMessage.warning, new string[] { "灭菌" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (tb_run_time.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillruntime", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.tb_upper_level.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillhightemperature", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (!string.IsNullOrEmpty(tb_upper_level.Text))
            {
                //如果用户输入的值不为正整数,则提示用户
                if (!CnasUtilityTools.IsNumeric(tb_upper_level.Text))
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("inputformat", EnumPromptMessage.warning, new string[] { "温度上限", "123整数" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            if (this.tb_lower_level.Text.Trim() == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("filllowtemperature", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (!string.IsNullOrEmpty(tb_lower_level.Text))
            {
                //如果用户输入的值不为正整数,则提示用户
                if (!CnasUtilityTools.IsNumeric(tb_lower_level.Text))
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("inputformat", EnumPromptMessage.warning, new string[] { "温度下限", "123整数" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            if (int.Parse(tb_lower_level.Text) > int.Parse(tb_upper_level.Text))
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("tempestimation", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            try
            {
                if (Strselectid == "")//增加
                {
                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp.Add(1, tb_program.Text.Trim());
                    sltmp.Add(2, tb_barcode.Text.Trim());
                    sltmp.Add(3, cb_type.Text.Substring(0, 1));
                    sltmp.Add(4, tb_run_time.Text.Trim());

                    sltmp.Add(5, tb_remarks.Text.Trim());
                    sltmp.Add(6, tb_upper_level.Text.Trim());
                    sltmp.Add(7, tb_lower_level.Text.Trim());
                    sltmp01.Add(1, sltmp);
                    CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                    #region 判断名字是否存在


                    DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-sterilizer-program-sec002", null);//49
                    if (getdt != null)
                    {
                        DataRow[] getdt_01 = getdt.Select();
                        foreach (DataRow dr in getdt_01)
                        {
                            if (tb_program.Text.Trim().ToString() == dr["pr_name"].ToString().Trim())
                            {
                                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("namerepetition", EnumPromptMessage.warning, new string[] { "灭菌程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                return;
                            }
                        }
                    }
                    #endregion


                    int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-sterilizer-program-add001", sltmp01, null);
                    if (recint > -1)
                    {
                        MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("addsuccessful", EnumPromptMessage.warning, new string[] { "灭菌程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
                else
                {
                    #region 判断程序名字是否重复
                    CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                    if (tb_program.Text.Trim() != Strselectname)
                    {
                        DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-sterilizer-program-sec001", null);
                        if (getdt != null)
                        {
                            DataRow[] getdt_01 = getdt.Select();
                            foreach (DataRow dr in getdt_01)
                            {
                                if (tb_program.Text.Trim().ToString() == dr["pr_name"].ToString().Trim())
                                {
                                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("namerepetition", EnumPromptMessage.warning, new string[] { "灭菌程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }



                    #endregion

                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp01.Add(1, tb_program.Text.Trim());
                    sltmp01.Add(2, tb_upper_level.Text.Trim());
                    sltmp01.Add(3, tb_lower_level.Text.Trim());

                    sltmp01.Add(4, cb_type.Text.Substring(0, 1));
                    sltmp01.Add(5, tb_run_time.Text.Trim());
                    sltmp01.Add(6, tb_remarks.Text.Trim());
                    sltmp01.Add(7, Strselectid);
                    sltmp.Add(1, sltmp01);
                    string sql    = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-sterilizer-program-up001", sltmp, null);
                    int    recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-sterilizer-program-up001", sltmp, null);
                    if (recint > -1)
                    {
                        MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("updatesuccessful", EnumPromptMessage.warning, new string[] { "灭菌程序" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("unknowerror", EnumPromptMessage.error, new string[] { ex.Message }), "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void but_ok_Click(object sender, EventArgs e)
        {
            if (this.tb_name.Text.Trim() == "")
            {
                MessageBox.Show("请填写塑封机流程名称。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }


            if (this.cb_program.SelectedItem == null)
            {
                MessageBox.Show("请选择塑封程序。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (this.cb_type.SelectedItem == null)
            {
                MessageBox.Show("请选择塑封类型。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (this.tb_run_temp.Text.Trim() != "")
            {
                //如果用户输入的值不为正整数,则提示用户
                if (!CnasUtilityTools.IsNumeric(tb_run_temp.Text))
                {
                    MessageBox.Show("温度输入的格式不正确,请输入正整数。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }



            try
            {
                CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                SortedList    sttemp01        = new SortedList();
                sttemp01.Add(1, Washer_id);
                DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-plasticenvelop-deviceprogram-sec001", sttemp01); //91
                if (Strselectid == "")                                                                                            //增加
                {
                    #region 判断这台塑封机的塑封程序是否重复

                    if (getdt != null)
                    {
                        int ii = getdt.Rows.Count;
                        if (ii <= 0)
                        {
                            return;
                        }
                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt.Rows[i]["p_id"].ToString() != null)
                            {
                                if (sl_type_01.GetKey(sl_type_01.IndexOfValue(cb_program.Text.Trim())).ToString() == getdt.Rows[i]["p_id"].ToString().Trim())
                                {
                                    MessageBox.Show("塑封程序已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }
                    #endregion

                    #region 判断名字是否重复


                    if (getdt != null)
                    {
                        int ii = getdt.Rows.Count;
                        if (ii <= 0)
                        {
                            return;
                        }
                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt.Rows[i]["dp_name"].ToString() != null)
                            {
                                if (sl_type_01.GetKey(sl_type_01.IndexOfValue(cb_program.Text.Trim())).ToString() == getdt.Rows[i]["dp_name"].ToString().Trim())
                                {
                                    MessageBox.Show("流程名称已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }
                    #endregion
                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp.Add(1, tb_name.Text.Trim());

                    sltmp.Add(2, tb_barcode.Text.Trim());

                    sltmp.Add(3, sl_type_01.GetKey(sl_type_01.IndexOfValue(cb_program.Text.Trim())).ToString());

                    sltmp.Add(4, cb_type.Text.Trim().Substring(0, 1));
                    sltmp.Add(5, tb_run_temp.Text.Trim());
                    sltmp.Add(6, tb_run_speed.Text.Trim());
                    sltmp.Add(7, tb_run_stress.Text.Trim());
                    sltmp.Add(8, tb_remarks.Text.Trim());
                    sltmp.Add(9, Washer_id);
                    sltmp01.Add(1, sltmp);


                    string strtmp = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-plasticenvelop-deviceprogram-add001", sltmp01, null);
                    int    recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-plasticenvelop-deviceprogram-add001", sltmp01, null);
                    if (recint > -1)
                    {
                        MessageBox.Show("恭喜你,增加成功。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
                else
                {
                    if (cb_program.Text.Trim() != Program_name)//如果清洗程序被改变执行
                    {
                        #region 判断这台塑封机的塑封程序是否重复
                        if (getdt != null)
                        {
                            int ii = getdt.Rows.Count;
                            if (ii <= 0)
                            {
                                return;
                            }
                            for (int i = 0; i < ii; i++)
                            {
                                if (getdt.Rows[i]["p_id"].ToString() != null)
                                {
                                    if (sl_type_01.GetKey(sl_type_01.IndexOfValue(cb_program.Text.Trim())).ToString() == getdt.Rows[i]["p_id"].ToString().Trim())
                                    {
                                        MessageBox.Show("塑封程序已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        return;
                                    }
                                }
                            }
                        }

                        #endregion
                    }
                    #region 判断名字是否存在

                    if (getdt != null)
                    {
                        int ii = getdt.Rows.Count;
                        if (ii <= 0)
                        {
                            return;
                        }
                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt.Rows[i]["dp_name"].ToString() != null)
                            {
                                if (sl_type_01.GetKey(sl_type_01.IndexOfValue(cb_program.Text.Trim())).ToString() == getdt.Rows[i]["dp_name"].ToString().Trim())
                                {
                                    MessageBox.Show("流程名称已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }
                    #endregion


                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp01.Add(1, tb_name.Text.Trim());

                    sltmp01.Add(2, sl_type_01.GetKey(sl_type_01.IndexOfValue(cb_program.Text.Trim())));
                    sltmp01.Add(3, cb_type.Text.Trim().Substring(0, 1));
                    sltmp01.Add(4, tb_run_temp.Text.Trim());
                    sltmp01.Add(5, tb_run_speed.Text.Trim());
                    sltmp01.Add(6, tb_run_stress.Text.Trim());
                    sltmp01.Add(7, tb_remarks.Text.Trim());

                    sltmp01.Add(8, Strselectid);
                    sltmp.Add(1, sltmp01);


                    // string sql = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-plasticenvelop-deviceprogram-up001", sltmp, null);
                    int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-plasticenvelop-deviceprogram-up001", sltmp, null);
                    if (recint > -1)
                    {
                        MessageBox.Show("恭喜你,修改成功。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("出现未知错误:" + ex.Message + ",请联系管理员。", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
Beispiel #7
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();
                    }
                }
            }
        }
Beispiel #8
0
        /// <summary>
        /// 填充grid
        /// </summary>
        /// <param name="table"></param>
        private void SetDvg_01Data(DataTable table)
        {
            if (dgv_01.Rows.Count > 0)
            {
                dgv_01.Rows.Clear();
            }
            bool   isChangceReason = _reasonDic != null && _reasonDic.Count > 1;
            bool   isChangceType   = _typeDic != null && _typeDic.Count > 1;
            bool   isChangceArea   = _areaDic != null && _areaDic.Count > 0;
            string customerId      = string.Empty;

            if (App_ID == ("1050"))
            {
                if (CnasBaseData.UserAccessCustomer != null)
                {
                    foreach (DataRow item in CnasBaseData.UserAccessCustomer.Rows)
                    {
                        if (item["id"] != null)
                        {
                            customerId += string.Format("{0},", item["id"]);
                        }
                    }
                }
            }
            else
            {
                customerId = "ALL";
            }
            if (table != null && table.Rows.Count > 0)
            {
                foreach (DataRow row in table.Rows)
                {
                    if (!string.IsNullOrEmpty(customerId) && (customerId == "ALL" ||
                                                              (row["customer_id"] != null && CnasUtilityTools.IsContains(customerId, Convert.ToString(row["customer_id"])))))
                    {
                        int rowIndex = dgv_01.Rows.Add();
                        if (table.Columns.Contains("location_id") && row["location_id"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["location_id"].Value = Convert.ToString(row["location_id"]);
                        }
                        if (table.Columns.Contains("area") && row["area"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["location_idText"].Value = Convert.ToString(row["area"]);
                        }
                        if (table.Columns.Contains("entity") && row["entity"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["entity_typeText"].Value = Convert.ToString(row["entity"]);
                        }
                        if (table.Columns.Contains("statistics_type") && row["statistics_type"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["typeText"].Value = Convert.ToString(row["statistics_type"]);
                        }

                        if (table.Columns.Contains("id") && row["id"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["id"].Value = Convert.ToString(row["id"]);
                        }
                        if (table.Columns.Contains("bar_code") && row["bar_code"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["bar_code"].Value = Convert.ToString(row["bar_code"]);
                        }
                        if (table.Columns.Contains("ca_name") && row["ca_name"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["ca_name"].Value = Convert.ToString(row["ca_name"]);
                        }
                        if (table.Columns.Contains("entity_type") && row["entity_type"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["entity_type"].Value = Convert.ToString(row["entity_type"]);
                        }
                        if (table.Columns.Contains("num") && row["num"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["num"].Value = row["num"];
                        }
                        if (table.Columns.Contains("type") && row["type"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["type"].Value = Convert.ToString(row["type"]);
                        }
                        if (table.Columns.Contains("remark") && row["remark"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["remark"].Value = Convert.ToString(row["remark"]);
                        }
                        if (table.Columns.Contains("cre_date") && row["cre_date"] != null)
                        {
                            dgv_01.Rows[rowIndex].Cells["cre_date"].Value = row["cre_date"];
                        }
                    }
                }
            }
        }
Beispiel #9
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;
                }
            }
        }
        private void but_addone_Click(object sender, EventArgs e)
        {
            //dgv_02.Rows.Clear();
            //sl_02data.Clear();
            CnasUtilityTools.MoveData(dgv_01, dgv_02, true, true);
            //if (dgv_01.Rows.Count > 0)
            //{
            //    //SortedList sol_select = new SortedList();


            //    string str_id = "", str_app_name = "";
            //    if (dgv_02.Rows.Count == 0)//如果dgv_02没数据,则第一次添加数据,后面查重会赛选
            //    {
            //        for (int k = 0; k < dgv_01.Rows.Count; k++)
            //        {
            //            if (dgv_01.Rows[k].Cells["isselected"].Value == null) continue;
            //            if (bool.Parse(dgv_01.Rows[k].Cells["isselected"].Value.ToString()) == false) continue;
            //            if (dgv_01.Rows[k].Cells["id"] != null) str_id = dgv_01.Rows[k].Cells["id"].Value.ToString();
            //            if (dgv_01.Rows[k].Cells["ca_name"] != null) str_app_name = dgv_01.Rows[k].Cells["ca_name"].Value.ToString();

            //            DataGridViewRow drtemp01 = new DataGridViewRow();
            //            drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //            drtemp01.Cells.Add(new DataGridViewTextBoxCell());//ID
            //            drtemp01.Cells.Add(new DataGridViewTextBoxCell());//器械名

            //            drtemp01.SetValues(false, str_id, str_app_name);
            //            dgv_02.Rows.Add(drtemp01);
            //            sl_02data.Add(str_id, str_app_name);
            //        }
            //    }
            //    else
            //    {
            //        int sum = 0;//判断重复
            //        for (int i = 0; i < dgv_01.Rows.Count; i++)
            //        {
            //            if (dgv_01.Rows[i].Cells["isselected"].Value == null) continue;
            //            if (bool.Parse(dgv_01.Rows[i].Cells["isselected"].Value.ToString()) == false) continue;
            //            for (int j = 0; j < dgv_02.Rows.Count; j++)//循环查重
            //            {
            //                if (dgv_01.Rows[i].Cells["id"].Value.ToString() != dgv_02.Rows[j].Cells["id02"].Value.ToString())//如果dgv_02中已经存这个id的器械,则不添加
            //                {
            //                    sum++;
            //                }
            //                else
            //                {
            //                    sum--;
            //                }



            //            }
            //            if (sum == dgv_02.Rows.Count)//如果相等,则说明这个器械已经与表全部器械比较过了,不重复,可以添加
            //            {
            //                if (dgv_01.Rows[i].Cells["id"] != null) str_id = dgv_01.Rows[i].Cells["id"].Value.ToString();
            //                if (dgv_01.Rows[i].Cells["ca_name"] != null) str_app_name = dgv_01.Rows[i].Cells["ca_name"].Value.ToString();

            //                DataGridViewRow drtemp01 = new DataGridViewRow();
            //                drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //                drtemp01.Cells.Add(new DataGridViewTextBoxCell());//ID
            //                drtemp01.Cells.Add(new DataGridViewTextBoxCell());//器械名

            //                drtemp01.SetValues(false, str_id, str_app_name);
            //                dgv_02.Rows.Add(drtemp01);
            //                sl_02data.Add(str_id, str_app_name);
            //            }
            //            sum = 0;
            //        }
            //    }



            //}
        }
        /// <summary>
        /// 图片保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsm_save_Click(object sender, EventArgs e)
        {
            string str_ImageData    = this.ImageData01.GetXML();
            string str_ImageAddData = "";

            if (this.Sl_par.Count > 0)
            {
                str_ImageAddData = "<ImageAddData>";
                for (int i = 0; i < Sl_par.Count; i++)
                {
                    ImageAddData ImageAddDatatmp = (ImageAddData)Sl_par.GetByIndex(i);
                    str_ImageAddData = str_ImageAddData + ImageAddDatatmp.GetXML();
                }
                str_ImageAddData = str_ImageAddData + "</ImageAddData>";
            }
            string strxmltmp = "<Data>" + str_ImageData + str_ImageAddData + "</Data>";
            //UserXmlUpdate(sender, e, strxmltmp);


            //上传到FTP文件夹的名称
            string folderName = "";

            int upType = Convert.ToInt32(Sl_Parameter["type"]);
            //包图片名称
            string dataUrl = ImageData01.Name + ".jpg";

            // 确定上传图片的类型
            // 1-包  2-器械
            EUploadType eUpType = (EUploadType)upType;

            folderName = CnasUtilityTools.GetFolderName(eUpType);


            #region 保存对应条码包的照片
            //ftp: test.cnasis.cn:cnasftp:ftp123
            tsm_view_Click(null, null);
            Bitmap _NewBitmap = new Bitmap(this.PrictureView.Width, PrictureView.Height);
            //_NewBitmap.SetResolution(203, 203);
            prictureDesign.DrawToBitmap(_NewBitmap, new Rectangle(0, 0, _NewBitmap.Width, _NewBitmap.Height));
            MemoryStream memStream = new MemoryStream();
            _NewBitmap.Save(memStream, ImageFormat.Jpeg);


            ImageCache imageCache = new ImageCache();

            //保存图片
            bool result = imageCache.SaveImageCache(folderName, ImageData01.Name + ".jpg", memStream);
            if (!result)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("errorimage", EnumPromptMessage.error, new string[] { "系统错误" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            #endregion

            //获取图片
            Image picViewImage = imageCache.GetImageByFolderNameFileName(folderName, ImageData01.Name + ".jpg");
            //返回不等于""说明有错误信息返回,弹出提示
            if (picViewImage == null)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("errorseeim", EnumPromptMessage.error, new string[] { "" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                this.PrictureView.Image = picViewImage;
            }

            //rexxie通过条形码更新数据库:关联文件名
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sltmp           = new SortedList();
            SortedList    sltmp01         = new SortedList();

            //图片存储类型
            sltmp.Add(1, upType);
            //包ID
            sltmp.Add(2, Sl_Parameter["pack_id"]);
            //包条码
            sltmp.Add(3, Sl_Parameter["pack_barcode"]);
            //图片名称
            sltmp.Add(4, dataUrl);
            //状态默认可用
            sltmp.Add(5, 1);
            sltmp01.Add(1, sltmp);
            //string gg = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS_image-data-add001", sltmp01, null);
            int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS_image-data-add001", sltmp01, null);

            if (recint > -1)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("addsuccessful", EnumPromptMessage.warning, new string[] { "照片" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Beispiel #12
0
        public HCSRM_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);
            }
        }
Beispiel #13
0
        public virtual void ReleaseSpecialSet()
        {
            DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid");

            if (setDataGrid != null)
            {
                if (setDataGrid.SelectedRows != null && setDataGrid.SelectedRows.Count == 1)
                {
                    if (setDataGrid.SelectedRows[0].Tag is DataRow)
                    {
                        DataRow rowData    = setDataGrid.SelectedRows[0].Tag as DataRow;
                        string  setBarCode = rowData["bar_code"].ToString();
                        bool    isBCCSSet  = BarCodeHelper.IsSpecialSet(setBarCode);
                        if (isBCCSSet)
                        {
                            string     message   = PromptMessageXmlHelper.Instance.GetPromptMessage("recyleset", EnumPromptMessage.warning, new string[] { setBarCode, rowData["ca_name"].ToString() });
                            SortedList condition = new SortedList();
                            condition.Add(1, CnasBaseData.SystemID);
                            condition.Add(2, setBarCode);
                            string     testSql    = RemoteClient.RemotInterface.CheckSelectData("HCS-instrument-info-sec002", condition);
                            DataTable  data       = RemoteClient.RemotInterface.SelectData("HCS-instrument-info-sec002", condition);
                            SortedList deleteData = new SortedList();
                            SortedList sqlParam   = new SortedList();
                            SortedList input      = new SortedList();
                            SortedList input01    = new SortedList();
                            input.Add(1, input01);
                            sqlParam.Add(1, input);
                            sqlParam.Add(2, deleteData);
                            input01.Add(1, rowData["id"]);
                            input01.Add(2, rowData["id"]);
                            input01.Add(3, PdCode);
                            if (data != null && data.Rows.Count > 0)
                            {
                                int index = 1;
                                foreach (DataRow item in data.Rows)
                                {
                                    SortedList deleteItem = new SortedList();
                                    deleteData.Add(index, deleteItem);
                                    index++;
                                    if (item["ca_name"] != null && item["instrument_num"] != null)
                                    {
                                        message += string.Format("\r\n\t\t器械名称: {0},\t器械数量:{1}.", item["ca_name"].ToString(), item["instrument_num"].ToString());
                                    }
                                    deleteItem.Add(1, rowData["ws_id"] != null ? rowData["ws_id"].ToString() : "");
                                    deleteItem.Add(2, "9");
                                    deleteItem.Add(3, item["wsin_id"]);
                                }
                            }

                            if (MessageBox.Show(message, "信息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
                            {
                                string testDeleteSql = RemoteClient.RemotInterface.CheckUPDataList("HCS-work-specialset-info-up002", sqlParam);
                                int    result        = RemoteClient.RemotInterface.UPDataList("HCS-work-specialset-info-up002", sqlParam);
                                if (result <= -1)
                                {
                                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("failRecycleset", EnumPromptMessage.error), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                }
                                else
                                {
                                    InitalizeControl();
                                    if (setDataGrid.RowCount == 0)
                                    {
                                        if (setDataGrid.RowCount == 0)
                                        {
                                            if (this.ParentForm is HCSWF_dialog_container)
                                            {
                                                (ParentForm as HCSWF_dialog_container).DialogResultStatus = 3;
                                            }
                                            ParentForm.Close();
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("selectspecialset", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
                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);
            }
        }
Beispiel #14
0
        public virtual void DeleteSets()
        {
            DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid");

            if (setDataGrid != null)
            {
                if (setDataGrid.SelectedRows != null && setDataGrid.SelectedRows.Count > 0)
                {
                    if (setDataGrid.SelectedRows.Count == setDataGrid.Rows.Count)
                    {
                        MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("setgridhasdata", EnumPromptMessage.warning), "信息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                        return;
                    }

                    string        warnmingMessage = PromptMessageXmlHelper.Instance.GetPromptMessage("cfmsetremove", EnumPromptMessage.warning);
                    List <string> removedBarCode  = new List <string>();

                    foreach (DataGridViewRow item in setDataGrid.SelectedRows)
                    {
                        if (setDataGrid.Columns.Contains("setNameCol") && item.Cells["setNameCol"] != null)
                        {
                            warnmingMessage += string.Format("\r\n名称:  {0}", item.Cells["setNameCol"].Value);
                        }
                        if (item.Cells["setBarCodeCol"].Value != null)
                        {
                            removedBarCode.Add(item.Cells["setBarCodeCol"].Value.ToString());
                        }
                    }
                    if (MessageBox.Show(warnmingMessage, "信息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
                    {
                        int selectedCount = setDataGrid.SelectedRows.Count;

                        foreach (DataGridViewRow item in setDataGrid.SelectedRows)
                        {
                            string setBarCode = item.Cells["setBarCodeCol"].Value.ToString();
                            if (removedBarCode.Contains(setBarCode))
                            {
                                for (int j = 0; j < ScanBarCodes.Count; j++)
                                {
                                    if (ScanBarCodes.GetKey(j).ToString().Contains(setBarCode))
                                    {
                                        ScanBarCodes.RemoveAt(j);
                                        j--;
                                    }
                                }
                                setDataGrid.Rows.Remove(item);
                            }
                        }
                    }
                    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);
                }
            }
        }
Beispiel #15
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 but_ok_Click(object sender, EventArgs e)
        {
            #region 验证
            if (tb_name.Text.Trim() == "")
            {
                MessageBox.Show("请输入衣物名称。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (cb_type.Text.Trim() == "")
            {
                MessageBox.Show("请选择衣类型。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //如果数量不为null,则表示需要验证输入的值是否正确
            if (!string.IsNullOrEmpty(tb_count.Text))
            {
                //如果用户输入的值不为正整数,则提示用户
                if (!CnasUtilityTools.IsNumeric(tb_count.Text))
                {
                    MessageBox.Show("衣物数量输入的格式不正确,请输入正整数。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            if (tb_count.Text.Trim() == "")
            {
                tb_count.Text = "NULL";
            }
            #endregion
            try
            {
                if (Strselectid == "")//增加
                {
                    #region 判断名字是否重复
                    CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                    SortedList    sltmp02         = new SortedList();
                    sltmp02.Add(1, Instrument_id);

                    DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-dressing-info-sec001", sltmp02);//49
                    if (getdt != null)
                    {
                        int ii = getdt.Rows.Count;
                        if (ii <= 0)
                        {
                            return;
                        }
                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt.Rows[i]["dre_name"].ToString().Trim() != null)
                            {
                                if (tb_name.Text.Trim().ToString() == getdt.Rows[i]["dre_name"].ToString().Trim())
                                {
                                    MessageBox.Show("敷料衣物名称已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }
                    #endregion
                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp.Add(1, Instrument_id);
                    sltmp.Add(2, tb_name.Text.Trim());
                    sltmp.Add(3, tb_count.Text.Trim());
                    sltmp.Add(4, cb_type.Text.Trim().Substring(0, 1));
                    sltmp.Add(5, tb_remarks.Text.Trim());
                    sltmp01.Add(1, sltmp);

                    string ggg    = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-dressing-info-add001", sltmp01, null);
                    int    recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-dressing-info-add001", sltmp01, null);
                    if (recint > -1)
                    {
                        MessageBox.Show("恭喜你,增加成功。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }

                else
                {
                    #region 判断名字是否已经存在
                    CnasRemotCall reCnasRemotCall = new CnasRemotCall();
                    if (tb_name.Text.Trim() != Strselectname)
                    {
                        DataTable getdt01 = reCnasRemotCall.RemotInterface.SelectData("HCS-dressing-info-sec002", null);
                        if (getdt01 != null)
                        {
                            int aa = getdt01.Rows.Count;
                            if (aa <= 0)
                            {
                                return;
                            }
                            for (int i = 0; i < aa; i++)
                            {
                                if (getdt01.Rows[i]["dre_name"].ToString().Trim() != null)
                                {
                                    if (tb_name.Text.Trim().ToString() == getdt01.Rows[i]["dre_name"].ToString().Trim())
                                    {
                                        MessageBox.Show("敷料衣物名称已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                    #endregion
                    SortedList sttmp01 = new SortedList();
                    SortedList sttmp   = new SortedList();
                    sttmp01.Add(1, tb_name.Text.Trim());
                    sttmp01.Add(2, tb_count.Text.Trim());
                    sttmp01.Add(3, cb_type.Text.Trim().Substring(0, 1));
                    sttmp01.Add(4, tb_remarks.Text.Trim());
                    sttmp01.Add(5, Strselectid);
                    sttmp.Add(1, sttmp01);
                    string dg     = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-dressing-info-up001", sttmp, null);
                    int    recent = reCnasRemotCall.RemotInterface.UPData(1, "HCS-dressing-info-up001", sttmp, null);
                    if (recent > -1)
                    {
                        MessageBox.Show("恭喜你,修改成功。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("出现未知错误:" + ex.Message + ",请联系管理员。", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
Beispiel #17
0
 private void but_addone_Click(object sender, EventArgs e)
 {
     CnasUtilityTools.MoveData(dgv_01, dgv_02, true, true);
 }
        /// <summary>
        /// "确定"按钮触发事件
        /// </summary>
        private void but_ok_Click_1(object sender, EventArgs e)
        {
            #region 验证
            if (tb_name.Text.Trim() == "")
            {
                MessageBox.Show("请输入敷料包名称。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (cb_material.Text.Trim() == "")
            {
                MessageBox.Show("请选择包装材料。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (cb_customer.Text.Trim() == "")
            {
                MessageBox.Show("请选择客户。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (tb_size.Text.Trim() == "")
            {
                tb_size.Text = "";
            }
            if (cb_cost_center.Text.Trim() == "")
            {
                MessageBox.Show("请选择成本中心。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (cb_str.Text.Trim() == "")
            {
                MessageBox.Show("请选择灭菌程序。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (!string.IsNullOrEmpty(tb_weight.Text))
            {
                //如果用户输入的值不为正整数,则提示用户
                if (!CnasUtilityTools.IsNumeric(tb_weight.Text))
                {
                    MessageBox.Show("重量输入的格式不正确,请输入正整数。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            if (!string.IsNullOrEmpty(tb_price.Text))
            {
                //如果用户输入的值不为正整数,则提示用户
                if (!CnasUtilityTools.IsNumeric(tb_price.Text))
                {
                    MessageBox.Show("衣物数量输入的格式不正确,请输入正整数。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            if (tb_stu.Text.Trim() == "")
            {
                tb_stu.Text = "0";
            }
            if (tb_price.Text.Trim() == "")
            {
                tb_price.Text = "NULL";
            }
            if (tb_weight.Text.Trim() == "")
            {
                tb_weight.Text = "NULL";
            }
            #endregion

            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttmp02         = new SortedList();
            sttmp02.Add(1, CnasBaseData.SystemID);

            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-dressing-set-sec001", sttmp02);
            try
            {
                if (Selectid == "")
                {
                    #region 判断名字是否重复
                    if (getdt != null)
                    {
                        int ii = getdt.Rows.Count;
                        if (ii <= 0)
                        {
                            return;
                        }
                        for (int i = 0; i < ii; i++)
                        {
                            if (getdt.Rows[i]["ca_name"].ToString().Trim() != null)
                            {
                                if (tb_name.Text.Trim().ToString() == getdt.Rows[i]["ca_name"].ToString().Trim())
                                {
                                    MessageBox.Show("敷料包名称已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    return;
                                }
                            }
                        }
                    }
                    #endregion
                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp.Add(1, tb_name.Text.Trim());                                                          //名字
                    sltmp.Add(2, tb_barcode.Text.Trim());                                                       //条码
                    sltmp.Add(3, sl_material.GetKey(sl_material.IndexOfValue(cb_material.Text.Trim())));        //打包材料
                    sltmp.Add(4, tb_price.Text.Trim());                                                         //价格
                    sltmp.Add(6, sl_costcenter.GetKey(sl_costcenter.IndexOfValue(cb_cost_center.Text.Trim()))); //成本中心
                    sltmp.Add(5, sl_customer_01.GetKey(sl_customer_01.IndexOfValue(cb_customer.Text.Trim())));  //顾客
                    sltmp.Add(7, tb_weight.Text.Trim());                                                        //重量
                    sltmp.Add(8, sl_str.GetKey(sl_str.IndexOfValue(cb_str.Text.Trim())));                       //灭菌类型
                    sltmp.Add(9, tb_size.Text.Trim());                                                          //大小
                    sltmp.Add(10, tb_remarks.Text.Trim());                                                      //备注
                    sltmp.Add(11, CnasBaseData.SystemID);
                    sltmp01.Add(1, sltmp);
                    string strtmp = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-dressing-set-add001", sltmp01, null);
                    int    recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-dressing-set-add001", sltmp01, null);
                    if (recint > -1)
                    {
                        MessageBox.Show("恭喜你,增加成功。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
                else
                {
                    #region 判断名字是否重复
                    if (tb_name.Text.Trim() != Selectname)
                    {
                        if (getdt != null)
                        {
                            int ii = getdt.Rows.Count;
                            if (ii <= 0)
                            {
                                return;
                            }
                            for (int i = 0; i < ii; i++)
                            {
                                if (getdt.Rows[i]["ca_name"].ToString().Trim() != null)
                                {
                                    if (tb_name.Text.Trim().ToString() == getdt.Rows[i]["ca_name"].ToString().Trim())
                                    {
                                        MessageBox.Show("敷料包名称已存在。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                    #endregion

                    SortedList sltmp   = new SortedList();
                    SortedList sltmp01 = new SortedList();
                    sltmp.Add(1, tb_name.Text.Trim());                                                          //名字
                    sltmp.Add(2, sl_material.GetKey(sl_material.IndexOfValue(cb_material.Text.Trim())));        //打包材料
                    sltmp.Add(3, tb_price.Text.Trim());                                                         //价格
                    sltmp.Add(5, sl_costcenter.GetKey(sl_costcenter.IndexOfValue(cb_cost_center.Text.Trim()))); //成本中心
                    sltmp.Add(4, sl_customer_01.GetKey(sl_customer_01.IndexOfValue(cb_customer.Text.Trim())));  //顾客
                    sltmp.Add(6, tb_weight.Text.Trim());                                                        //重量
                    sltmp.Add(7, sl_str.GetKey(sl_str.IndexOfValue(cb_str.Text.Trim())));                       //灭菌类型
                    sltmp.Add(8, tb_size.Text.Trim());                                                          //大小
                    sltmp.Add(9, tb_remarks.Text.Trim());                                                       //备注
                    sltmp.Add(10, Selectid);
                    sltmp01.Add(1, sltmp);
                    //string strtmp = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-dressing-set-up001", sltmp01, null);
                    int recint = reCnasRemotCall.RemotInterface.UPData(1, "HCS-dressing-set-up001", sltmp01, null);
                    if (recint > -1)
                    {
                        MessageBox.Show("恭喜你,修改成功。", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("出现未知错误:" + ex.Message + ",请联系管理员。", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
        /// <summary>
        /// 用于点击修改时对dgv_01与dgv_02的修改
        /// </summary>
        /// <param name="dgv_02"></param>
        /// <param name="dgv_01"></param>
        private void ManualModification(RadGridView dgv_02, RadGridView dgv_01)
        {
            if (dgv_02.CurrentRow.Cells["current_count"].Value != null && !CnasUtilityTools.IsNumeric(dgv_02.CurrentRow.Cells["current_count"].Value.ToString()))
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("InputNum", EnumPromptMessage.warning, new string[] { dgv_02.CurrentRow.Cells["ca_name"].Value.ToString() }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                dgv_02.CurrentRow.Cells["current_count"].Value = _itemNum;
                return;
            }



            if (dgv_02.CurrentRow != null && dgv_02.CurrentCell != null)
            {
                string value = Convert.ToString(dgv_02.CurrentCell.Value);
                if (value == "0" || string.IsNullOrEmpty(value))
                {
                    //输入为空或者0时

                    //移出表2数据,并把表二原本数据搬到表1上
                    if (dgv_01.RowCount == 0)
                    {
                        addRows(dgv_02, dgv_01);
                    }
                    else
                    {
                        int a          = 0;//用于验证是否给表1添加新一行数据
                        int CurrentNum = 0;
                        for (int k = 0; k < dgv_01.RowCount; k++)
                        {
                            try
                            {
                                CurrentNum = int.Parse(dgv_02.CurrentRow.Cells["current_count"].Value.ToString());
                            }
                            catch
                            {
                                CurrentNum = 0;
                                //MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("InputNum", EnumPromptMessage.warning, new string[] { dgv_02.CurrentRow.Cells["ca_name"].Value.ToString() }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                //return;
                            }
                            if (dgv_02.CurrentRow.Cells["id"].Value.ToString() == dgv_01.Rows[k].Cells["id"].Value.ToString())
                            {
                                dgv_01.Rows[k].Cells["current_count"].Value = _itemNum - CurrentNum + int.Parse(dgv_01.Rows[k].Cells["current_count"].Value.ToString());
                                dgv_02.Rows.Remove(dgv_02.CurrentRow);
                            }
                            else
                            {
                                a++;
                            }
                        }
                        if (a == dgv_01.RowCount)//相等则说明没有相同的
                        {
                            addRows(dgv_02, dgv_01);
                        }
                    }
                }
                else
                {
                    if (int.Parse(dgv_02.CurrentRow.Cells["current_count"].Value.ToString()) < 0 || int.Parse(dgv_02.CurrentRow.Cells["current_count"].Value.ToString()) > _itemNum)
                    {
                        dgv_02.CurrentRow.Cells["current_count"].Value = _itemNum;
                        return;
                    }

                    int CurrentNum = 0;
                    try
                    {
                        CurrentNum = int.Parse(dgv_02.CurrentRow.Cells["current_count"].Value.ToString());
                    }
                    catch
                    {
                        CurrentNum = 0;
                    }
                    //输入的不是0或空值时

                    bool ifNewRows = true;

                    for (int k = 0; k < dgv_01.RowCount; k++)
                    {
                        if (dgv_02.CurrentRow.Cells["id"].Value.ToString() == dgv_01.Rows[k].Cells["id"].Value.ToString())
                        {
                            dgv_01.Rows[k].Cells["current_count"].Value = _itemNum - CurrentNum + int.Parse(dgv_01.Rows[k].Cells["current_count"].Value.ToString());
                            ifNewRows = false;
                        }
                    }
                    if (ifNewRows)//判断是否需要新填一行数据
                    {
                        if (_itemNum - CurrentNum != 0)
                        {
                            GridViewRowInfo newRow = dgv_01.Rows.AddNew();
                            newRow.Cells[0].Value = dgv_02.CurrentRow.Cells[0].Value;
                            newRow.Cells[1].Value = dgv_02.CurrentRow.Cells[1].Value;
                            newRow.Cells[2].Value = dgv_02.CurrentRow.Cells[2].Value;
                            newRow.Cells[3].Value = dgv_02.CurrentRow.Cells[3].Value;
                            newRow.Cells[5].Value = dgv_02.CurrentRow.Cells[5].Value;
                            newRow.Cells[4].Value = _itemNum - CurrentNum;
                            newRow.Tag            = dgv_02.CurrentRow.Tag;
                        }
                    }
                    //  dgv_02.Rows.Remove(dgv_02.CurrentRow);
                }
            }
        }
Beispiel #20
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));
        }