Beispiel #1
0
        private void FillTable(string tmbh)
        {
            //若条码以扫  则直接返回
            foreach (DataRow dr in dt.Rows)
            {
                string _tmbh = dr["TMBH"].ToString();
                if (tmbh.Equals(_tmbh) || tmbh == _tmbh)
                {
                    return;
                }
            }
            InterIssueEntity ii = InterIssueFactory.getByTMBH(tmbh);

            if (ii == null)
            {
                MessageBox.Show("没有对应物料信息,请重新输入");
                return;
            }
            if (ii.LLBS == "Y" || ii.LLBS.Equals("Y"))
            {
                MessageBox.Show("物料以接收");
                return;
            }
            TeamEntity team = LoginInfo.TeamInfo;
            //判断是否是本小组物料
            //if (!(ii.LLZPXZ.Equals(team.RMES_ID)) || ii.LLZPXZ != team.RMES_ID)
            //{
            //    MessageBox.Show("非本装配小组物料");
            //    return;
            //}
            //根据条码标识获取物料以前接收记录
            List <IssueReceivedEntity> allReceived = IssueReceivedFactory.GetByDetailCode(tmbh);
            float sum = 0;

            foreach (IssueReceivedEntity a in allReceived)
            {
                sum += a.ITEM_QTY;
            }
            dt.Rows.Add(ii.TMBH, ii.LLXMDH, ii.LLXMMC, ii.LLSL, sum, ii.LLSL - sum);
            bs.DataSource            = dt;
            dataGridView1.DataSource = bs;
        }
Beispiel #2
0
 public static int Update(InterIssueEntity IIEntity)
 {
     return(new InterIssueDal().Update(IIEntity));
 }
Beispiel #3
0
 public int Update(InterIssueEntity IIEntity)
 {
     return(db.Update("INTER_ISSUE", "TMBH", IIEntity));
 }
Beispiel #4
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());
                }
            }
        }