Пример #1
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            tbx_module.Text = tbx_module.Text.Trim().ToUpper();
            #region check
            if (lstScanedModule.Count < 1)
            {
                return;
            }
            #endregion
            List <string> inParameters = new List <string>();
            inParameters.Add(_user);                                                        //解绑人员
            inParameters.Add(_currentBatch);                                                //解绑批次
            int unBindingCellCount = _iCurrentScanCount * int.Parse(_cellConsumption);
            inParameters.Add(unBindingCellCount.ToString());                                //解绑数量
            inParameters.AddRange(lstScanedModule);                                         //解绑组件

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "ReleaseModuleBingingInfo";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReleaseModuleBingingInfoReceived, functionTag);


            lstScanedModule.Clear();
            _iCurrentScanCount = 0;
            btn_scanCount.Text = string.Empty;
            _currentBatch      = string.Empty;
            _currentPattern    = string.Empty;
            _cellConsumption   = string.Empty;
        }
Пример #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtUserName.Text.Trim() == "" || pwdPassword.Text == "")
            {
                return;
            }

            if (bExecuted == true)
            {
                return;
            }
            else
            {
                bExecuted = true;
            }

            string[] arrParameter = new string[2];

            arrParameter[0] = txtUserName.Text.ToLower().ToString();
            arrParameter[1] = pwdPassword.Text;

            TagInfo             = new FuncTagInfo();
            TagInfo.FuncName    = "AuthenticateUser";
            TagInfo.InputParams = arrParameter;


            WcfRequests.SendGeneralRequest(OnAuthenticateUserCompleted, TagInfo);
        }
Пример #3
0
        /// <summary>
        /// 刷新页面
        /// </summary>
        private void refleshPage()
        {
            _woWIPinfo = null;

            List <string> lstInputParas = new List <string>();

            lstInputParas.Add(((ListItem)cbx_workshop.SelectedItem).ID);    //车间

            FuncTagInfo wipFunctag = new FuncTagInfo();

            wipFunctag             = new FuncTagInfo();
            wipFunctag.FuncName    = "GetWoWipInfo";
            wipFunctag.InputParams = lstInputParas.ToArray();


            WcfRequests.SendWipRequest(onWoInfoReceived, wipFunctag);

            //tbx_count_remain.Text = string.Empty;
            //tbx_plan_count.Text = string.Empty;
            //tbx_wip_count.Text = string.Empty;

            //cbx_workorder.SelectedIndex = -1;   //工单号清空

            //_modulePrefix = string.Empty;   //组件前缀清空
            //dgv_module_id.Rows.Clear();     //清空组件序列号

            //cbx_workorder.Enabled = true;       //使能工单选项
        }
Пример #4
0
        private void CreateLabel_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            inParameters.Add(BasicClass.comoboxItemName.Workshop);
            //inParameters.Add("wo_type");
            //inParameters.Add("cristal_type");
            //inParameters.Add("cell_size");
            //inParameters.Add("cell_consumption");
            //inParameters.Add("cell_type");
            //inParameters.Add("workflow");

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();;

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion


            cbx_workorder.Enabled = false;

            #region trigger
            //生码数量
            tbx_label_count.KeyDown += new KeyEventHandler(tbx_label_count_KeyDown);

            //选择工单
            cbx_workorder.SelectedIndexChanged += new EventHandler(cbx_workorder_SelectedIndexChanged);

            //选择车间
            cbx_workshop.SelectedIndexChanged += new EventHandler(cbx_workshop_SelectedIndexChanged);
            #endregion

            #region 组件序列号明细试图
            dgv_module_id.AllowUserToAddRows  = false;
            dgv_module_id.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dgv_module_id.Font     = new System.Drawing.Font("宋体", 12, FontStyle.Regular);
            dgv_module_id.ReadOnly = true;
            dgv_module_id.Columns.Add("ModuleId", "组件序列号");
            #endregion

            //创建文件夹,打印用
            if (!Directory.Exists(@"c:\BarcodePrint"))
            {
                Directory.CreateDirectory(@"c:\BarcodePrint");
            }
        }
Пример #5
0
        private void ModuleClean_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            //inParameters.Add(BasicClass.comoboxItemName.Glass_Comp);
            //inParameters.Add(BasicClass.comoboxItemName.TPT_Comp);
            //inParameters.Add(BasicClass.comoboxItemName.EVA_comp);
            //inParameters.Add(BasicClass.comoboxItemName.Glass_Desc);
            //inParameters.Add(BasicClass.comoboxItemName.TPT_Desc);
            //inParameters.Add(BasicClass.comoboxItemName.EVA_desc);
            inParameters.Add(BasicClass.comoboxItemName.Workshop);

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion

            #region trigger
            //改变设备机台
            cbx_eqp.SelectedIndexChanged += new EventHandler(cbx_eqp_SelectedIndexChanged);

            //扫描组件序列号
            tbx_module_id.KeyDown += new KeyEventHandler(tbx_module_id_KeyDown);

            //选择车间
            cbx_workshop.SelectedIndexChanged += new EventHandler(cbx_workshop_SelectedIndexChanged);

            #endregion

            tbx_module_id.Enabled = false;
            cbx_eqp.Enabled       = false;

            changeColorTimer.Interval = 1000 * 15;//2 second
            changeColorTimer.Tick    += new EventHandler(changeColorTimer_Tick);

            color = this.BackColor;

            //创建文件夹,打印用
            if (!Directory.Exists(@"c:\BarcodePrint"))
            {
                Directory.CreateDirectory(@"c:\BarcodePrint");
            }
        }
Пример #6
0
        /// <summary>
        /// 选择功率模板
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void cbx_template_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <string> inParameters = new List <string>();

            inParameters.Add(((ListItem)cbx_template.SelectedItem).ID);

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetPowerTemplate";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onGetPowerTemplateReceived, functionTag);
        }
