Ejemplo n.º 1
0
        /// <summary>
        /// Gets the report S23 h.
        /// </summary>
        /// <param name="reportParameter">The report parameter.</param>
        /// <param name="oRsTool">The o rs tool.</param>
        /// <returns>IList&lt;S23HModel&gt;.</returns>
        public IList <S23HModel> GetReportS23H(ReportParameter reportParameter, ReportSharpHelper oRsTool)
        {
            IList <S23HModel> reports = null;

            GlobalVariable.IsDisplayNewLicenseInfo = false;

            if (!oRsTool.IsRefresh)
            {
                using (var frmParam = new FrmS22H(true, false))
                {
                    frmParam.Text = @"Bảng tổng hợp chi tiết nguyên liệu vật liệu, CCDC, SPHH";
                    if (frmParam.ShowDialog() == DialogResult.OK)
                    {
                        var fromDate = DateTime.Parse(frmParam.FromDate);
                        var toDate   = DateTime.Parse(frmParam.ToDate);

                        if (!oRsTool.Parameters.ContainsKey("FromDate"))
                        {
                            oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString());
                        }
                        if (!oRsTool.Parameters.ContainsKey("ToDate"))
                        {
                            oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString());
                        }

                        string _InventoryItem = frmParam.InventoryItemIds == ""
                            ? frmParam.AllInventoryItemIds
                            : frmParam.InventoryItemIds;

                        reports = Model.GetReportS23H(fromDate, toDate, _InventoryItem, frmParam.AccountNumber);
                    }
                }
            }
            return(reports);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Reports the S11 h.
        /// </summary>
        /// <param name="reportParameter">The report parameter.</param>
        /// <param name="oRsTool">The o rs tool.</param>
        /// <returns>IList&lt;S22HModel&gt;.</returns>
        public IList <S22HModel> GetReportS22H(ReportParameter reportParameter, ReportSharpHelper oRsTool)
        {
            IList <S22HModel> reports = null;

            GlobalVariable.IsDisplayNewLicenseInfo = false;

            if (!oRsTool.IsRefresh)
            {
                using (var frmParam = new FrmS22H(true, true))
                {
                    frmParam.Text = @"Sổ chi tiết nguyên liệu, vật liệu, CCDC";
                    if (frmParam.ShowDialog() == DialogResult.OK)
                    {
                        var fromDate = DateTime.Parse(frmParam.FromDate);
                        var toDate   = DateTime.Parse(frmParam.ToDate);

                        if (!oRsTool.Parameters.ContainsKey("isGroupByInventoryItem"))
                        {
                            oRsTool.Parameters.Add("isGroupByInventoryItem", frmParam.isGroupByInventoryItem);
                        }
                        if (!oRsTool.Parameters.ContainsKey("FromDate"))
                        {
                            oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString());
                        }
                        if (!oRsTool.Parameters.ContainsKey("ToDate"))
                        {
                            oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString());
                        }

                        string _InventoryItem = frmParam.InventoryItemIds == ""
                            ? frmParam.AllInventoryItemIds
                            : frmParam.InventoryItemIds;
                        reports = Model.GetReportS22H(fromDate, toDate, frmParam.StockId, _InventoryItem, frmParam.AccountNumber, GlobalVariable.AmountTypeViewReport, GlobalVariable.CurrencyViewReport);

                        // check để group theo đối tượng
                        if (frmParam.isGroupByInventoryItem)
                        {
                            foreach (var report in reports)
                            {
                                report.GroupName   = report.AccountNumber + report.StockCode + report.InventoryItemCode;
                                report.GroupDetail = "1";
                            }
                        }
                        else
                        {
                            foreach (var report in reports)
                            {
                                report.GroupName   = report.AccountNumber + report.StockCode;
                                report.GroupDetail = report.InventoryItemCode;
                            }
                        }
                    }
                }
            }
            return(reports);
        }
Ejemplo n.º 3
0
        public IList <InventoryBookModel> GetInventoryBook(ReportParameter reportParameter, ReportSharpHelper oRsTool)
        {
            IList <InventoryBookModel> reports = null;

            GlobalVariable.IsDisplayNewLicenseInfo = false;

            if (!oRsTool.IsRefresh)
            {
                using (var frmParam = new FrmS22H(false, true))
                {
                    frmParam.Text = @"Báo cáo tồn kho";
                    if (frmParam.ShowDialog() == DialogResult.OK)
                    {
                        var fromDate = DateTime.Parse(frmParam.FromDate);
                        var toDate   = DateTime.Parse(frmParam.ToDate);
                        if (!oRsTool.Parameters.ContainsKey("FromDate"))
                        {
                            oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString());
                        }
                        if (!oRsTool.Parameters.ContainsKey("ToDate"))
                        {
                            oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString());
                        }
                        if (!oRsTool.Parameters.ContainsKey("ReportDate"))
                        {
                            oRsTool.Parameters.Add("ReportDate", GlobalVariable.PostedDate);
                        }
                        if (!oRsTool.Parameters.ContainsKey("CompanyProvince"))
                        {
                            oRsTool.Parameters.Add("CompanyProvince", string.IsNullOrEmpty(GlobalVariable.CompanyProvince) ? string.Empty : GlobalVariable.CompanyProvince);
                        }

                        reports = Model.GetInventoryBook(fromDate, toDate, frmParam.StockId, frmParam.InventoryIDs);
                    }
                }
            }
            return(reports);
        }