Example #1
0
 public MaterialRequireUpdate(string cur_meoid, string cur_state)
 {
     InitializeComponent();
     MEOID    = cur_meoid;
     MEOSTATE = cur_state;
     meolist  = MEOmain.Find(int.Parse(MEOID));
 }
        public void listviewTitleBind()
        {
            dgv1.AutoGenerateColumns = false;
            if (MEOID != "0")
            {
                tn_meono.Enabled = true;

                MEOmain meolist = MEOmain.Find(int.Parse(MEOID));
                if (meolist != null)
                {
                    tn_meono.Text          = meolist.REQUIRE_NO;
                    cmb_site.SelectedValue = meolist.CONTRACT;
                    //tb_project.Text = meolist.PROJECT_ID;
                    //tb_user.Text = meolist.CREATER;
                    txt_designcode.Text = meolist.INFORMATION;
                    txt_remark.Text     = meolist.REMARK;
                    //dateTimePicker1.Value = meolist.CREATE_DATE;
                    cmb_discipline.SelectedValue = meolist.DISCIPLINEID;
                    List <MEOsub> meosublist = MEOsub.FindMEOList(MEOID);
                    if (meosublist.Count != 0)
                    {
                        for (int i = 0; i < meosublist.Count; i++)
                        {
                            dgv1.Rows.Add(1);
                            dgv1.Rows[i].Cells["MEO_ID"].Value  = MEOID;
                            dgv1.Rows[i].Cells["零件号"].Value     = meosublist[i].PART_NO;
                            dgv1.Rows[i].Cells["申请数量"].Value    = meosublist[i].REQUIRE_QTY;
                            dgv1.Rows[i].Cells["需求日期"].Value    = meosublist[i].REQUIRE_DATE;
                            dgv1.Rows[i].Cells["需求原因"].Value    = meosublist[i].REASON_CODE;
                            dgv1.Rows[i].Cells["MEO_ERP"].Value = meosublist[i].MEO_ERP;
                            dgv1.Rows[i].Cells["零件描述"].Value    = meosublist[i].PART_NAME;
                            dgv1.Rows[i].Cells["单位"].Value      = meosublist[i].UNIT_MEAS;
                            //dgv1.Rows[i].Cells["单位"].Value = meosublist[i].UNIT_MEAS;
                            //dgv1.Rows[i].Cells["inventory_qty"].Value = GetInventory(pp.PART_NO, pp.CONTRACT);
                            //dgv1.Rows[i].Cells["meo_qty"].Value = GetMEOqty(pp.ID, ecprojectid);
                            //dgv1.Rows[i].Cells["prediction_qty"].Value = GetParaqty(pp.ID, ecprojectid);
                        }
                    }
                }
            }
            else
            {
                dgv1.Rows.Add(5);
                for (int i = 0; i < 5; i++)
                {
                    dgv1.Rows[i].Cells["MEO_ID"].Value = MEOID;
                    dgv1.Rows[i].Cells["需求原因"].Value   = "1001";
                }
            }
            SetRowNo();
        }