コード例 #1
0
        private void InitializeAdjustmentMemoReportPreview(string AdjustmentCode, long adjustment_recordNo)
        {
            Adjustment adjustment = AdjustmentManager.GetAdjustmentByKey(adjustment_recordNo);
            DataTable  tbl        = new DataTable();

            tbl = AdjustmentMemoManager.FetchAllAdjustmentMemosByAdjustmentCode(AdjustmentCode);
            ParameterFields        paramFields        = new ParameterFields();
            ParameterField         paramTotalQuantity = new ParameterField();
            ParameterDiscreteValue paramQuantityValue = new ParameterDiscreteValue();

            paramTotalQuantity.ParameterFieldName = "TotalQuantity";
            ParameterField         paramTotalCurrentPrice      = new ParameterField();
            ParameterDiscreteValue paramTotalCurrentPriceValue = new ParameterDiscreteValue();

            paramTotalCurrentPrice.ParameterFieldName = "TotalCurrentPrice";
            ParameterField         paramTotalCostPrice      = new ParameterField();
            ParameterDiscreteValue paramTotalCostPriceValue = new ParameterDiscreteValue();

            paramTotalCostPrice.ParameterFieldName = "TotalCostPrice";
            ParameterField         paramInventoryDate      = new ParameterField();
            ParameterDiscreteValue paramInventoryDateValue = new ParameterDiscreteValue();

            paramInventoryDate.ParameterFieldName = "InventoryDate";
            ParameterField         paramCutOffDate      = new ParameterField();
            ParameterDiscreteValue paramCutOffDateValue = new ParameterDiscreteValue();

            paramCutOffDate.ParameterFieldName = "CutOffDate";
            ParameterField         paramAdjustmentPhysicalCountQuantity      = new ParameterField();
            ParameterDiscreteValue paramAdjustmentPhysicalCountQuantityValue = new ParameterDiscreteValue();

            paramAdjustmentPhysicalCountQuantity.ParameterFieldName = "AdjustedPhysicalCountQuantity";
            ParameterField         paramAdjustmentPhysicalCountCurrentPrice      = new ParameterField();
            ParameterDiscreteValue paramAdjustmentPhysicalCountCurrentPriceValue = new ParameterDiscreteValue();

            paramAdjustmentPhysicalCountCurrentPrice.ParameterFieldName = "AdjustedPhysicalCountCurrentPrice";
            ParameterField         paramAdjustmentPhysicalCountCostPrice      = new ParameterField();
            ParameterDiscreteValue paramAdjustmentPhysicalCountCostPriceValue = new ParameterDiscreteValue();

            paramAdjustmentPhysicalCountCostPrice.ParameterFieldName = "AdjustmentPhysicalCountCostPrice";
            ParameterField         paramOutletName      = new ParameterField();
            ParameterDiscreteValue paramOutletNamevalue = new ParameterDiscreteValue();

            paramOutletName.ParameterFieldName = "OutletName";

            paramQuantityValue.Value          = long.Parse(LoadTransactionSummary(AdjustmentCode)[0]) + adjustment.ActualPhysicalCountQuantity;
            paramTotalCurrentPriceValue.Value = decimal.Parse(LoadTransactionSummary(AdjustmentCode)[1].Replace("Php", "")) + adjustment.ActualPhysicalCountCurrentPrice;
            paramTotalCostPriceValue.Value    = decimal.Parse(LoadTransactionSummary(AdjustmentCode)[2].Replace("Php", "")) + adjustment.ActualPhysicalCountCostPrice;
            paramInventoryDateValue.Value     = adjustment.InventoryDate;
            paramCutOffDateValue.Value        = adjustment.CutOffDate;
            paramAdjustmentPhysicalCountQuantityValue.Value     = adjustment.ActualPhysicalCountQuantity;
            paramAdjustmentPhysicalCountCurrentPriceValue.Value = adjustment.ActualPhysicalCountCurrentPrice;
            paramAdjustmentPhysicalCountCostPriceValue.Value    = adjustment.ActualPhysicalCountCostPrice;
            paramOutletNamevalue.Value = adjustment.OutletName;

            paramTotalQuantity.CurrentValues.Add(paramQuantityValue);
            paramTotalCurrentPrice.CurrentValues.Add(paramTotalCurrentPriceValue);
            paramTotalCostPrice.CurrentValues.Add(paramTotalCostPriceValue);
            paramInventoryDate.CurrentValues.Add(paramInventoryDateValue);
            paramCutOffDate.CurrentValues.Add(paramCutOffDateValue);
            paramAdjustmentPhysicalCountQuantity.CurrentValues.Add(paramAdjustmentPhysicalCountQuantityValue);
            paramAdjustmentPhysicalCountCurrentPrice.CurrentValues.Add(paramAdjustmentPhysicalCountCurrentPriceValue);
            paramAdjustmentPhysicalCountCostPrice.CurrentValues.Add(paramAdjustmentPhysicalCountCostPriceValue);
            paramOutletName.CurrentValues.Add(paramOutletNamevalue);

            paramFields.Add(paramTotalQuantity);
            paramFields.Add(paramTotalCurrentPrice);
            paramFields.Add(paramTotalCostPrice);
            paramFields.Add(paramInventoryDate);
            paramFields.Add(paramCutOffDate);
            paramFields.Add(paramAdjustmentPhysicalCountQuantity);
            paramFields.Add(paramAdjustmentPhysicalCountCurrentPrice);
            paramFields.Add(paramAdjustmentPhysicalCountCostPrice);
            paramFields.Add(paramOutletName);

            ReportDocument rptDoc = new ReportDocuments.RptAdjustmentMemo();

            rptDoc.SetDataSource(tbl);
            crViewerAdjustmentMemo.ParameterFieldInfo = paramFields;
            this.crViewerAdjustmentMemo.ReportSource  = rptDoc;
        }
