Ejemplo n.º 1
0
        private void SelectType(selectType type)
        {
            _laseType = type;
            switch (type)
            {
            case selectType.eEMPLOYEE:

                tsBtnAddEmployee.Enabled       = true;
                tsBtnDelEmployee.Enabled       = true;
                tsBtnCancelAddEmployee.Enabled = false;
                tsBtnUpload.Enabled            = false;
                tsBtnDownload.Enabled          = false;
                dgvDevice.ClearSelection();
                employeeSettings1.SetEditMode(true);
                break;

            case selectType.eDEVICE:
                cbAllEmployee.Checked          = false;
                tsBtnAddEmployee.Enabled       = false;
                tsBtnDelEmployee.Enabled       = false;
                tsBtnCancelAddEmployee.Enabled = false;
                tsBtnUpload.Enabled            = true;
                tsBtnDownload.Enabled          = true;
                employeeSettings1.SetEditMode(false);
                DgvEmployee_SelectionChanged(this, new EventArgs());
                break;
            }
        }
Ejemplo n.º 2
0
        ///
        ///控件初始化
        ///

        /*
         * ITreeDataService _treeDataService = EAS.Services.ServiceContainer.GetService<ITreeDataService>();
         * //树控件初始化
         * private void tv_struct_init(){
         *  DataTable dt_root = _treeDataService.GetRootList("产品及零部件");
         *  if (dt_root.Rows.Count <= 0)
         *  {
         *      return;
         *  }
         *  this.tv_struct.Nodes.Clear();
         *  for (int i = 0; i < dt_root.Rows.Count; i++)
         *  {
         *      TreeNode root = new TreeNode(dt_root.Rows[0]["NAME"].ToString(), 0, 1);
         *      this.tv_struct_init_child(root, dt_root.Rows[0]["ID"].ToString());
         *      this.tv_struct.Nodes.Add(root);
         *      root.Expand();
         *      //this.tv_struct.SelectedNode = root;
         * }
         * }
         *
         * /// <summary>
         * /// 树控件初始化。
         * /// </summary>
         * private void tv_struct_init_child(TreeNode node, string parentId)
         * {
         *  DataTable dt_group = _treeDataService.GetGroupList(parentId);
         *  DataTable dt_module = _treeDataService.GetModelList((parentId));
         *
         *  foreach (DataRow var in dt_group.Rows) //下级组
         *  {
         *      TreeNode subNode = new TreeNode(var["Name"].ToString(), 0, 1);
         *      this.tv_struct_init_child(subNode, var["ID"].ToString());
         *      node.Nodes.Add(subNode);
         *
         *  }
         *
         *  //功能模块
         *  foreach (DataRow var in dt_module.Rows)
         *  {
         *      //Dictionary<string, int> gms = new Dictionary<string, int>();
         *      TreeNode itemNode = null;
         *      itemNode = new TreeNode(var["Name"].ToString(), 2, 2);
         *      itemNode.Tag = var["GUID"].ToString();
         *      node.Nodes.Add(itemNode);
         *      //this.tv_struct.SelectedNode = itemNode;
         *  }
         * }
         * */


        //详细查询(按钮toolDetailQuery操作)
        private void toolDetailQuery_Click(object sender, EventArgs e)
        {
            selectType s_type = 0;

            if (this.dgv_MaterialList.Visible)
            {
                s_type = selectType.Matieral;
            }
            else if (this.dgv_PartsList.Visible)
            {
                s_type = selectType.Parts;
            }
            else if (this.dgv_productList.Visible)
            {
                s_type = selectType.Product;
            }
            QueryStructForm o = new QueryStructForm(Convert.ToInt16(s_type));

            o.StartPosition = FormStartPosition.CenterParent;
            if (o.ShowDialog() == DialogResult.OK)
            {
                if (this.dgv_MaterialList.Visible)
                {
                    this.dgv_MaterialList.DataSource = m_structService.GetMaterailList(o.Materails);
                }
                else if (this.dgv_PartsList.Visible)
                {
                    this.dgv_PartsList.DataSource = m_structService.GetPartsList(o.Parts);
                }
                else if (this.dgv_productList.Visible)
                {
                    this.dgv_productList.DataSource = m_structService.GetProductList(o.Products);
                }
            }
        }
Ejemplo n.º 3
0
 //属性列表控件出事化
 private void toolProComb_init(selectType type)
 {
     this.toolProComb.Items.Add("编号");
     this.toolProComb.Items.Add("型号");
     this.toolProComb.Items.Add("版本");
     this.toolProComb.Items.Add("描述");
     this.toolProComb.SelectedIndex = 0;
 }
