コード例 #1
0
        //private void Init()
        //{

        //    List<AndonAlertEntity> andon = AndonFactory.GetByTime();
        //    for (int i = 0; i < andon.Count; i++)
        //    {
        //        if (GridAndon.Rows.Count < andon.Count)
        //            GridAndon.Rows.Add();
        //        StationEntity Stationen = StationFactory.GetByPrimaryKey(andon[i].LOCATION_CODE);
        //        LocationEntity location = LocationFactory.GetByMasterKey(Stationen.RMES_ID);
        //        GridAndon.Rows[i].Cells[0].Value = andon[i].ANDON_ALERT_TIME.ToString("MM/dd/HH:mm");
        //        GridAndon.Rows[i].Cells[1].Value = Stationen.STATION_NAME;
        //       // GridAndon.Rows[i].Cells[2].Value = location.LOCATION_NAME;
        //        GridAndon.Rows[i].Cells[3].Value = andon[i].ANDON_ALERT_CONTENT.Substring(3, 4);
        //    }
        //}
        private void Init()
        {
            //textBox.Text = "123";
            List <AndonAlertEntity> andon = AndonFactory.GetByTime();
            string string1 = "";//, string2, string3;
            string string2 = "";
            string string3 = "";
            string string4 = "";
            string str1    = "";

            string[] str = new string[] { "", "", "" };
            for (int i = 0; i < andon.Count; i++)
            {
                StationEntity  Stationen = StationFactory.GetByPrimaryKey(andon[i].LOCATION_CODE);
                LocationEntity location  = LocationFactory.GetByMasterKey(Stationen.RMES_ID);
                TeamEntity     team      = TeamFactory.GetByTeamCode(andon[i].TEAM_CODE);
                string1 = andon[i].ANDON_ALERT_TIME.ToString("MM/dd/HH:mm");
                string2 = Stationen.STATION_NAME;
                string3 = team.TEAM_NAME;
                string4 = andon[i].ANDON_ALERT_CONTENT.ToString();
                str[i]  = string1 + " ," + string2 + string3 + string4;

                str1         = str1 + str[i] + "\r\n";
                textBox.Text = str1;
            }
        }
コード例 #2
0
        private void txtBz_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar.ToString().Equals("\r"))
            {
                try
                {
                    if (txtBz.Text == "")
                    {
                        txtBz.Focus(); return;
                    }

                    string team = txtBz.Text.Trim().ToUpper();
                    switch (team)
                    {
                    case "QUIT":
                        Process.Start("shutdown.exe", "-s -t 10");
                        break;

                    case "EXIT":
                        this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                        this.Close();
                        break;

                    case "CANC":
                        txtBc.Focus();
                        txtBz.Text = "";
                        break;

                    default:
                        break;
                    }

                    DB.WriteConfigLocal("TEAM_CODE", team);
                    LoginInfo.TeamInfo = TeamFactory.GetByTeamCode(team);
                    txtBz.Text         = "";
                    txtBz.Text         = LoginInfo.TeamInfo.TEAM_NAME;
                    e.Handled          = true;
                    //if (txtUser.Text == "")
                    {
                        txtUser.Focus(); return;
                    }
                }
                catch
                {
                    txtBz.Text            = "";
                    txtBz.SelectionStart  = 0;
                    txtBz.SelectionLength = txtBc.Text.Length;
                    txtBz.Focus();
                }
            }
        }