Пример #7
0
        private void Frame_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            inParameters.Add(BasicClass.comoboxItemName.Jbox_Comp);
            inParameters.Add(BasicClass.comoboxItemName.Frame_Comp);
            inParameters.Add(BasicClass.comoboxItemName.Glue_Comp);
            inParameters.Add(BasicClass.comoboxItemName.Jbox_Desc);
            inParameters.Add(BasicClass.comoboxItemName.Frame_Desc);
            inParameters.Add(BasicClass.comoboxItemName.Glue_Desc);
            inParameters.Add(BasicClass.comoboxItemName.Workshop);
            inParameters.Add(BasicClass.comoboxItemName.Frame_glue_comp);
            inParameters.Add(BasicClass.comoboxItemName.Frame_glue_desc);

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion

            #region trigger
            //选择车间
            cbx_workshop.SelectedIndexChanged += new EventHandler(cbx_workshop_SelectedIndexChanged);

            //选择设备
            cbx_eqp.SelectedIndexChanged += new EventHandler(cbx_eqp_SelectedIndexChanged);

            //扫描组件号
            tbx_module_id.KeyDown += new KeyEventHandler(tbx_module_id_KeyDown);
            #endregion

            tbx_module_id.Enabled = false;
            cbx_eqp.Enabled       = false;


            changeColorTimer.Interval = 1000 * 15;//2 second
            changeColorTimer.Tick    += new EventHandler(changeColorTimer_Tick);

            color = this.BackColor;
        }
Пример #8
0
        /// <summary>
        /// 选择车间
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void cbx_workshop_SelectedIndexChanged(object sender, EventArgs e)
        {
            cbx_workshop.Enabled = false;
            List <string> inParameters = new List <string>();

            //inParameters.Add("equipment");
            inParameters.Add(((ListItem)cbx_workshop.SelectedItem).ID);

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetWorkOrder";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onGetWorkOrderReceived, functionTag);
        }
Пример #9
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            //tbx_module_id.Text = tbx_module_id.Text.Trim().ToUpper();
            #region 检查输入格式是否正确
            string sCheckString = tbx_eff_low.Text + "|" +
                                  tbx_eff_up.Text + "|" +
                                  tbx_cellbatch_count.Text + "|" +
                                  tbx_cell_power.Text;
            if (!BasicClass.isNumeric(sCheckString))
            {
                MessageBox.Show("数字格式输入有误,请检查!");
                return;
            }

            if (cbx_cell_comp.Text == string.Empty ||         //电池片厂商
                cbx_workshop.Text == string.Empty ||          //车间
                tbx_cell_erplot.Text == string.Empty ||       //批次
                cbx_cell_color.Text == string.Empty ||        //电池片颜色
                tbx_eff_low.Text == string.Empty ||           //转换效率低
                tbx_eff_up.Text == string.Empty ||            //转换效率高
                tbx_cell_power.Text == string.Empty ||        //单片功率
                tbx_cell_grade.Text == string.Empty ||        //片源等级
                tbx_cellbatch_count.Text == string.Empty      //片源数量
                )
            {
                MessageBox.Show("必输项不能为空");
                return;
            }

            #endregion

            List <string> inParameters = new List <string>();
            inParameters.Add(((ListItem)cbx_workshop.SelectedItem).ID);  //车间编号
            inParameters.Add(tbx_cell_erplot.Text);                      //电池erp批号
            inParameters.Add(cbx_cell_color.Text);                       //片源颜色
            inParameters.Add(tbx_eff_low.Text);                          //片源效率低
            inParameters.Add(tbx_eff_up.Text);                           //片源效率高
            inParameters.Add(tbx_cell_power.Text);                       //单片功率
            inParameters.Add(tbx_cell_grade.Text);                       //片源等级
            inParameters.Add(tbx_cellbatch_count.Text);                  //分批数量
            inParameters.Add(((ListItem)cbx_cell_comp.SelectedItem).ID); //电池厂商

            FuncTagInfo functionTag = null;
            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "CreateCellBatchNo";
            functionTag.InputParams = inParameters.ToArray();
            functionTag.UserName    = _user;

            WcfRequests.SendGeneralRequest(onCreateBatchNoCompleted, functionTag);
        }
Пример #10
0
        private void setCurrentUserInfo()
        {
            string[] arrParameter = new string[2];

            arrParameter[0] = _currentUser;
            arrParameter[1] = Dns.GetHostName();

            FuncTagInfo oFuncTagInfo = new FuncTagInfo();

            oFuncTagInfo.FuncName     = "setCurrentUserInfo";
            oFuncTagInfo.UserName     = _currentUser;
            oFuncTagInfo.ComputerName = Dns.GetHostName();
            oFuncTagInfo.InputParams  = arrParameter;
            WcfRequests.SendGeneralRequest(onSetCurrentUserInfoCompleted, oFuncTagInfo);
        }
Пример #11
0
        void login_cusEvtLogin(string UserID)
        {
            string[] userInfo = UserID.Split('|');
            _currentUser = userInfo[0];
            this.toolStripUserLabel.Text = userInfo[1];

            string[] arrParameter = new string[2];

            arrParameter[0] = _currentUser;

            FuncTagInfo oFuncTagInfo = new FuncTagInfo();

            oFuncTagInfo.FuncName    = "GetMenuItem";
            oFuncTagInfo.InputParams = arrParameter;
            WcfRequests.SendGeneralRequest(OnGetUserPermissionsCompleted, oFuncTagInfo);
        }
Пример #12
0
Файл: Pack.cs Проект: TGHGH/MES
        /// <summary>
        /// 确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ok_Click(object sender, EventArgs e)
        {
            tbx_module_id.Text    = tbx_module_id.Text.Trim().ToUpper();
            btn_ok.Enabled        = false;
            tbx_module_id.Enabled = false;

            List <string> inParameters = new List <string>();

            inParameters.Add(tbx_module_id.Text);                               //组件号

            FuncTagInfo functionTag = new FuncTagInfo();

            functionTag.FuncName    = "GetModuleInfo";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendWipRequest(onGetModuleInfoReceived, functionTag);
        }
Пример #13
0
        /// <summary>
        /// 确认按钮-写入数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ok_Click(object sender, EventArgs e)
        {
            #region 检查是否先生成序列号
            if (dgv_module_id.Rows.Count < 1)
            {
                MessageBox.Show("请先生成序列号!");
                return;
            }
            #endregion

            //写入数据库
            string workorder = cbx_workorder.Text;
            string workshop  = ((ListItem)cbx_workshop.SelectedItem).ID;
            #region 开始流水号
            int    iStart      = 0;
            string sLastFlowID = _woWIPinfo[cbx_workorder.SelectedIndex].rowData[7];
            if (sLastFlowID == string.Empty)
            {
                iStart = 1;
            }
            else
            {
                iStart = int.Parse(sLastFlowID) + 1;
            }
            #endregion
            string startModuleIdx = iStart.ToString();
            string endModuleIdx   = (int.Parse(startModuleIdx) + int.Parse(tbx_label_count.Text)).ToString();

            List <string> lstInputParas = new List <string>();
            lstInputParas.Add(workorder);                         //工单
            lstInputParas.Add(workshop);                          //车间
            lstInputParas.Add(startModuleIdx);                    //起始序列号
            lstInputParas.Add(_modulePrefix);                     //组件前缀
            lstInputParas.Add(endModuleIdx);                      //截至序列号
            lstInputParas.Add(_user);
            lstInputParas.Add(_createLabelDateTime);              //生码日期

            FuncTagInfo wipFunctag = new FuncTagInfo();
            wipFunctag             = new FuncTagInfo();
            wipFunctag.FuncName    = "CreateLabel";
            wipFunctag.InputParams = lstInputParas.ToArray();


            WcfRequests.SendWipRequest(onCreateLabelReceived, wipFunctag);
        }
Пример #14
0
        private void CellDistribute_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion


            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            inParameters.Add(BasicClass.comoboxItemName.Workshop);
            inParameters.Add(BasicClass.comoboxItemName.Cell_comp);
            inParameters.Add(BasicClass.comoboxItemName.Cell_color);
            //inParameters[1] = "wo_type";
            //inParameters[2] = "cristal_type";
            //inParameters[3] = "cell_size";
            //inParameters[4] = "cell_consumption";
            //inParameters[5] = "cell_type";
            //inParameters[6] = "wo_type";

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion

            BasicClass.EnterToTab(groupBox_cell_info);
            //asc.controllInitializeSize(this);

            //this.SizeChanged += new EventHandler(MachineMaintain_SizeChanged);

            changeColorTimer.Interval = 1000 * 60;//60 second
            changeColorTimer.Tick    += new EventHandler(changeColorTimer_Tick);

            //创建文件夹,打印用
            if (!Directory.Exists(@"c:\BarcodePrint_cell"))
            {
                Directory.CreateDirectory(@"c:\BarcodePrint_cell");
            }
        }
Пример #15
0
        /// <summary>
        /// 选择车间
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void cbx_workshop_SelectedIndexChanged(object sender, EventArgs e)
        {
            cbx_workshop.Enabled = false;

            #region 获取设备机台号
            List <string> lstInputParas = new List <string>();
            lstInputParas.Add(BasicClass.comoboxItemName.FrameEqpType);
            lstInputParas.Add(((ListItem)cbx_workshop.SelectedItem).ID);

            FuncTagInfo wipFunctag = new FuncTagInfo();
            wipFunctag             = new FuncTagInfo();
            wipFunctag.FuncName    = "GetEQPInfo";
            wipFunctag.InputParams = lstInputParas.ToArray();


            WcfRequests.SendWipRequest(onGetEQPInfoReceived, wipFunctag);
            #endregion
        }
Пример #16
0
        private void BuildWO_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            inParameters.Add(BasicClass.comoboxItemName.Workshop);
            inParameters.Add(BasicClass.comoboxItemName.WO_type);
            inParameters.Add(BasicClass.comoboxItemName.Cristal_Type);
            inParameters.Add(BasicClass.comoboxItemName.Cell_Size);
            inParameters.Add(BasicClass.comoboxItemName.Cell_Consumption);
            inParameters.Add(BasicClass.comoboxItemName.Cell_Type);
            inParameters.Add(BasicClass.comoboxItemName.Workflow);
            inParameters.Add(BasicClass.comoboxItemName.Module_color);
            inParameters.Add(BasicClass.comoboxItemName.Module_type);
            inParameters.Add(BasicClass.comoboxItemName.PID_type);
            inParameters.Add(BasicClass.comoboxItemName.Product_name1);
            inParameters.Add(BasicClass.comoboxItemName.Product_name2);

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();;

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion


            BasicClass.EnterToTab(groupBox_woinfo);
            //asc.controllInitializeSize(this);

            //this.SizeChanged += new EventHandler(MachineMaintain_SizeChanged);

            changeColorTimer.Interval = 1000 * 60;//60 second
            changeColorTimer.Tick    += new EventHandler(changeColorTimer_Tick);
        }
Пример #17
0
        /// <summary>
        /// 扫描电池片批号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void tbx_cell_batch_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                iScanCount          = 0;
                btn_scan_count.Text = iScanCount.ToString();
                _currentBatch       = tbx_cell_batch.Text.Trim();

                //获取批号信息
                FuncTagInfo functionTag = new FuncTagInfo();

                List <string> lstInputParas = new List <string>();
                lstInputParas.Add(_currentBatch);

                functionTag.FuncName    = "GetCellBatchInfo";
                functionTag.InputParams = lstInputParas.ToArray();

                WcfRequests.SendWipRequest(onCellBatchInfoReceive, functionTag);
            }
        }