Ejemplo n.º 4
0
        private void selectAll(object sender, selectType selType)
        {
            CheckBox cb = (CheckBox)sender;

            switch (selType)
            {
            case selectType.isChecked:
                bypassCheck = true;
                foreach (StringItems2 item in chkBoxListView.Items)
                {
                    item.isChecked = (cb.IsChecked.HasValue && cb.IsChecked.Value);
                    if ((bool)chkBoxUseAliasName.IsChecked)
                    {
                        item.displayAliasValue = true;
                    }
                    else
                    {
                        item.displayNameValue = (item.isChecked && true);
                    }
                }
                bypassCheck = false;
                break;

            case selectType.displayName:
                foreach (StringItems2 item in chkBoxListView.Items)
                {
                    if (item.isChecked)
                    {
                        item.displayNameValue = (cb.IsChecked.HasValue && cb.IsChecked.Value);
                        if (!item.displayNameValue)
                        {
                            item.displayAliasValue = false;
                        }
                    }
                }
                break;

            case selectType.displayAlias:
                foreach (StringItems2 item in chkBoxListView.Items)
                {
                    if (item.isChecked)
                    {
                        item.displayAliasValue = (cb.IsChecked.HasValue && cb.IsChecked.Value);
                        if (item.displayAliasValue)
                        {
                            item.displayNameValue = false;
                        }
                    }
                }
                break;

            default:
                break;
            }
        }
Ejemplo n.º 5
0
 //选择操作
 private void selectStruct(selectType p_type)
 {
     if (p_type == selectType.Matieral)
     {
         selectMaterail();
     }
     else if (p_type == selectType.Parts)
     {
         selectParts();
     }
     else if (p_type == selectType.Product)
     {
         selectProduct();
     }
 }
Ejemplo n.º 6
0
 //数据列表显示操作
 private void dgvViewShow(selectType p_type)
 {
     if (p_type == selectType.Matieral)
     {
         this.dgv_MaterialList.Visible = true;
         this.dgv_PartsList.Visible    = false;
         this.dgv_productList.Visible  = false;
     }
     else if (p_type == selectType.Parts)
     {
         this.dgv_MaterialList.Visible = false;
         this.dgv_PartsList.Visible    = true;
         this.dgv_productList.Visible  = false;
     }
     else if (p_type == selectType.Product)
     {
         this.dgv_MaterialList.Visible = false;
         this.dgv_PartsList.Visible    = false;
         this.dgv_productList.Visible  = true;
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 发送信息
 /// </summary>
 /// <param name="obj"></param>
 private void SendMessage(object obj)
 {
     try
     {
         //转换为16进制
         string message = (string)obj;
         //16进制字符串转换为8位字节数组
         selectType selectType = new selectType();
         //显示在窗体上的信息
         string str = "";
         //message = selectType.GetData(message,out str);
         sendData sendData = new sendData();
         sendData = selectType.GetData(message);
         if (sendData.error == true)
         {
             Exception e = new Exception(sendData.msg);
             throw e;
         }
         IPEndPoint remoteIpep = new IPEndPoint(IPAddress.Parse(remoteIP), remotePort); // 发送到的IP地址和端口号
         foreach (string s in sendData.dataList)
         {
             byte[] sendbytes = Tool.strToHexByte(s);
             //IPEndPoint remoteIpep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8848); // 发送到的IP地址和端口号
             udpcSend.Send(sendbytes, sendbytes.Length, remoteIpep);
             Thread.Sleep(100);
         }
         udpcSend.Close();
         //ResetTextBox(txtSendMsg);
         ShowMessage(this.txtSendMsg, string.Format("{0} 发送成功!", sendData.msg));
     }
     catch (Exception e1)
     {
         ShowMessage(this.txtSendMsg, string.Format("错误:{0}", e1.Message));
         throw e1;
     }
 }
Ejemplo n.º 8
0
 public QueryStructForm(int t)
 {
     InitializeComponent();
     s_type = (selectType)t;
 }
Ejemplo n.º 9
0
 //属性列表控件出事化
 private void toolProComb_init(selectType type)
 {
     this.toolProComb.Items.Add("编号");
     this.toolProComb.Items.Add("型号");
     this.toolProComb.Items.Add("版本");
     this.toolProComb.Items.Add("描述");
     this.toolProComb.SelectedIndex = 0;
 }
Ejemplo n.º 10
0
 //选择操作
 private void selectStruct(selectType p_type)
 {
     if (p_type == selectType.Matieral)
     {
         selectMaterail();
     }
     else if (p_type == selectType.Parts)
     {
         selectParts();
     }
     else if (p_type == selectType.Product)
     {
         selectProduct();
     }
 }
Ejemplo n.º 11
0
 //数据列表显示操作
 private void dgvViewShow(selectType p_type)
 {
     if (p_type == selectType.Matieral) {
         this.dgv_MaterialList.Visible = true;
         this.dgv_PartsList.Visible = false;
         this.dgv_productList.Visible = false;
     }
     else if (p_type == selectType.Parts)
     {
         this.dgv_MaterialList.Visible = false;
         this.dgv_PartsList.Visible = true;
         this.dgv_productList.Visible = false;
     }
     else if (p_type == selectType.Product) {
         this.dgv_MaterialList.Visible = false;
         this.dgv_PartsList.Visible = false;
         this.dgv_productList.Visible = true;
     }
 }
Ejemplo n.º 12
0
 public QueryStructForm(int t)
 {
     InitializeComponent();
     s_type = (selectType)t;
 }
Ejemplo n.º 13
0
 public void setSelectType(selectType st)
 {
     m_type= st;
 }
Ejemplo n.º 14
0
 public void setSelectType(selectType st)
 {
     m_type = st;
 }