コード例 #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ASPxComboBox cbGCH = ASPxPopupControl1.FindControl("LLGCH") as ASPxComboBox;

            if (cbGCH == null)
            {
                return;
            }
            ASPxComboBox cbGZH = ASPxPopupControl1.FindControl("LLGZH") as ASPxComboBox;

            if (cbGZH == null)
            {
                return;
            }
            ASPxTextBox txtPGDH = ASPxPopupControl1.FindControl("LLPGDH") as ASPxTextBox;

            if (txtPGDH == null)
            {
                return;
            }
            ASPxTextBox txtXMDH = ASPxPopupControl1.FindControl("LLXMDH") as ASPxTextBox;

            if (txtXMDH == null)
            {
                return;
            }
            ASPxTextBox txtXMMC = ASPxPopupControl1.FindControl("LLXMMC") as ASPxTextBox;

            if (txtXMMC == null)
            {
                return;
            }
            ASPxTextBox txtLLSL = ASPxPopupControl1.FindControl("LLSL") as ASPxTextBox;

            if (txtLLSL == null)
            {
                return;
            }
            ASPxComboBox cbTEAM = ASPxPopupControl1.FindControl("LLZPXZ") as ASPxComboBox;

            if (cbTEAM == null)
            {
                return;
            }
            ASPxDateEdit cbLLRQ = ASPxPopupControl1.FindControl("LYRQ") as ASPxDateEdit;

            if (cbLLRQ == null)
            {
                return;
            }
            ASPxTextBox txtXMLX = ASPxPopupControl1.FindControl("LLXMLX") as ASPxTextBox;

            if (txtXMLX == null)
            {
                return;
            }

            string     project_code = cbGCH.SelectedItem.Value.ToString();
            string     work_code    = cbGZH.SelectedItem.Value.ToString();
            string     billno       = txtPGDH.Text;
            string     item_code    = txtXMDH.Text;
            string     item_name    = txtXMMC.Text;
            int        item_qty     = Convert.ToInt32(txtLLSL.Text);
            string     team_cdoe    = cbTEAM.SelectedItem.Value.ToString();
            string     llxmlx       = txtXMLX.Text;
            DateTime   need_date    = cbLLRQ.Date;
            UserEntity u            = UserFactory.GetByID(user.getUserId());
            TeamEntity t            = TeamFactory.GetByTeamCode(team_cdoe);
            UserEntity leader       = UserFactory.GetByUserCode(t.LEADER_CODE);

            if (string.IsNullOrWhiteSpace(project_code) || string.IsNullOrWhiteSpace(work_code) || string.IsNullOrWhiteSpace(billno) ||
                string.IsNullOrWhiteSpace(item_code) || string.IsNullOrWhiteSpace(team_cdoe) || string.IsNullOrWhiteSpace(item_name) ||
                string.IsNullOrWhiteSpace(llxmlx))
            {
                return;
            }
            if (item_qty < 1 || item_qty > 999999)
            {
                return;
            }
            if ((need_date - DateTime.Now).TotalMinutes < 0)
            {
                return;
            }

            ProjectEntity         project   = ProjectFactory.GetByProjectCode(project_code);
            List <WorkShopEntity> workshops = WorkShopFactory.GetUserWorkShops(user.getUserId());

            if (workshops.Count > 0)
            {
                workshop = workshops[0];
            }
            else
            {
                return;
            }

            if (project != null)
            {
                string barCode = DB.GetInstance().ExecuteScalar <string>("select 'RMESL'||TRIM(TO_CHAR(SEQ_ISSUE_BARCODE.NEXTVAL,'0000000000')) from dual");

                InterIssueEntity interEntity = new InterIssueEntity
                {
                    LLGCH     = project_code,                    //领料合同号
                    LLGZH     = work_code,                       //领料工作号
                    LLCPXH    = project.PRODUCT_SERIES,          //领料产品型号
                    LLZJDH    = "MANUAL",                        //领料组件代号
                    PLAN_CODE = "R" + billno,                    //领料派工单号 - 临改单
                    LLLYDW    = workshop.WORKSHOP_CODE,          //领用单位 - 车间
                    LLZPXZ    = team_cdoe,                       //装配小组
                    LLXH      = 1,                               //领料序号
                    LLXMDH    = item_code,                       //项目代号 - 图号
                    LLLYPC    = "1",                             //领用批次
                    LLSL      = item_qty,                        //领料数量
                    LLCJYH    = u.USER_CODE + "/" + u.USER_NAME, //单据创建人
                    LLCJRQ    = DateTime.Now,                    //单据创建日期
                    LLNY      = need_date.ToString("yyMM"),      //领料年月
                    LLRQ      = need_date,                       //领料日期
                    LLXMMC    = item_name,                       //领料项目名称
                    TMBH      = barCode,                         //领料条码编号
                    LLBS      = "W",                             //领料标识
                    LLXZZZ    = leader.USER_CODE + "/" + leader.USER_NAME,
                    LLSPYH    = u.USER_CODE + "/" + u.USER_NAME,
                    LLR       = leader.USER_CODE + "/" + leader.USER_NAME,
                    LLXMLX    = llxmlx.ToUpper()
                };
                object obj = DB.GetInstance().Insert("INTER_ISSUE", "", false, interEntity);
                if (obj.ToString().ToUpper().Equals("TRUE"))
                {
                    Response.Write("<script>alert('添加成功!');</script>");
                    Response.Redirect(Request.Url.ToString());
                }
            }
        }