private void but_rfid_Click(object sender, EventArgs e)
        {
            if (this.dgv_01.SelectedRows.Count <= 0)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("choicechange", EnumPromptMessage.warning, new string[] { "配置RFID", "实体包" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            HCSCM_entityset_manager_rfid hcsm = new HCSCM_entityset_manager_rfid(dgv_01.SelectedRows[0].Cells["id"].Value.ToString(), dgv_01.SelectedRows[0].Cells["ca_name"].Value.ToString());

            //获取一个值,指是否在Windows任务栏中显示窗体。
            hcsm.ShowInTaskbar = false;
            hcsm.ShowDialog();
        }
예제 #2
0
        private void but_new_Click(object sender, EventArgs e)
        {
            if (this.tb_name.Text == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillcustomer", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            #region 判断名字是否存在
            CnasRemotCall reCnasRemotCall = new CnasRemotCall();
            SortedList    sttemp01        = new SortedList();
            sttemp01.Add(1, Sl_type_02.GetKey(Sl_type_02.IndexOfValue(this.cb_customer.Text.Trim())).ToString());
            sttemp01.Add(2, CnasBaseData.SystemID);
            // string sql = reCnasRemotCall.RemotInterface.CheckSelectData("HCS-set-sec050", sttemp01);
            DataTable getdt = reCnasRemotCall.RemotInterface.SelectData("HCS-set-sec050", sttemp01);//504
            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(PromptMessageXmlHelper.Instance.GetPromptMessage("namerepetition", EnumPromptMessage.warning, new string[] { "实体包" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                    }
                }
            }


            #endregion

            if (this.cb_customer.Text == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillcustomer", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.cb_cost_center.Text == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("fillcostcenter", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.cb_uselocation.Text == "")
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("filllocation", EnumPromptMessage.warning), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (tb_point.Text.Trim() == "")
            {
                tb_point.Text = "";
            }
            try
            {
                SortedList sltmp      = new SortedList();
                SortedList sltmp01    = new SortedList();
                SortedList sltmp01_01 = new SortedList();
                //sltmp.Add(1, tb_name.Text.Trim().Split('<')[0]);//名字
                sltmp.Add(1, tb_name.Text.Trim());                                                                            //名字
                sltmp.Add(2, arrayDR02[0]["bar_code"].ToString());                                                            //基本包条码base_setcode
                sltmp.Add(3, Sl_type_01.GetKey(Sl_type_01.IndexOfValue(cb_cost_center.Text.Trim())).ToString());              //成本中心
                sltmp.Add(4, Sl_type_02.GetKey(Sl_type_02.IndexOfValue(cb_customer.Text.Trim())).ToString());                 //顾客
                sltmp.Add(5, Sl_uselocation.GetKey(Sl_uselocation.IndexOfValue(this.cb_uselocation.Text.Trim())).ToString()); //使用地点
                sltmp.Add(6, CnasBaseData.SystemID);
                sltmp.Add(7, tb_point.Text.Trim() == "" ? "0" : sl_storageid.GetKey(sl_storageid.IndexOfValue(tb_point.Text.Trim())).ToString());
                if (cb_if_urgent.Checked == true)//如果加急控件打勾,则赋值为1,否则为0
                {
                    sltmp.Add(8, 1);
                }
                else
                {
                    sltmp.Add(8, 0);
                }
                if (cb_RFID.Checked == true)//是否须要RFID追溯
                {
                    sltmp.Add(9, 1);
                }
                else
                {
                    sltmp.Add(9, 0);
                }
                if (set_type != "2")//判断是否为特殊包
                {
                    sltmp.Add(10, "BCC");
                    sltmp.Add(11, "10");
                }
                else
                {
                    if (if_alien == "1")//判断是否为院内包
                    {
                        if (rb_BCCO1.Checked == true)
                        {
                            sltmp.Add(10, strbarcode_top);
                            sltmp.Add(11, "8");
                        }
                        else if (rb_BCCO2.Checked == true)
                        {
                            sltmp.Add(10, strbarcode_down);
                            sltmp.Add(11, "8");
                        }
                        else
                        {
                            sltmp.Add(10, "BCC0S");
                            sltmp.Add(11, "8");
                        }
                    }
                    else
                    {
                        if (rb_BCCO1.Checked == true)
                        {
                            sltmp.Add(10, strbarcode_top);
                            sltmp.Add(11, "8");
                        }
                        else if (rb_BCCO2.Checked == true)
                        {
                            sltmp.Add(10, strbarcode_down);
                            sltmp.Add(11, "8");
                        }
                        else
                        {
                            sltmp.Add(10, "BCC3S");
                            sltmp.Add(11, "8");
                        }
                    }
                }
                sltmp01.Add(1, sltmp);
                sltmp01_01.Add(1, sltmp01);
                // string strtmp = reCnasRemotCall.RemotInterface.CheckUPData(1, "HCS-set-add001", sltmp01, null);

                #region 入库添加
                SortedList sltmpUpLiblaryAll  = new SortedList();
                SortedList sltmpAddLiblaryAll = new SortedList();

                storageData = LoadLibraryData();
                if (ItemData != null)
                {
                    int key = 1;
                    for (int i = 0; i < ItemData.Rows.Count; i++)
                    {
                        _tempData.Clear();
                        int storyNum = 0;
                        int itemNum  = 0;

                        if (ItemData.Rows[i]["in_num"].ToString() != "")//判断是器械是否有值
                        {
                            itemNum = int.Parse(ItemData.Rows[i]["in_num"].ToString());
                        }
                        if (storageData != null)
                        {
                            for (int j = 0; j < storageData.Rows.Count; j++)
                            {
                                _tempData.Add(storageData.Rows[j]["instrument_base_id"].ToString(), storageData.Rows[j]["in_set_count"].ToString());
                            }

                            for (int j = 0; j < storageData.Rows.Count; j++)
                            {
                                if (_tempData.ContainsKey(ItemData.Rows[i]["instrument_id"].ToString()))
                                {
                                    if (_tempData[ItemData.Rows[i]["instrument_id"].ToString()].ToString() != "")
                                    {
                                        storyNum = int.Parse(_tempData[ItemData.Rows[i]["instrument_id"].ToString()].ToString());
                                        // storyNum = int.Parse(storageData.Rows[j]["in_set_count"].ToString());
                                    }
                                    else
                                    {
                                        storyNum = 0;
                                    }
                                    storyNum += itemNum;
                                    SortedList sltmpUpLiblary = new SortedList();
                                    sltmpUpLiblary.Add(1, storyNum);
                                    sltmpUpLiblary.Add(2, CnasBaseData.UserID);
                                    sltmpUpLiblary.Add(3, ItemData.Rows[i]["instrument_id"].ToString());
                                    sltmpUpLiblary.Add(4, Sl_type_01_01.GetKey(Sl_type_01_01.IndexOfValue(cb_cost_center.Text)));
                                    sltmpUpLiblaryAll.Add(key, sltmpUpLiblary);
                                    key++;
                                    break;
                                }
                                else
                                {
                                    SortedList sltmpAddLiblary = new SortedList();
                                    sltmpAddLiblary.Add(1, ItemData.Rows[i]["instrument_id"].ToString());
                                    sltmpAddLiblary.Add(2, Sl_type_01_01.GetKey(Sl_type_01_01.IndexOfValue(cb_cost_center.Text)));
                                    sltmpAddLiblary.Add(3, itemNum);
                                    sltmpAddLiblary.Add(4, CnasBaseData.UserID);
                                    sltmpAddLiblaryAll.Add(key, sltmpAddLiblary);
                                    key++;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            SortedList sltmpAddLiblary = new SortedList();
                            sltmpAddLiblary.Add(1, ItemData.Rows[i]["instrument_id"].ToString());
                            sltmpAddLiblary.Add(2, Sl_type_01_01.GetKey(Sl_type_01_01.IndexOfValue(cb_cost_center.Text)));
                            sltmpAddLiblary.Add(3, itemNum);
                            sltmpAddLiblary.Add(4, CnasBaseData.UserID);
                            sltmpAddLiblaryAll.Add(key, sltmpAddLiblary);
                            key++;
                        }
                    }
                }

                #endregion


                sltmp01_01.Add(2, sltmpUpLiblaryAll);
                sltmp01_01.Add(3, sltmpAddLiblaryAll);
                string strrecint = reCnasRemotCall.RemotInterface.CheckUPDataList("HCS-instrument-costcenter-detail-set-up001", sltmp01_01);
                int    recint    = reCnasRemotCall.RemotInterface.UPDataList("HCS-instrument-costcenter-detail-set-up001", sltmp01_01);
                if (recint <= 0)
                {
                    MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("adddefeat", EnumPromptMessage.warning, new string[] { "实体包" }), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (cb_RFID.Checked == true)//判断是否打开RFID界面
                {
                    HCSCM_entityset_manager_rfid hcsm = new HCSCM_entityset_manager_rfid(newId.ToString(), this.tb_name.Text);
                    //获取一个值,指是否在Windows任务栏中显示窗体。
                    hcsm.ShowInTaskbar = false;
                    hcsm.ShowDialog();
                }
                Loaddata(arrayDR02[0]["bar_code"].ToString());
                if (dgv_01.Rows.Count > 0)
                {
                    dgv_01.CurrentRow = dgv_01.Rows[dgv_01.RowCount - 1];
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(PromptMessageXmlHelper.Instance.GetPromptMessage("unknowerror", EnumPromptMessage.warning, new string[] { ex.Message }), "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }