Пример #1
0
        public AllLaderTypeTurnReport(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.SelectLaderTypeTurnReport(FromDate, FromTime, ToDate, ToTime, ref 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;
                Cartxt.DataField               = "LaderType_nvc";
                Counttxt.DataField             = "Count_int";
                Pricetxt.DataField             = "Price_dec";
                AcceptedTurnCounttxt.DataField = "AcceptedTurnCount";

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

                Int64?AllTurnAcceptedcountRecords = (from row in LaderTypeReportTable.AsEnumerable() select(Int32) row["AcceptedTurnCount"]).Sum();
                AllAcceptedTurnCounttxt.Text = AllTurnAcceptedcountRecords.HasValue ? AllTurnAcceptedcountRecords.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);
            }
        }