コード例 #1
0
        /// <summary>
        /// 添加包的信息
        /// </summary>
        public override void AddSetMessage()
        {
            string code = Convert.ToString(setNameTxt.Tag);

            if (code.Length > 3)
            {
                HCSSM_set_message_new setMessageDialog = new HCSSM_set_message_new(1, PdCode);
                setMessageDialog.PackageBarCode = code;
                setMessageDialog.ViewData       = setMessageDialog.ViewData ?? new SortedList();
                if (setMessageDialog.ViewData.Contains("UserInfo"))
                {
                    setMessageDialog.ViewData["UserInfo"] = UserInfo;
                }
                else
                {
                    setMessageDialog.ViewData.Add("UserInfo", UserInfo);
                }
                setMessageDialog.Show();
            }
        }
コード例 #2
0
        public virtual void AddSetMessage()
        {
            DataGridView setDataGrid = CnasUtilityTools.FindControl <DataGridView>(this, "setDataGrid");

            if (setDataGrid != null)
            {
                if (setDataGrid.SelectedRows != null && setDataGrid.SelectedRows.Count == 1)
                {
                    if (setDataGrid.Columns.Contains("setBarCodeCol"))
                    {
                        string setBarCode = setDataGrid.SelectedRows[0].Cells["setBarCodeCol"].Value.ToString();
                        HCSSM_set_message_new setMessageDialog = new HCSSM_set_message_new(1, PdCode);
                        setMessageDialog.PackageBarCode = setBarCode;
                        setMessageDialog.ViewData       = setMessageDialog.ViewData ?? new SortedList();

                        if (setMessageDialog.ViewData.Contains("UserInfo"))
                        {
                            setMessageDialog.ViewData["UserInfo"] = UserInfo;
                        }
                        else
                        {
                            setMessageDialog.ViewData.Add("UserInfo", UserInfo);
                        }
                        setMessageDialog.Show();
                    }
                }
                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);
            }
        }