Пример #18
0
        private void MachineMaintain_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion


            BasicClass.EnterToTab(groupBoxAddMachine);
            //asc.controllInitializeSize(this);

            //this.SizeChanged += new EventHandler(MachineMaintain_SizeChanged);

            changeColorTimer.Interval = 1000 * 60;//60 second
            changeColorTimer.Tick    += new EventHandler(changeColorTimer_Tick);
        }
Пример #19
0
        private void CellReturn_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            inParameters.Add(BasicClass.comoboxItemName.Workshop);

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion

            #region trigger
            tbx_module.KeyDown += new KeyEventHandler(tbx_module_KeyDown);
            #endregion

            #region 退库明细datagridView
            dgv_cellreturn_detail.AllowUserToAddRows  = false;
            dgv_cellreturn_detail.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dgv_cellreturn_detail.Font     = new System.Drawing.Font("宋体", 12, FontStyle.Regular);
            dgv_cellreturn_detail.ReadOnly = true;
            dgv_cellreturn_detail.Columns.Add("moduleID", "序列号");
            dgv_cellreturn_detail.Columns.Add("cellBatch", "批号");
            dgv_cellreturn_detail.Columns.Add("eqp", "机台");
            #endregion

            color = this.BackColor;

            changeColorTimer.Interval = 1000 * 3;//2 second
            changeColorTimer.Tick    += new EventHandler(changeColorTimer_Tick);
        }
Пример #20
0
        /// <summary>
        /// 扫描组件号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void tbx_module_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode.Equals(Keys.Enter))
            {
                if (lstScanedModule.Contains(tbx_module.Text))
                {
                    return;
                }

                tbx_module.Enabled = false;
                //获取批次信息
                List <string> inParameters = new List <string>();
                inParameters.Add(tbx_module.Text);

                functionTag             = new FuncTagInfo();
                functionTag.FuncName    = "GetModuleBingingInfo";
                functionTag.InputParams = inParameters.ToArray();

                WcfRequests.SendGeneralRequest(onGetModuleBingingInfoReceived, functionTag);
            }
        }
Пример #21
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            #region 检查必输项
            if (machine_id.Text.Trim() == string.Empty || machine_name.Text.Trim() == string.Empty ||
                worksite_id.Text.Trim() == string.Empty)
            {
                MessageBox.Show("必选项不能为空!");
                return;
            }
            if (machine_id.Text.Trim().Length != 9)
            {
                MessageBox.Show("设备编码不符合规定,请重新编码!");
                return;
            }

            string workshop = machine_id.Text.Substring(0, 3);
            if (!System.Text.RegularExpressions.Regex.IsMatch(workshop, "^M\\d{2}$"))
            {
                MessageBox.Show("设备编码不符合规定,请重新编码!");
                return;
            }
            #endregion

            List <string> inParameters = new List <string>();
            inParameters.Add(machine_id.Text.Trim());
            inParameters.Add(machine_name.Text.Trim());
            inParameters.Add(manufacturer.Text.Trim());
            inParameters.Add(worksite_id.Text.Trim());
            inParameters.Add(remark.Text.Trim());
            inParameters.Add(workshop);


            FuncTagInfo functionTag = null;
            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "MachineMaintain";
            functionTag.UserName    = _user;
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
        }
Пример #22
0
        private void AddUser_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox下拉项
            List <string> inParameters = new List <string>();
            inParameters.Add(BasicClass.comoboxItemName.Workshop);
            inParameters.Add(BasicClass.comoboxItemName.Dept);

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion
        }
Пример #23
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            List <string> sInputParas = new List <string>();

            #region 检查必输项
            if (comboBox_workshop.Text == string.Empty ||                  //车间
                comboBox_wo_type.Text == string.Empty ||                   //工单类型
                cbx_module_type.Text == string.Empty ||                    //组件类型
                cbx_pid_type.Text == string.Empty ||                       //pid类型
                comboBox_order_id.Text == string.Empty ||                  //订单
                comboBox_producing_flow.Text == string.Empty ||            //制造流程
                cbx_module_color.Text == string.Empty ||                   //组件颜色
                cbx_module_type.Text == string.Empty ||                    //组件类型
                comboBox_cristal_type.Text == string.Empty ||              //晶体类型
                comboBox_cell_size.Text == string.Empty ||                 //片源规格
                comboBox_cell_consumption.Text == string.Empty ||          //片源用量
                comboBox_cell_type.Text == string.Empty ||                 //片源类型
                cbx_pid_type.Text == string.Empty)
            {
                MessageBox.Show("必输项不能为空!");
                return;
            }

            if (!BasicClass.isNumeric(textBox_wo_qty.Text.Trim()) ||
                !BasicClass.isNumeric(textBox_wo_seq.Text.Trim()))
            {
                MessageBox.Show("非数字类型错误!");
                return;
            }

            #endregion

            sInputParas.Add(((ListItem)comboBox_workshop.SelectedItem).ID);         //车间
            sInputParas.Add(((ListItem)comboBox_wo_type.SelectedItem).ID);          //工单类型
            sInputParas.Add(((ListItem)cbx_module_type.SelectedItem).ID);           //组件类型
            sInputParas.Add(((ListItem)cbx_pid_type.SelectedItem).ID);              //pid类型
            sInputParas.Add(comboBox_order_id.Text);                                //订单编号
            sInputParas.Add(textBox_customer.Text);                                 //客户
            sInputParas.Add(textBox_wo_qty.Text);                                   //投产总数
            sInputParas.Add(((ListItem)comboBox_producing_flow.SelectedItem).ID);   //制造流程
            sInputParas.Add(textBox_wo_seq.Text);                                   //工单次数
            sInputParas.Add(((ListItem)cbx_module_color.SelectedItem).ID);          //组件颜色
            sInputParas.Add(((ListItem)comboBox_cristal_type.SelectedItem).ID);     //晶体类型
            sInputParas.Add(((ListItem)comboBox_cell_size.SelectedItem).ID);        //片源规格
            sInputParas.Add(((ListItem)comboBox_cell_consumption.SelectedItem).ID); //片源用量
            sInputParas.Add(((ListItem)comboBox_cell_type.SelectedItem).ID);        //片源类型

            if (comboBox_product_id1.Text.Trim() != string.Empty)
            {
                sInputParas.Add(((ListItem)comboBox_product_id1.SelectedItem).ID);         //产品编码1
            }
            else
            {
                sInputParas.Add(string.Empty);         //产品编码1
            }
            if (comboBox_product_id2.Text.Trim() != string.Empty)
            {
                sInputParas.Add(((ListItem)comboBox_product_id2.SelectedItem).ID);           //产品编码2
            }
            else
            {
                sInputParas.Add(string.Empty);           //产品编码2
            }

            FuncTagInfo funcTagInfo = new FuncTagInfo();
            funcTagInfo.FuncName = "CreateWO";
            funcTagInfo.UserName = _user;

            funcTagInfo.InputParams = sInputParas.ToArray();
            WcfRequests.SendGeneralRequest(onCreateWOCompleted, funcTagInfo);
        }
