Exemple #1
0
        public Q51(ConditionMaterial condition)
        {
            InitializeComponent();
            IList <Model.ProduceMaterialExitDetail> list = detailManager.SelectBycondition(condition.StartDate, condition.EndDate, condition.ProduceMaterialId0, condition.ProduceMaterialId1, condition.Product0, condition.Product1, condition.DepartmentId0, condition.DepartmentId1, condition.PronoteHeaderId0, condition.PronoteHeaderId1);

            if (list == null || list.Count <= 0)
            {
                throw new global::Helper.InvalidValueException();
            }

            if (!global::Helper.DateTimeParse.DateTimeEquls(condition.StartDate, global::Helper.DateTimeParse.NullDate))
            {
                this.xrLabelDateRange.Text = "自 " + DateTime.Now.ToShortDateString();
            }
            this.xrLabelDateRange.Text += "至 " + condition.EndDate.ToShortDateString();
            this.xrLabelRepotName.Text  = BL.Settings.CompanyChineseName;
            this.ReportTitle.Text       = Properties.Resources.ProduceMaterialExitDetail;
            this.DataSource             = list;


            this.xrTableProID.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_Id);
            this.xrTableDate.DataBindings.Add("Text", this.DataSource, "ProduceMaterialExit." + Model.ProduceMaterialExit.PRO_ProduceExitMaterialDate, "{0:yyyy-MM-dd}");
            this.xrTableProName.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductName);
            this.xrTableQuanTity.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialExitDetail.PRO_ProduceQuantity);
            this.xrTableGuiGe.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductSpecification);

            this.xrTableMaterialExitId.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialExitDetail.PRO_ProduceMaterialExitId);
            this.xrTableUnit.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialExitDetail.PRO_ProductUnit);
            //this.xrTableXOid.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialExitDetail.PRO_InvoiceXOId);
            this.xrTableDepot.DataBindings.Add("Text", this.DataSource, "Depot." + Model.Depot.PRO_DepotName);
            this.xrTableDepotPosition.DataBindings.Add("Text", this.DataSource, "DepotPosition." + Model.DepotPosition.PROPERTY_ID);
        }
Exemple #2
0
        public Q50_2(ConditionMaterial condition)
        {
            InitializeComponent();
            this.MaterialCondidtion = condition;
            IList <Model.ProduceMaterial> list = produceMaterialManager.SelectBycondition(condition.StartDate, condition.EndDate, condition.ProduceMaterialId0, condition.ProduceMaterialId1, condition.Product0, condition.Product1, condition.DepartmentId0, condition.DepartmentId1, condition.PronoteHeaderId0, condition.PronoteHeaderId1, condition.CusInvoiceXOId);

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

            this.xrLabelDates.Text    += System.DateTime.Now.ToString("yyyy-MM-dd");
            this.xrLabelRepotName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelData.Text      = Properties.Resources.ProduceMaterialInfo;

            this.DataSource = list;

            //this.xrLabelProduceMaterialId.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_ProduceMaterialID);
            //this.xrLabelDepartment.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_WorkhouseName);
            //this.xrLabelPronoteHeaderID.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_InvoiceId);
            //this.xrLabelProduceMaterialDate.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_ProduceMaterialDate, "{0:yyyy-MM-dd}");
            //this.xrLabelProduct.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_ParenProductName, "{0:yyyy-MM-dd}");
            //this.xrSubreport1.ReportSource = new Q50_1();
            //this.xrLabelCusXOId.DataBindings.Add("Text", this.DataSource, "CusXOId");

            //数据加总
            StringBuilder str = new StringBuilder();

            foreach (Model.ProduceMaterial detail in list)
            {
                if (detail.ProduceMaterialID != null)
                {
                    str.Append("'" + detail.ProduceMaterialID + "',");
                }
            }
            IList <Model.ProduceMaterialdetails> detailTotal = (new BL.ProduceMaterialdetailsManager()).SelectTotalByProduceMaterialID(this.MaterialCondidtion.Product0, this.MaterialCondidtion.Product1, str.ToString().Length > 1 ? str.ToString().Substring(0, str.Length - 1) : "''");

            foreach (Model.ProduceMaterialdetails detail in detailTotal)
            {
                this.xrRichText1.Text += "\r\n" + detail.ProductName + " :" + "     总数:" + detail.Materialprocessum + "     已领数量:" + detail.Materialprocesedsum;
            }
        }
