Пример #1
0
            public static TotalPriceReportDTOCollection GetTotalPricesGroupedByMonthByActivityID(long CaseID, DateTime?DateFrom, DateTime?DateTo, Int64 ActivityID)
            {
                TotalPriceReportDTOCollection c = new TotalPriceReportDTOCollection();

                SqlCommand             cmd    = new SqlCommand();
                SqlParameterCollection Params = cmd.Parameters;

                Params.Add(new SqlParameter("CaseID", CaseID));
                Params.Add(new SqlParameter("ActivityID", ActivityID));
                if (DateFrom != null)
                {
                    Params.Add(new SqlParameter("DateFrom", DateFrom));
                }
                if (DateTo != null)
                {
                    Params.Add(new SqlParameter("DateTo", DateTo));
                }

                DataTable dt = Execute.FillDataTable(StoredProcedures.GetTotalPricesGroupedByMonthByActivityID, Params);

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        TotalPriceReportDTO o = new TotalPriceReportDTO();
                        LoadTotalPriceDTOByReader(row, o);
                        c.Add(o);
                    }
                }

                return(c);
            }
Пример #2
0
            public static TotalPriceReportDTOCollection GetTotalPricesByDate(long CaseID, DateTime?DateFrom, DateTime?DateTo, long?ContractID, long?ActivityID, long?PartID, long?MaterialID, bool?IsOrdered)
            {
                TotalPriceReportDTOCollection c = new TotalPriceReportDTOCollection();

                SqlCommand             cmd    = new SqlCommand();
                SqlParameterCollection Params = cmd.Parameters;

                Params.Add(new SqlParameter("CaseID", CaseID));
                if (DateFrom != null)
                {
                    Params.Add(new SqlParameter("DateFrom", DateFrom));
                }
                if (DateTo != null)
                {
                    Params.Add(new SqlParameter("DateTo", DateTo));
                }
                if (ContractID != null)
                {
                    Params.Add(new SqlParameter("ContractID", ContractID));
                }
                if (ActivityID != null)
                {
                    Params.Add(new SqlParameter("ActivityID", ActivityID));
                }
                if (PartID != null)
                {
                    Params.Add(new SqlParameter("PartID", PartID));
                }
                if (MaterialID != null)
                {
                    Params.Add(new SqlParameter("MaterialID", MaterialID));
                }
                if (IsOrdered != null)
                {
                    Params.Add(new SqlParameter("IsOrdered", IsOrdered));
                }


                DataTable dt = Execute.FillDataTable(StoredProcedures.GetTotalPricesByDate, Params);

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        TotalPriceReportDTO o = new TotalPriceReportDTO();
                        LoadTotalPriceDTOByReader(row, o);
                        c.Add(o);
                    }
                }

                return(c);
            }
Пример #3
0
 public static void LoadTotalPriceDTOByReader(DataRow row, TotalPriceReportDTO o)
 {
     o.Totalprice = Convert.ToDecimal(row["TotalPrice"]);
     o.Year       = Convert.ToInt32(row["Year"]);
     o.Month      = Convert.ToInt32(row["Month"]);
 }