Пример #24
0
Файл: Pack.cs Проект: TGHGH/MES
        /// <summary>
        /// 获取到托盘信息
        /// </summary>
        /// <param name="wipDataReceived"></param>
        private void onCreatePckInfoReceived(CallBackData wipDataReceived)
        {
            if (!wipDataReceived.bIsOK)
            {
                //MessageBox.Show(wipDataReceived.Result);
                tbx_module_id.Enabled = true;
                btn_ok.Enabled        = true;

                this.BackColor = Color.Red;
                changeColorTimer.Start();

                toolStripStatusLabelRight.Text      = wipDataReceived.Result;
                toolStripStatusLabelRight.BackColor = Color.Red;

                tbx_module_id.Focus();
                tbx_module_id.SelectAll();
                return;
            }

            //==>如果托盘内组件数量等于设定数量,则自动打印,否则,把托盘信息加入字典
            string[] palletTag = wipDataReceived.Result.Split('|');
            int      i         = 0;

            _currentPallet = palletTag[i++];                             //托盘号
            int    iPrintCount        = Convert.ToInt32(palletTag[i++]); //预设包装数量
            string palletTagInfo      = palletTag[i++];                  //托盘pattern
            string palletPower        = palletTag[i++];                  //A4_功率
            string pallettype         = palletTag[i++];                  //A4_类型
            string jbox_spec          = palletTag[i++];                  //A4_线盒规格
            string frame_spec         = palletTag[i++];                  //A4_边框规格
            string pallet_class_grade = palletTag[i++];                  //A4_质量等级
            string busbar_type        = palletTag[i++];                  //A4_三栅四删类型  需求改为了电流等级2015-10-07

            RowData[] rowDatas = wipDataReceived.RowDatas;               //组件数量

            //显示包装数量
            btn_packing_count.Text = rowDatas.Count().ToString();

            if (rowDatas.Count() == iPrintCount)
            {//====>打印,并删除托盘字典中托盘号
                #region create file stream
                string strWriteFileStream =
                    _currentPallet + "," + palletPower + "," + pallettype + "," + jbox_spec + "," + frame_spec + "," + pallet_class_grade + ",";

                strWriteFileStream = strWriteFileStream + busbar_type + ",";

                for (int idx = 0; idx < rowDatas.Length; idx++)
                {
                    string[] rowdata       = rowDatas[idx].rowData;
                    string   module_d_temp = rowdata[1];
                    strWriteFileStream = strWriteFileStream + module_d_temp + ",";
                }

                #endregion

                using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"c:\BarcodePrint\A4Label.txt", false))
                {
                    file.WriteLine(strWriteFileStream);
                }

                using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"c:\BarcodePrint\usb.bat", false))
                {
                    file.WriteLine("@echo off");
                    if (busbar_type == "三栅")
                    {
                        file.WriteLine("Bartend.exe /F=\"C:\\BarcodePrint\\China3.btw\" /D=\"C:\\BarcodePrint\\A4Label.txt\" /P /x");
                    }
                    else if (busbar_type == "三栅")
                    {
                        file.WriteLine("Bartend.exe /F=\"C:\\BarcodePrint\\China4.btw\" /D=\"C:\\BarcodePrint\\A4Label.txt\" /P /x");
                    }
                    //file.WriteLine("Bartend.exe /F=\"C:\\BarcodePrint\\China.btw\" /D=\"C:\\BarcodePrint\\A4Label.txt\" /P /x");
                }

                try
                {
                    System.Diagnostics.Process.Start(@"c:\BarcodePrint\usb.bat");
                }
                catch (Exception)
                {
                    throw;
                }

                _dicPalletPattern.Remove(_currentPallet);
                dgv_pallet_info.Rows.Clear();
                //printLabel();
                //清空相关空间内容
                btn_packing_count.Text = string.Empty;
                btn_power_grade.Text   = string.Empty;
                btn_Imp_Grade.Text     = string.Empty;
                btn_final_grade.Text   = string.Empty;

                //==>更新托盘信息
                List <string> lstInparas = new List <string>();
                lstInparas.Add(_currentPallet);
                lstInparas.Add(iPrintCount.ToString());

                FuncTagInfo wipFunctionTag = new FuncTagInfo();
                wipFunctionTag.FuncName    = "UpdatePalletInfo";
                wipFunctionTag.InputParams = lstInparas.ToArray();

                WcfRequests.SendWipRequest(onUpdatePalletInfoReceived, wipFunctionTag);
            }
            else
            {//====>加入托盘字典,并更新托盘明细信息
                if (!_dicPalletPattern.ContainsKey(_currentPallet))
                {
                    _dicPalletPattern.Add(_currentPallet, palletTagInfo);
                }

                dgv_pallet_info.Rows.Clear();
                DataTable dt        = new DataTable();
                RowData[] row40data = wipDataReceived.RowDatas;
                for (i = 0; i < row40data.Length; i++)
                {
                    dgv_pallet_info.Rows.Add();

                    string[] rowdata = row40data[i].rowData;

                    for (int j = 0; j < rowdata.Length; j++)
                    {
                        dgv_pallet_info.Rows[i].Cells[j].Value = rowdata[j];
                    }
                }
            }

            btn_ok.Enabled        = true;
            tbx_module_id.Enabled = true;
            tbx_module_id.Focus();
            tbx_module_id.SelectAll();
        }