Exemple #3
0
        protected override void OnOK()
        {
            if (this.condition == null)
            {
                this.condition = new ConditionMaterial();
            }

            if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditStartDate.DateTime, new DateTime()))
            {
                this.condition.StartDate = global::Helper.DateTimeParse.NullDate;
            }

            else
            {
                this.condition.StartDate = this.dateEditStartDate.DateTime;
            }


            if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditEndDate.DateTime, new DateTime()))
            {
                this.condition.EndDate = global::Helper.DateTimeParse.EndDate;
            }

            else
            {
                this.condition.EndDate = this.dateEditEndDate.DateTime;
            }

            this.condition.ProduceMaterialId0 = this.buttonEditMaterial1.EditValue == null ? null : this.buttonEditMaterial1.EditValue.ToString();
            this.condition.ProduceMaterialId1 = this.buttonEditMaterial2.EditValue == null ? null : this.buttonEditMaterial2.EditValue.ToString();
            this.condition.Product0           = this.buttonEditProduct1.EditValue == null ? null : this.buttonEditProduct1.EditValue as Model.Product;
            this.condition.Product1           = this.buttonEditProduct2.EditValue == null ? null : this.buttonEditProduct2.EditValue as Model.Product;
            this.condition.PronoteHeaderId0   = this.buttonEditPronoteHeader1.EditValue == null ? null : this.buttonEditPronoteHeader1.Text;
            this.condition.PronoteHeaderId1   = this.buttonEditPronoteHeader2.EditValue == null ? null : this.buttonEditPronoteHeader2.Text;
            this.condition.DepartmentId0      = (this.newChooseWorkHouse.EditValue as Model.WorkHouse) == null ? null : (this.newChooseWorkHouse.EditValue as Model.WorkHouse).WorkHouseId;

            this.condition.CusInvoiceXOId = this.txtCusInvoiceXOId.Text;
            this.condition.CustomerId     = (this.ncc_Customer.EditValue == null ? null : (this.ncc_Customer.EditValue as Model.Customer).CustomerId);
        }
Exemple #4
0
        public Q50(ConditionMaterial condition)
        {
            InitializeComponent();
            this.MaterialCondidtion = condition;
            IList <Model.ProduceMaterial> list = produceMaterialManager.SelectBycondition(condition.StartDate, condition.EndDate, condition.ProduceMaterialId0, condition.ProduceMaterialId1, condition.Product0, condition.Product1, condition.DepartmentId0, condition.DepartmentId1, condition.PronoteHeaderId0, condition.PronoteHeaderId1, condition.CusInvoiceXOId, condition.HandBookId);

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

            this.xrLabelDates.Text    += System.DateTime.Now.ToString("yyyy-MM-dd");
            this.xrLabelRepotName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelData.Text      = Properties.Resources.ProduceMaterialInfo;

            #region 注释 获取 加工单商品名称
            //Model.InvoiceXO invoiceXO;
            //foreach (Model.ProduceMaterial pm in list)
            //{
            //    if (pm.SourceType != 1)
            //    {
            //        Model.PronoteHeader pheader = this.pronoteHeaderManager.Get(pm.InvoiceId);
            //        if (pheader != null)
            //        {
            //            pm.ParenProductName = string.IsNullOrEmpty(pheader.Product.CustomerProductName) ? pheader.Product.ProductName : pheader.Product.ProductName + "{" + pheader.Product.CustomerProductName + "}";
            //        }
            //    }
            //    if (!string.IsNullOrEmpty(pm.InvoiceXOId))
            //    {
            //        invoiceXO = invoiceXOManager.Get(pm.InvoiceXOId);
            //        if (invoiceXO != null)
            //            pm.CusXOId = invoiceXO == null ? string.Empty : invoiceXO.CustomerInvoiceXOId;
            //    }
            //}
            #endregion

            this.DataSource = list;

            this.xrLabelProduceMaterialId.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_ProduceMaterialID);
            this.xrLabelDepartment.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_WorkhouseName);
            this.xrLabelPronoteHeaderID.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_InvoiceId);
            this.xrLabelProduceMaterialDate.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_ProduceMaterialDate, "{0:yyyy-MM-dd}");
            this.xrLabelProduct.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterial.PRO_ParenProductName, "{0:yyyy-MM-dd}");
            this.xrSubreport1.ReportSource = new Q50_1();
            this.xrLabelCusXOId.DataBindings.Add("Text", this.DataSource, "CusXOId");

            //数据加总
            StringBuilder str = new StringBuilder();
            foreach (Model.ProduceMaterial detail in list)
            {
                if (detail.ProduceMaterialID != null)
                {
                    str.Append("'" + detail.ProduceMaterialID + "',");
                }
            }
            IList <Model.ProduceMaterialdetails> detailTotal = (new BL.ProduceMaterialdetailsManager()).SelectTotalByProduceMaterialID(this.MaterialCondidtion.Product0, this.MaterialCondidtion.Product1, str.ToString().Length > 1 ? str.ToString().Substring(0, str.Length - 1) : "''");
            foreach (Model.ProduceMaterialdetails detail in detailTotal)
            {
                this.xrRichText1.Text += "\r\n" + detail.ProductName + " :" + "     总数:" + detail.Materialprocessum + "     已领数量:" + detail.Materialprocesedsum;
            }
        }