protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { System.Web.UI.HtmlControls.HtmlGenericControl AddMenu = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Li4"); AddMenu.Attributes.Add("class", "active"); CommonClassLibrary.CommonDataSet.PaymentTicketOrderDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.PaymentTicketOrderTableAdapter().GetDatasumtotal(); foreach (CommonClassLibrary.CommonDataSet.PaymentTicketOrderRow item in collection) { if (item.Total == 0) { this.Lifetimesales_Label.Text = "0"; } else { this.Lifetimesales_Label.Text = item.Total.ToString("#,##0.00"); } } CommonClassLibrary.CommonDataSet.PaymentTicketOrderDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.PaymentTicketOrderTableAdapter().GetDataBycountticket(); foreach (CommonClassLibrary.CommonDataSet.PaymentTicketOrderRow item2 in collection2) { if (item2.Total == 0) { this.Totalorders_Label.Text = "0"; } else { this.Totalorders_Label.Text = item2.Total.ToString("#,##0"); } } if (Totalorders_Label.Text == "0") { this.Averageorder_Label.Text = "0"; } else { this.Averageorder_Label.Text = (decimal.Parse(Lifetimesales_Label.Text) / decimal.Parse(Totalorders_Label.Text)).ToString("#,##0.00"); } gettoptenrepeater(); getnewuserrepeater(); getneworderrepeater(); getgraph(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CommonClassLibrary.CommonDataSet.PaymentTicketOrderDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.PaymentTicketOrderTableAdapter().GetDatasumtotal(); foreach (CommonClassLibrary.CommonDataSet.PaymentTicketOrderRow item in collection) { this.Lifetimesales_Label.Text = item.Total.ToString("#,##0.00"); } CommonClassLibrary.CommonDataSet.PaymentTicketOrderDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.PaymentTicketOrderTableAdapter().GetDataBycountticket(); foreach (CommonClassLibrary.CommonDataSet.PaymentTicketOrderRow item2 in collection2) { this.Totalorders_Label.Text = item2.Total.ToString("#,##0"); } this.Averageorder_Label.Text = (decimal.Parse(Lifetimesales_Label.Text) / decimal.Parse(Totalorders_Label.Text)).ToString("#,##0.00"); } }