Пример #25
0
Файл: Pack.cs Проект: TGHGH/MES
        private void Pack_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            inParameters.Add(Module.BasicClassLib.BasicClass.comoboxItemName.Workshop);
            //inParameters.Add("frame_comp");
            //inParameters.Add("glue_comp");
            //inParameters.Add("jbox_desc");
            //inParameters.Add("frame_desc");
            //inParameters.Add("glue_desc");

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion

            #region 设置datagridView
            dgv_pallet_info.AllowUserToAddRows  = false;
            dgv_pallet_info.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dgv_pallet_info.Font     = new System.Drawing.Font("宋体", 12, FontStyle.Regular);
            dgv_pallet_info.ReadOnly = true;
            dgv_pallet_info.Columns.Add("carton_no", "托盘号");
            dgv_pallet_info.Columns.Add("module_id", "组件序列号");
            dgv_pallet_info.Columns.Add("pmax", "最大功率");
            dgv_pallet_info.Columns.Add("ipm", "最大电流");
            #endregion

            #region trigger
            tbx_module_id.KeyDown += new KeyEventHandler(tbx_module_id_KeyDown);

            cbx_workshop.SelectedIndexChanged += new EventHandler(cbx_workshop_SelectedIndexChanged);
            #endregion

            tbx_module_id.Enabled = false;

            //创建文件夹,打印用
            if (!Directory.Exists(@"c:\BarcodePrint"))
            {
                Directory.CreateDirectory(@"c:\BarcodePrint");
            }

            checkBox_final_grade.Checked  = true;
            checkBox_imp.Checked          = true;
            checkBox_module_color.Checked = true;
            checkBox_module_count.Checked = true;
            checkBox_power.Checked        = true;
            checkBox_sale_order.Checked   = true;
            checkBox_workorder.Checked    = true;


            changeColorTimer.Interval = 1000 * 2;//2 second
            changeColorTimer.Tick    += new EventHandler(changeColorTimer_Tick);

            color = this.BackColor;
        }
Пример #26
0
        /// <summary>
        /// 确认按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ok_Click(object sender, EventArgs e)
        {
            tbx_module_id.Text = tbx_module_id.Text.Trim().ToUpper();

            #region 检查输入项
            if (cbx_jbox_comp.Text == string.Empty ||
                cbx_frame_comp.Text == string.Empty ||
                cbx_glue_comp.Text == string.Empty ||
                cbx_jobx_desc.Text == string.Empty ||
                cbx_frame_desc.Text == string.Empty ||
                cbx_glue_desc.Text == string.Empty ||
                cbx_frame_glue_comp.Text == string.Empty ||
                cbx_fram_glue_desc.Text == string.Empty)
            {
                //MessageBox.Show("必选项不能为空!");
                toolStripStatusLabelRight.Text      = "必选项不能为空!";
                toolStripStatusLabelRight.BackColor = Color.Red;

                this.BackColor = Color.Red;
                changeColorTimer.Start();

                tbx_module_id.Focus();
                tbx_module_id.SelectAll();

                return;
            }

            if (!System.Text.RegularExpressions.Regex.IsMatch(tbx_module_id.Text, BasicClass.sModulePattern))
            {
                //MessageBox.Show("您输入的组件序列号格式有误,请检查!");
                toolStripStatusLabelRight.Text      = "您输入的组件序列号格式有误,请检查!";
                toolStripStatusLabelRight.BackColor = Color.Red;

                this.BackColor = Color.Red;
                changeColorTimer.Start();

                tbx_module_id.Focus();
                tbx_module_id.SelectAll();
                return;
            }

            string module_id = tbx_module_id.Text.Trim();
            tbx_module_id.Text = string.Empty;
            #endregion


            tbx_module_id.Enabled = false;
            List <string> inParameters = new List <string>();
            inParameters.Add(module_id);                                       //组件号
            inParameters.Add(_currentSite);                                    //当前站点
            inParameters.Add(_currentEqp);                                     //当前设备
            inParameters.Add(((ListItem)cbx_jbox_comp.SelectedItem).ID);       //jbox厂商
            inParameters.Add(((ListItem)cbx_frame_comp.SelectedItem).ID);      //型材厂商
            inParameters.Add(((ListItem)cbx_glue_comp.SelectedItem).ID);       //硅胶厂商
            inParameters.Add(((ListItem)cbx_jobx_desc.SelectedItem).ID);       //jbox规格
            inParameters.Add(((ListItem)cbx_frame_desc.SelectedItem).ID);      //型材规格
            inParameters.Add(((ListItem)cbx_glue_desc.SelectedItem).ID);       //硅胶规格
            inParameters.Add(_user);
            inParameters.Add(((ListItem)cbx_workshop.SelectedItem).ID);        //车间
            inParameters.Add(BasicClass.getTime());                            //白晚班
            inParameters.Add(((ListItem)cbx_frame_glue_comp.SelectedItem).ID); //型材胶厂商
            inParameters.Add(((ListItem)cbx_fram_glue_desc.SelectedItem).ID);  //型材胶规格

            FuncTagInfo functionTag = new FuncTagInfo();
            functionTag.FuncName    = "InsertMoudleFrameInfo";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onInsertModuleFrameInfoReceived, functionTag);
        }
