Exemplo n.º 1
0
        protected override void FormLoad()
        {
            base.FormLoad();
            DateTime now       = DateTime.Now;
            DateTime lastMonth = now.AddMonths(-1);

            this.ApplyStartDateEdit.EditValue = new DateTime(lastMonth.Year, lastMonth.Month, lastMonth.Day);
            this.ApplyEndDateEdit.EditValue   = new DateTime(now.Year, now.Month, now.Day);


            #region ApplyUseTypeComboBox
            this.ApplyUseTypeComboBox.DataSource    = EnumTool.GetDataSource(typeof(ApplyUseTypes));
            this.ApplyUseTypeComboBox.SelectedIndex = 1;
            #endregion

            #region ApplyUseDeptComboBox
            DataTable deptDataTable = _Proxy.GetAllDepts();
            DataRow   allDeptRow    = deptDataTable.NewRow();
            allDeptRow["Code"] = "all";
            allDeptRow["Desc"] = "所有";
            deptDataTable.Rows.InsertAt(allDeptRow, 0);

            this.ApplyUseDeptComboBox.DataSource    = deptDataTable;
            this.ApplyUseDeptComboBox.SelectedIndex = 0;
            #endregion

            this.gvApplyUseTypeEdit.DataSource = EnumTool.GetDataSource(typeof(ApplyUseTypes));
        }
Exemplo n.º 2
0
        protected override void FormLoad()
        {
            this.ApplyUseTypeComboBox.DataSource    = EnumTool.GetDataSource(typeof(Enums.ApplyUseTypes));
            this.ApplyUseTypeComboBox.SelectedIndex = 1;
            this.UserComboBox.DataSource            = proxy.GetEmployees();
            this.ApplicantComboBox.DataSource       = proxy.GetEmployees();
            this.ApplyDeptComboBox.DataSource       = proxy.GetAllDepts();

            this.gvUnitEdit.DataSource = proxy.GetUnitList();

            if (formmode == frmmodetype.add)
            {
                ApplyUseOrder = new T_ApplyUseOrder()
                {
                    ApplyUseNo   = proxy.GetLatestApplyUseOrderIndex(),
                    Register     = Global.UserNo,
                    RegisterDesc = Global.UserName
                };

                _ApplyUseOrderDetails = new List <T_ApplyUseOrderDetail>();
            }
            else
            {
                _ApplyUseOrderDetails = proxy.GetApplyUserOrderDetails(ApplyUseOrder.ApplyUseNo);
            }

            SetData();
        }
Exemplo n.º 3
0
        protected override void FormLoad()
        {
            base.FormLoad();
            DateTime now       = DateTime.Now;
            DateTime lastMonth = now.AddMonths(-1);

            this.ApplyStartDateEdit.EditValue = new DateTime(lastMonth.Year, lastMonth.Month, lastMonth.Day);
            this.ApplyEndDateEdit.EditValue   = new DateTime(now.Year, now.Month, now.Day);


            #region POTypeComboBox
            //DataTable poTypeDataTable = EnumTool.GetDataSource(typeof(POTypes));
            //DataRow allPoTypeRow = poTypeDataTable.NewRow();
            //allPoTypeRow["Code"] = "all";
            //allPoTypeRow["Desc"] = "所有";
            //poTypeDataTable.Rows.InsertAt(allPoTypeRow, 0);

            this.POTypeComboBox.DataSource    = EnumTool.GetDataSource(typeof(POTypes));
            this.POTypeComboBox.SelectedIndex = 1;
            #endregion

            #region ApplyDeptComboBox
            DataTable deptDataTable = _Proxy.GetAllDepts();
            DataRow   allDeptRow    = deptDataTable.NewRow();
            allDeptRow["Code"] = "all";
            allDeptRow["Desc"] = "所有";
            deptDataTable.Rows.InsertAt(allDeptRow, 0);

            this.ApplyDeptComboBox.DataSource    = deptDataTable;
            this.ApplyDeptComboBox.SelectedIndex = 0;
            #endregion

            this.gvPOTypeEdit.DataSource        = EnumTool.GetDataSource(typeof(POTypes));
            this.gvArrivalstatusEdit.DataSource = EnumTool.GetDataSource(typeof(ArrivalStatus));
            this.gvPOStatusEdit.DataSource      = EnumTool.GetDataSource(typeof(POStatus));
            this.gvPaymentStatusEdit.DataSource = EnumTool.GetDataSource(typeof(PaymentStatus));

            this.barAdd.Visibility    = DevExpress.XtraBars.BarItemVisibility.Never;
            this.barEdit.Visibility   = DevExpress.XtraBars.BarItemVisibility.Never;
            this.barDelete.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;

            this.barbtn1.Glyph      = global::MEMS.Client.MRP.Properties.Resources.showtestreport_16x16;
            this.barbtn1.LargeGlyph = global::MEMS.Client.MRP.Properties.Resources.showtestreport_32x32;
            this.barbtn1.Caption    = "审批";
            this.barbtn1.Enabled    = false;
            this.barbtn1.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;

            this.barbtn2.Glyph      = global::MEMS.Client.MRP.Properties.Resources.showtestreport_16x16;
            this.barbtn2.LargeGlyph = global::MEMS.Client.MRP.Properties.Resources.showtestreport_32x32;
            this.barbtn2.Caption    = "撤销审批";
            this.barbtn2.Enabled    = false;
            this.barbtn2.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;

            this.barbtn3.Glyph      = global::MEMS.Client.MRP.Properties.Resources.show_16x16;
            this.barbtn3.LargeGlyph = global::MEMS.Client.MRP.Properties.Resources.show_32x32;
            this.barbtn3.Caption    = "查看";
            this.barbtn3.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
        }
Exemplo n.º 4
0
        protected override void FormLoad()
        {
            this.POTypeComboBox.DataSource    = EnumTool.GetDataSource(typeof(Enums.POTypes));
            this.BuyerComboBox.DataSource     = proxy.GetEmployees();
            this.ApplicantComboBox.DataSource = proxy.GetEmployees();
            this.ApplyDeptComboBox.DataSource = proxy.GetAllDepts();

            this.gvUnitEdit.DataSource = proxy.GetUnitList();

            this.gvPODetails.CellValueChanged += (o, e) =>
            {
                if (e.Column.Name == "Quantity" || e.Column.Name == "Price")
                {
                    CalAmount();
                }
            };

            if (formmode == frmmodetype.add)
            {
                DateTime now      = DateTime.Now;
                DateTime nextWeek = now.AddDays(7);
                this.DmdArrivalDateEdit.Text = (new DateTime(nextWeek.Year, nextWeek.Month, nextWeek.Day)).ToString("yyyy-MM-dd");
                this.ApplyDateEdit.Text      = (new DateTime(now.Year, now.Month, now.Day)).ToString("yyyy-MM-dd");

                PO = new T_PurchaseOrder()
                {
                    pono          = proxy.GetLatestPOIndex(),
                    register      = Global.UserNo,
                    registerdesc  = Global.UserName,
                    arrivalstatus = (int)ArrivalStatus.未到货,
                    paymentstatus = (int)PaymentStatus.未付款,
                    postatus      = (int)POStatus.编制,
                    potype        = (int)POTypes.销售订单,
                    amount        = 0
                };

                _PODetails = new List <T_PurchaseOrderDetail>();
            }
            else
            {
                this.DmdArrivalDateEdit.Text = PO.demandarrivaldate;
                this.ApplyDateEdit.Text      = PO.applydate;

                _PODetails = proxy.GetPODetailList(PO.pono);
            }

            SetData();
        }