Ejemplo n.º 1
0
        private void Add_to_Province_Objective_Dictionaries(TotalObjective_PerProvince_PerMonth dataItem)
        {
            if (DBUtils.Is_Objective_Value(dataItem))
            {
                double val = 0;
                double qty = 0;
                if (dataItem.QTY != null)
                {
                    Add_to_Province_Objecitve_QTY_Dictionaries((double)dataItem.QTY, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
                    if (dataItem.VAL == null && (DBUtils.Have_Equivalent(dataItem.BrandCode) || dataItem.SAProductCode != ""))
                        if (dataItem.SAProductCode != "")
                            val = DBUtils.Get_Value_AccTo_PricePerTypeList((double)dataItem.QTY, dataItem.SAProductCode, dataItem.MonthT, dataItem.YearT, Utils.GetPriceType(dataItem.TypeT));
                        else
                            val = (double)dataItem.QTY * DBUtils.Get_Equivalented_PricePerType(dataItem.BrandCode, dataItem.MonthT, dataItem.YearT, Utils.GetPriceType(dataItem.TypeT));
                        Add_to_Province_Objective_VAL_Dictionaries(val, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
                }

                if (dataItem.VAL != null)
                {
                    Add_to_Province_Objective_VAL_Dictionaries((double)dataItem.VAL, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
                    if (dataItem.QTY == null && (DBUtils.Have_Equivalent(dataItem.BrandCode) || dataItem.SAProductCode != ""))
                    {
                        qty = (double)dataItem.VAL / DBUtils.Get_Equivalented_PricePerType(dataItem.BrandCode, dataItem.MonthT, dataItem.YearT, Utils.GetPriceType(dataItem.TypeT));
                        Add_to_Province_Objecitve_QTY_Dictionaries(qty, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private static void Add_to_LoadedData(CommonRawDataCollection loadedData, TotalObjective_PerProvince_PerMonth dataItem, double qty, double val)
 {
     if (loadedData == null)
         return;
     if (DBUtils.IsBudget(dataItem.TypeT))
         loadedData.Add(new CommonRegionData() { IsBudget = true, BrandCode = dataItem.BrandCode, Date = new DateTime(dataItem.YearT, dataItem.MonthT, 1), RegionMapId = DBUtils.GetRegionMapId_DatRegionCode( dataItem.RegionCode), QTY = qty, VAL = val });
     if (DBUtils.IsF1(dataItem.TypeT))
         loadedData.Add(new CommonRegionData() { IsF1 = true, BrandCode = dataItem.BrandCode, Date = new DateTime(dataItem.YearT, dataItem.MonthT, 1), RegionMapId = DBUtils.GetRegionMapId_DatRegionCode( dataItem.RegionCode), QTY = qty, VAL = val });
     if (DBUtils.IsF2(dataItem.TypeT))
         loadedData.Add(new CommonRegionData() { IsF2 = true, BrandCode = dataItem.BrandCode, Date = new DateTime(dataItem.YearT, dataItem.MonthT, 1), RegionMapId = DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), QTY = qty, VAL = val });
 }
Ejemplo n.º 3
0
 public static bool Is_Objective_Value(TotalObjective_PerProvince_PerMonth dataItem)
 {
     DateTime date = new DateTime(dataItem.YearT,dataItem.MonthT,1).AddMonths(1).AddMinutes(-1);
     return DBUtils.Is_Objective_Value(date, dataItem.BrandCode, SanofiRegionTypes.Province, DBUtils.IsBudget(dataItem.TypeT), DBUtils.IsF1(dataItem.TypeT), DBUtils.IsF2(dataItem.TypeT));
 }
Ejemplo n.º 4
0
 public static bool Null_Handled(TotalObjective_PerProvince_PerMonth dataItem)
 {
     if (dataItem == null)
         return false;
     if (dataItem.QTY == null && dataItem.VAL == null)
         return false;
     return true;
 }
Ejemplo n.º 5
0
 // temp
 private void AddToYtgLastYearDictionaries(TotalObjective_PerProvince_PerMonth dataItem)
 {
     if (DBUtils.Is_Objective_Value(dataItem) && (dataItem.YearT == _endDate.Year - 1) && dataItem.MonthT > _endDate.Month)
     {
         if (dataItem.QTY != null)
         {
             AddToYtgLastYearQty((double)dataItem.QTY, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
             if (dataItem.VAL == null && DBUtils.Have_Equivalent(dataItem.BrandCode))
                 AddToYtgLastYearVal((double)dataItem.QTY * DBUtils.Get_Equivalented_PricePerType(dataItem.BrandCode, dataItem.MonthT, dataItem.YearT, Utils.GetPriceType(dataItem.TypeT)), DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
         }
         if (dataItem.VAL != null)
         {
             AddToYtgLastYearVal((double)dataItem.VAL, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
             if (dataItem.QTY == null && DBUtils.Have_Equivalent(dataItem.BrandCode))
                 AddToYtgLastYearQty((double)dataItem.VAL / DBUtils.Get_Equivalented_PricePerType(dataItem.BrandCode, dataItem.MonthT, dataItem.YearT, Utils.GetPriceType(dataItem.TypeT)), DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
         }
     }
 }
Ejemplo n.º 6
0
 private void AddToF02SumDictionary(TotalObjective_PerProvince_PerMonth dataItem)
 {
     if (DBUtils.IsF2(dataItem.TypeT) && dataItem.YearT == _endDate.Year)
     {
         double val = 0;
         double qty = 0;
         if (dataItem.QTY != null)
         {
             AddToF02SumQty((double)dataItem.QTY, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
             if (dataItem.VAL == null && (DBUtils.Have_Equivalent(dataItem.BrandCode) || dataItem.SAProductCode != ""))
                 if (dataItem.SAProductCode != "")
                     val = DBUtils.Get_Value_AccTo_PricePerTypeList((double)dataItem.QTY, dataItem.SAProductCode, dataItem.MonthT, dataItem.YearT, Utils.GetPriceType(dataItem.TypeT));
                 else
                     val = (double)dataItem.QTY * DBUtils.Get_Equivalented_PricePerType(dataItem.BrandCode, dataItem.MonthT, dataItem.YearT, Utils.GetPriceType(dataItem.TypeT));
                 AddToF02SumVal(val, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
         }
         if (dataItem.VAL != null)
         {
             AddToF02SumVal((double)dataItem.VAL, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode( dataItem.RegionCode), _productBrand));
             if (dataItem.QTY == null && (DBUtils.Have_Equivalent(dataItem.BrandCode) || dataItem.SAProductCode != ""))
                 AddToF02SumQty(qty, DBUtils.GetGroupRegionMapId(DBUtils.GetRegionMapId_DatRegionCode(dataItem.RegionCode), _productBrand));
         }
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Create a new TotalObjective_PerProvince_PerMonth object.
 /// </summary>
 /// <param name="monthT">Initial value of the MonthT property.</param>
 /// <param name="typeT">Initial value of the TypeT property.</param>
 /// <param name="yearT">Initial value of the YearT property.</param>
 /// <param name="regionCode">Initial value of the RegionCode property.</param>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="brandCode">Initial value of the BrandCode property.</param>
 /// <param name="sAProductCode">Initial value of the SAProductCode property.</param>
 public static TotalObjective_PerProvince_PerMonth CreateTotalObjective_PerProvince_PerMonth(global::System.Int32 monthT, global::System.String typeT, global::System.Int32 yearT, global::System.String regionCode, global::System.Int32 id, global::System.String brandCode, global::System.String sAProductCode)
 {
     TotalObjective_PerProvince_PerMonth totalObjective_PerProvince_PerMonth = new TotalObjective_PerProvince_PerMonth();
     totalObjective_PerProvince_PerMonth.MonthT = monthT;
     totalObjective_PerProvince_PerMonth.TypeT = typeT;
     totalObjective_PerProvince_PerMonth.YearT = yearT;
     totalObjective_PerProvince_PerMonth.RegionCode = regionCode;
     totalObjective_PerProvince_PerMonth.ID = id;
     totalObjective_PerProvince_PerMonth.BrandCode = brandCode;
     totalObjective_PerProvince_PerMonth.SAProductCode = sAProductCode;
     return totalObjective_PerProvince_PerMonth;
 }