Пример #27
0
        private void PackConfig_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            //inParameters.Add("equipment");
            inParameters.Add(BasicClass.comoboxItemName.Workshop);
            inParameters.Add(BasicClass.comoboxItemName.PowerTemplate);
            inParameters.Add(BasicClass.comoboxItemName.PackCount);

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion

            #region 功率档位设定datagridView
            //dgv_power_set.AllowUserToAddRows = false;
            dgv_power_set.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dgv_power_set.Font = new System.Drawing.Font("宋体", 12, FontStyle.Regular);
            //dgv_power_set.ReadOnly = true;
            dgv_power_set.Columns.Add("powerGrade", "等级");
            dgv_power_set.Columns.Add("minPower", "瓦数起始");
            dgv_power_set.Columns.Add("maxPower", "瓦数结束");
            #endregion

            #region 电流档位设定datagridView
            dgv_imp_set.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dgv_imp_set.Font = new System.Drawing.Font("宋体", 12, FontStyle.Regular);
            dgv_imp_set.Columns.Add("powerGrade", "功率档位");
            dgv_imp_set.Columns.Add("ImpGrade", "电流档位");
            dgv_imp_set.Columns.Add("minImp", "imp起始");
            dgv_imp_set.Columns.Add("maxImp", "imp结束");
            #endregion

            #region trigger
            //功率模板选择
            cbx_template.SelectedIndexChanged += new EventHandler(cbx_template_SelectedIndexChanged);
            //双击功率模板
            dgv_power_set.CellDoubleClick += new DataGridViewCellEventHandler(dgv_power_set_CellDoubleClick);

            //修改功率值
            dgv_power_set.CellValueChanged += new DataGridViewCellEventHandler(dgv_power_set_CellValueChanged);
            //删除一条功率档位
            dgv_power_set.UserDeletingRow += new DataGridViewRowCancelEventHandler(dgv_power_set_UserDeletingRow);
            //修改电流值
            dgv_imp_set.CellValueChanged += new DataGridViewCellEventHandler(dgv_imp_set_CellValueChanged);
            //删除电流档位
            dgv_imp_set.UserDeletingRow += new DataGridViewRowCancelEventHandler(dgv_imp_set_UserDeletingRow);

            //选择车间
            cbx_workshop.SelectedIndexChanged += new EventHandler(cbx_workshop_SelectedIndexChanged);

            //选择工单
            cbx_wo.SelectedIndexChanged += new EventHandler(cbx_wo_SelectedIndexChanged);
            #endregion

            cbx_wo.Enabled = false;
        }
Пример #28
0
        /// <summary>
        /// 确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ok_Click(object sender, EventArgs e)
        {
            #region check
            if (cbx_wo.Text == string.Empty ||
                cbx_pack_count.Text == string.Empty)
            {
                MessageBox.Show("必选项不能为空!");
                return;
            }
            #endregion


            List <string> inParameters = new List <string>();
            inParameters.Add(cbx_wo.Text);                  //工单
            inParameters.Add(cbx_pack_count.Text);          //包装数量
            inParameters.Add(tbx_sale_order.Text);          //订单

            #region 获取功率配置参数
            foreach (var item in dgv_power_set.Rows)
            {
                if (((DataGridViewRow)item).Cells[0].Value == null)
                {
                    continue;
                }
                string powerGrade = ((DataGridViewRow)item).Cells[0].Value.ToString();
                string upPower    = ((DataGridViewRow)item).Cells[1].Value.ToString();
                string lowPower   = ((DataGridViewRow)item).Cells[2].Value.ToString();

                _dicPowerGradeFinal[powerGrade].Clear();
                _dicPowerGradeFinal[powerGrade].Add(powerGrade);
                _dicPowerGradeFinal[powerGrade].Add(lowPower);
                _dicPowerGradeFinal[powerGrade].Add(upPower);

                if (_dicImpGradeFinal.Keys.Contains(powerGrade))
                {
                    if (_dicImpGradeFinal[powerGrade].Count > 1)
                    {
                        _dicPowerGradeFinal[powerGrade].AddRange(_dicImpGradeFinal[powerGrade]);
                    }
                }
            }

            //inParameters.Add(((ListItem)cbx_template.SelectedItem).ID);

            foreach (var item in _dicPowerGradeFinal.Values)
            {
                string PowerInfo = string.Empty;
                int    lstCount  = ((List <string>)item).Count;

                if (lstCount < 1)
                {
                    continue;
                }

                for (int i = 0; i < lstCount; i++)
                {
                    PowerInfo = PowerInfo + ((List <string>)item)[i] + "|";
                }
                PowerInfo = PowerInfo.Substring(0, PowerInfo.Length - 1);
                inParameters.Add(PowerInfo);

                //string PowerInfo=
            }
            #endregion

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "SetPowerGrade";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onSetPowerGradeReceived, functionTag);
        }
