예제 #1
0
        //编辑
        public void Edit(string MaterialMRPPlanGuid)
        {
            txtMaterialMRPPlanGuid.Text = MaterialMRPPlanGuid;

            MaterialMRPPlanManage MaterialMRPPlanManage = new MaterialMRPPlanManage();
            DataTable             dtl = MaterialMRPPlanManage.GetMRPPlanByBomPlanGuid(MaterialMRPPlanGuid);

            //加载主数据
            if (dtl.Rows.Count > 0)
            {
                txtMRPPlanID.Text = dtl.Rows[0]["MaterialMRPPlanID"].ToString();

                BeginDate.Text = DateTime.Parse(dtl.Rows[0]["MaterialMRPPlanDate"].ToString()).ToString("yyyy-MM-dd");
                txtRemark.Text = dtl.Rows[0]["Remark"].ToString();
            }

            //加载明细数据
            DataTable dtl2 = new DataTable();

            dtl2 = MaterialMRPPlanManage.GetMRPPlanDetailByBomPlanGuid(MaterialMRPPlanGuid);
            gridControl1.DataSource = dtl2;



            //加载计算物料数据
            DataTable dtl3 = new DataTable();

            dtl3 = MaterialMRPPlanManage.GetMRPPlanCalcSumByBomPlanGuid(MaterialMRPPlanGuid);
            gridControl2.DataSource = dtl3;

            SetRight();

            this.ShowDialog();
        }
예제 #2
0
        private void BindMaterialData(string guid)
        {
            //加载物料明细列表数据
            MaterialMRPPlanManage MaterialMRPPlanManage = new MaterialMRPPlanManage();
            DataTable             dtl3 = new DataTable();

            if (txtSupplier.Text.Trim() != "")
            {
                dtl3 = MaterialMRPPlanManage.GetMRPPlanCalcSumByBomPlanGuid(guid, txtSupplier.Tag.ToString());
            }
            else
            {
                dtl3 = MaterialMRPPlanManage.GetMRPPlanCalcSumByBomPlanGuid(guid);
            }


            gridControl3.DataSource = dtl3;

            //给物料编号列排序
            gridMaterialIDDetail.SortOrder = ColumnSortOrder.Ascending;
        }