コード例 #2
0
        private void InitializeAdjustmentMemoReportPreview(string AdjustmentCode,long adjustment_recordNo)
        {
            Adjustment adjustment = AdjustmentManager.GetAdjustmentByKey(adjustment_recordNo);
            DataTable tbl = new DataTable();
            tbl = AdjustmentMemoManager.FetchAllAdjustmentMemosByAdjustmentCode(AdjustmentCode);
            ParameterFields paramFields = new ParameterFields();
            ParameterField paramTotalQuantity = new ParameterField();
            ParameterDiscreteValue paramQuantityValue = new ParameterDiscreteValue();
            paramTotalQuantity.ParameterFieldName = "TotalQuantity";
            ParameterField paramTotalCurrentPrice = new ParameterField();
            ParameterDiscreteValue paramTotalCurrentPriceValue = new ParameterDiscreteValue();
            paramTotalCurrentPrice.ParameterFieldName = "TotalCurrentPrice";
            ParameterField paramTotalCostPrice = new ParameterField();
            ParameterDiscreteValue paramTotalCostPriceValue = new ParameterDiscreteValue();
            paramTotalCostPrice.ParameterFieldName = "TotalCostPrice";
            ParameterField paramInventoryDate = new ParameterField();
            ParameterDiscreteValue paramInventoryDateValue = new ParameterDiscreteValue();
            paramInventoryDate.ParameterFieldName = "InventoryDate";
            ParameterField paramCutOffDate = new ParameterField();
            ParameterDiscreteValue paramCutOffDateValue = new ParameterDiscreteValue();
            paramCutOffDate.ParameterFieldName = "CutOffDate";
            ParameterField paramAdjustmentPhysicalCountQuantity = new ParameterField();
            ParameterDiscreteValue paramAdjustmentPhysicalCountQuantityValue = new ParameterDiscreteValue();
            paramAdjustmentPhysicalCountQuantity.ParameterFieldName = "AdjustedPhysicalCountQuantity";
            ParameterField paramAdjustmentPhysicalCountCurrentPrice = new ParameterField();
            ParameterDiscreteValue paramAdjustmentPhysicalCountCurrentPriceValue = new ParameterDiscreteValue();
            paramAdjustmentPhysicalCountCurrentPrice.ParameterFieldName = "AdjustedPhysicalCountCurrentPrice";
            ParameterField paramAdjustmentPhysicalCountCostPrice = new ParameterField();
            ParameterDiscreteValue paramAdjustmentPhysicalCountCostPriceValue = new ParameterDiscreteValue();
            paramAdjustmentPhysicalCountCostPrice.ParameterFieldName = "AdjustmentPhysicalCountCostPrice";
            ParameterField paramOutletName = new ParameterField();
            ParameterDiscreteValue paramOutletNamevalue = new ParameterDiscreteValue();
            paramOutletName.ParameterFieldName = "OutletName";

            paramQuantityValue.Value =long.Parse(LoadTransactionSummary(AdjustmentCode)[0])+adjustment.ActualPhysicalCountQuantity;
            paramTotalCurrentPriceValue.Value = decimal.Parse(LoadTransactionSummary(AdjustmentCode)[1].Replace("Php",""))+adjustment.ActualPhysicalCountCurrentPrice;
            paramTotalCostPriceValue.Value =decimal.Parse(LoadTransactionSummary(AdjustmentCode)[2].Replace("Php",""))+adjustment.ActualPhysicalCountCostPrice;
            paramInventoryDateValue.Value = adjustment.InventoryDate;
            paramCutOffDateValue.Value = adjustment.CutOffDate;
            paramAdjustmentPhysicalCountQuantityValue.Value = adjustment.ActualPhysicalCountQuantity;
            paramAdjustmentPhysicalCountCurrentPriceValue.Value = adjustment.ActualPhysicalCountCurrentPrice;
            paramAdjustmentPhysicalCountCostPriceValue.Value = adjustment.ActualPhysicalCountCostPrice;
            paramOutletNamevalue.Value = adjustment.OutletName;

            paramTotalQuantity.CurrentValues.Add(paramQuantityValue);
            paramTotalCurrentPrice.CurrentValues.Add(paramTotalCurrentPriceValue);
            paramTotalCostPrice.CurrentValues.Add(paramTotalCostPriceValue);
            paramInventoryDate.CurrentValues.Add(paramInventoryDateValue);
            paramCutOffDate.CurrentValues.Add(paramCutOffDateValue);
            paramAdjustmentPhysicalCountQuantity.CurrentValues.Add(paramAdjustmentPhysicalCountQuantityValue);
            paramAdjustmentPhysicalCountCurrentPrice.CurrentValues.Add(paramAdjustmentPhysicalCountCurrentPriceValue);
            paramAdjustmentPhysicalCountCostPrice.CurrentValues.Add(paramAdjustmentPhysicalCountCostPriceValue);
            paramOutletName.CurrentValues.Add(paramOutletNamevalue);

            paramFields.Add(paramTotalQuantity);
            paramFields.Add(paramTotalCurrentPrice);
            paramFields.Add(paramTotalCostPrice);
            paramFields.Add(paramInventoryDate);
            paramFields.Add(paramCutOffDate);
            paramFields.Add(paramAdjustmentPhysicalCountQuantity);
            paramFields.Add(paramAdjustmentPhysicalCountCurrentPrice);
            paramFields.Add(paramAdjustmentPhysicalCountCostPrice);
            paramFields.Add(paramOutletName);

            ReportDocument rptDoc = new ReportDocuments.RptAdjustmentMemo();
            rptDoc.SetDataSource(tbl);
            crViewerAdjustmentMemo.ParameterFieldInfo = paramFields;
            this.crViewerAdjustmentMemo.ReportSource = rptDoc;
        }