Пример #29
0
        /// <summary>
        /// 确定按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ok_Click(object sender, EventArgs e)
        {
            #region 信息检查
            //if (tbx_module_id.Text.Trim()==string.Empty)
            //{
            //    MessageBox.Show("请输入组件序列号");
            //    return;
            //}
            tbx_module_id.Text = tbx_module_id.Text.Trim().ToUpper();
            if (!System.Text.RegularExpressions.Regex.IsMatch(tbx_module_id.Text.Trim(), BasicClass.sModulePattern))
            {
                //MessageBox.Show("组件序列号输入有误!");
                toolStripStatusLabelRight.Text = "组件序列号输入有误!";

                this.BackColor = Color.Red;
                changeColorTimer.Start();

                tbx_module_id.Focus();
                tbx_module_id.SelectAll();
                return;
            }

            if (cbx_eqp.Text == string.Empty ||
                cbx_workshop.Text == string.Empty)
            {
                //MessageBox.Show("必输项不能为空!");
                toolStripStatusLabelRight.Text = "必输项不能为空!";

                this.BackColor = Color.Red;
                changeColorTimer.Start();

                tbx_module_id.Focus();
                tbx_module_id.SelectAll();
                return;
            }

            if (dgv_cellbatch_info.RowCount < 1)
            {
                //MessageBox.Show("请先扫描电池片批次信息");
                toolStripStatusLabelRight.Text = "请先扫描电池片批次信息!";

                this.BackColor = Color.Red;
                changeColorTimer.Start();

                tbx_cell_batch.Focus();
                tbx_cell_batch.SelectAll();
                return;
            }


            //判断当前数量是否大于所要扣除的数量,如果小于则不扣;
            int currentBatchCount = int.Parse(dgv_cellbatch_info.Rows[0].Cells["columnCurrentCount"].Value.ToString());

            if (currentBatchCount < 60)
            {
                //MessageBox.Show("当前物料数量不足,请更新批次!");
                toolStripStatusLabelRight.Text = "当前物料数量不足,请更新批次!";

                this.BackColor = Color.Red;
                changeColorTimer.Start();
                tbx_module_id.Focus();
                tbx_module_id.SelectAll();
                return;
            }

            #endregion

            string module_id = tbx_module_id.Text.Trim();
            tbx_module_id.Text  = string.Empty;
            tbx_cell_batch.Text = string.Empty;


            ////记录到数据库中 电池片绑定没有检查站点,因为是第一站,无所谓
            FuncTagInfo functionTag = new FuncTagInfo();

            List <string> lstInputParas = new List <string>();
            lstInputParas.Add(_currentBatch);                            //批次号
            lstInputParas.Add(module_id);                                //组件号
            lstInputParas.Add(cbx_hulian_comp.Text);                     //互联条
            lstInputParas.Add(cbx_huiliu_comp.Text);                     //汇流条
            lstInputParas.Add(_currentEqp);                              //设备号
            lstInputParas.Add(_user);
            lstInputParas.Add(((ListItem)cbx_workshop.SelectedItem).ID); //车间
            lstInputParas.Add(BasicClass.getTime());

            functionTag.FuncName    = "CellBinding";
            functionTag.InputParams = lstInputParas.ToArray();

            WcfRequests.SendWipRequest(onCellBindingReceive, functionTag);
        }
Пример #30
0
        private void CellBinding_Load(object sender, EventArgs e)
        {
            #region 获取当前主机的登录用户
            FuncTagInfo functionTag = null;
            functionTag              = new FuncTagInfo();
            functionTag.FuncName     = "getCurrentUser";
            functionTag.ComputerName = Dns.GetHostName();;

            WcfRequests.SendGeneralRequest(onCurrentUserReceive, functionTag);
            #endregion

            #region 初始化comobox的下拉项
            List <string> inParameters = new List <string>();
            //inParameters.Add("equipment");
            inParameters.Add(BasicClass.comoboxItemName.Hulian_Comp);
            inParameters.Add(BasicClass.comoboxItemName.Huiliu_Comp);
            inParameters.Add(BasicClass.comoboxItemName.Workshop);
            //inParameters.Add("cell_size");
            //inParameters.Add("cell_consumption");
            //inParameters.Add("cell_type");
            //inParameters.Add("wo_type");

            functionTag             = new FuncTagInfo();
            functionTag.FuncName    = "GetComoboxItems";
            functionTag.InputParams = inParameters.ToArray();

            WcfRequests.SendGeneralRequest(onReceiveComoboxItems, functionTag);
            #endregion

            #region 物料信息明细datagridView
            dgv_cellbatch_info.AllowUserToAddRows  = false;
            dgv_cellbatch_info.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            dgv_cellbatch_info.Font     = new System.Drawing.Font("宋体", 12, FontStyle.Regular);
            dgv_cellbatch_info.ReadOnly = true;
            dgv_cellbatch_info.Columns.Add("columnBatchNo", "物料批次");
            dgv_cellbatch_info.Columns.Add("columnTotalCount", "批次数量");
            dgv_cellbatch_info.Columns.Add("columnCurrentCount", "剩余数量");
            dgv_cellbatch_info.Columns.Add("cell_comp", "电池片厂商");
            #endregion

            #region trigger
            //扫描电池片批次
            tbx_cell_batch.KeyDown += new KeyEventHandler(tbx_cell_batch_KeyDown);

            //扫描组件序列号
            tbx_module_id.KeyDown += new KeyEventHandler(tbx_module_id_KeyDown);

            //选择设备
            cbx_eqp.SelectedIndexChanged += new EventHandler(cbx_eqp_SelectedIndexChanged);

            //选择车间
            cbx_workshop.SelectedIndexChanged += new EventHandler(cbx_workshop_SelectedIndexChanged);

            #endregion

            cbx_eqp.Enabled       = false;
            tbx_module_id.Enabled = false;
            btn_scan_count.Text   = "0";

            changeColorTimer.Interval = 1000 * 3;//2 second
            changeColorTimer.Tick    += new EventHandler(changeColorTimer_Tick);

            color = this.BackColor;
        }