Beispiel #1
0
        public Q54(ConditionOtherMaterial condition)
        {
            InitializeComponent();
            this.conditionMaterial = condition;
            IList <Model.ProduceOtherMaterial> list = otherManager.SelectByCondition(condition.StartDate, condition.EndDate, condition.SupplierId1, condition.SupplierId2, condition.ProduceOtherCompactId1, condition.ProduceOtherCompactId2, condition.ProductId1, condition.ProductId2, null);

            if (list == null || list.Count <= 0)
            {
                throw new global::Helper.MessageValueException("無記錄!");
            }
            if (!global::Helper.DateTimeParse.DateTimeEquls(condition.StartDate, global::Helper.DateTimeParse.NullDate))
            {
                this.xrLabelDateRange.Text += "自 " + condition.StartDate.ToString("yyyy-MM-dd");
            }
            this.xrLabelDateRange.Text += "至 " + condition.EndDate.ToString("yyyy-MM-dd");
            this.xrLabelDates.Text      = DateTime.Now.ToShortDateString();
            this.RepotName.Text         = BL.Settings.CompanyChineseName;
            this.ReportTitle.Text       = Properties.Resources.ProduceOtherMaterialDetail;
            this.DataSource             = list;
            this.SupplierId.DataBindings.Add("Text", this.DataSource, "Supplier." + Model.Supplier.PROPERTY_SUPPLIERSHORTNAME);
            this.ProduceOtherMaterialId.DataBindings.Add("Text", this.DataSource, Model.ProduceOtherMaterial.PRO_ProduceOtherMaterialId);
            this.ProduceMaterialdesc.DataBindings.Add("Text", this.DataSource, Model.ProduceOtherMaterial.PRO_ProduceOtherMaterialDesc);
            this.ProduceOtherCompactId.DataBindings.Add("Text", this.DataSource, Model.ProduceOtherMaterial.PRO_ProduceOtherCompactId);
            this.ProduceOtherMaterialDate.DataBindings.Add("Text", this.DataSource, Model.ProduceOtherMaterial.PRO_ProduceOtherMaterialDate, "{0:yyyy-MM-dd}");
            this.WorkHouseId.DataBindings.Add("Text", this.DataSource, "WorkHouse." + Model.WorkHouse.PROPERTY_WORKHOUSENAME);
            this.DepotId.DataBindings.Add("Text", this.DataSource, "Depot." + Model.Depot.PRO_DepotName);
            //this.Employee0Id.DataBindings.Add("Text", this.DataSource, "Employee0." + Model.Employee.PROPERTY_EMPLOYEENAME);
            //this.Employee1Id.DataBindings.Add("Text", this.DataSource, "Employee1." + Model.Employee.PROPERTY_EMPLOYEENAME);
            //this.Employee2Id.DataBindings.Add("Text", this.DataSource, "Employee2." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.xrSubreport1.ReportSource = new Q54_1();
        }
Beispiel #2
0
        public Q54Update(ConditionOtherMaterial condition)
        {
            InitializeComponent();

            IList <Model.ProduceOtherMaterialDetail> list = otherDetailManager.SelectDetailByCondition(condition.StartDate, condition.EndDate, condition.SupplierId1, condition.SupplierId2, condition.ProduceOtherCompactId1, condition.ProduceOtherCompactId2, condition.ProductId1, condition.ProductId2, condition.InvoiceCusId);

            if (list == null || list.Count <= 0)
            {
                throw new global::Helper.MessageValueException("無記錄!");
            }

            this.RepotName.Text     = BL.Settings.CompanyChineseName;
            this.ReportTitle.Text   = Properties.Resources.ProduceOtherMaterialDetail;
            this.xrLabelDates.Text += DateTime.Now.ToString("yyyy-MM-dd");

            this.DataSource = list;
            this.TCSupplier.DataBindings.Add("Text", this.DataSource, "SupplierShortName");
            this.TCOtherCompactID.DataBindings.Add("Text", this.DataSource, "ProduceOtherCompactId");
            this.TCJHR.DataBindings.Add("Text", this.DataSource, "JiaoQi", "{0:yyyy-MM-dd}");
            this.TCYJRQ.DataBindings.Add("Text", this.DataSource, "InvoiceYjrq", "{0:yyyy-MM-dd}");
            this.TCInvoiceCusID.DataBindings.Add("Text", this.DataSource, "CustomerInvoiceXOId");
            this.xrTableProName.DataBindings.Add("Text", this.DataSource, "ProductName");
            this.xrTableQuanTity.DataBindings.Add("Text", this.DataSource, "InvoiceUseQuantity", "{0:0.##}");
            this.xrTableUnit.DataBindings.Add("Text", this.DataSource, "ProductUnit");
        }
 protected override void OnOK()
 {
     if (this.condition == null)
     {
         this.condition = new ConditionOtherMaterial();
     }
     this.condition.StartDate              = this.dateEditStartDate.EditValue == null ? global::Helper.DateTimeParse.NullDate : this.dateEditStartDate.DateTime;
     this.condition.EndDate                = this.dateEditEndDate.EditValue == null ? System.DateTime.Now : this.dateEditEndDate.DateTime;
     this.condition.SupplierId1            = this.newChooseContorlSupplier1.EditValue == null ? null : (this.newChooseContorlSupplier1.EditValue as Model.Supplier).SupplierId;
     this.condition.SupplierId2            = this.newChooseContorlSupplier2.EditValue == null ? null : (this.newChooseContorlSupplier2.EditValue as Model.Supplier).SupplierId;
     this.condition.ProduceOtherCompactId1 = this.buttonEditProduceOtherCompactId1.EditValue == null ? null : this.buttonEditProduceOtherCompactId1.Text;
     this.condition.ProduceOtherCompactId2 = this.buttonEditProduceOtherCompactId2.EditValue == null ? null : this.buttonEditProduceOtherCompactId2.Text;
     this.condition.ProductId1             = this.StartProductId.EditValue as Model.Product == null ? null : (this.StartProductId.EditValue as Model.Product).Id;
     this.condition.ProductId2             = this.EndProductId.EditValue as Model.Product == null ? null : (this.EndProductId.EditValue as Model.Product).Id;
 }