Beispiel #1
0
        public InServiceTypeWithPivoteReport(string FromDate, string FromTime, string ToDate, string ToTime)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            try
            {
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                DataTable LaderTypeReportTable = new DataTable();
                TrafficFactory.SelectAllInServiceTypeWithPivotReport(FromDate, FromTime, ToDate, ToTime, LaderTypeReportTable);
                this.DataSource            = LaderTypeReportTable;
                FromDatetxt.Text           = FromDate;
                FromTimetxt.Text           = FromTime;
                ToDatetxt.Text             = ToDate;
                ToTimetxt.Text             = ToTime;
                UserNametxt.Text           = HPS.Common.CurrentUser.user.UserName_nvc;
                Datetxt.Text               = TrafficFactory.ServerJalaliDate;
                Timetxt.Text               = TrafficFactory.ServerTime;
                ServicesTypetxt.DataField  = "TrafficType_nvc";
                CountWithLadetxt.DataField = "CountWithlade";
                Pivottxt.DataField         = "LaderPivotGroup_nvc";
                // CountWithoutLadetxt.DataField = "Countwithoutlade";
                Pricetxt.DataField = "Price_dec";

                Int64?AllcountRecords = (from row in LaderTypeReportTable.AsEnumerable() select(Int32) row["CountWithlade"]).Sum();
                AllCountwithLadetxt.Text = AllcountRecords.HasValue ? AllcountRecords.ToString() : "0";

                //Int64? AllcountWithoutLadeRecords = (from row in LaderTypeReportTable.AsEnumerable() select (Int32)row["Countwithoutlade"]).Sum();
                //AllCountWithoutLadetxt.Text = AllcountWithoutLadeRecords.HasValue ? AllcountWithoutLadeRecords.ToString() : "0";

                decimal?AllPriceRecords = (from row in LaderTypeReportTable.AsEnumerable() select(decimal) row["Price_dec"]).Sum();
                AllPricetxt.Text = AllPriceRecords.HasValue ? AllPriceRecords.ToString() : "0";
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }