public string Format(string template, string description) { return(template.FormatInvariant( description.NaIfEmpty(), TotalProcessed.ToString("N0"), TotalRecords.ToString("N0"), Success.ToString("N0"), Failure.ToString("N0"), Skipped.ToString("N0"), Added.ToString("N0"), Updated.ToString("N0"))); }
public override string ToString() { return("PageNumber: " + PageNumber.ToString() + "\n" + "PageSize: " + PageSize.ToString() + "\n" + "TotalPages: " + TotalPages.ToString() + "\n" + "TotalRecords: " + TotalRecords.ToString() + "\n" + "NextPage: " + NextPage.ToString() + "\n" + "PreviousPage: " + PreviousPage.ToString() + "\n" + "Data: " + Data + "\n" + "Succeeded: " + Succeeded.ToString() + "\n" + "Errors: " + Errors.ToString() + "\n"); }
protected override void Render(HtmlTextWriter writer) { Control skin = (Control)this.Parent; Panel displayPager = (Panel)skin.FindControl("DisplayPager"); if (displayPager != null) { displayPager.Visible = true; } this.Text = String.Format(text, PageIndex, TotalPages.ToString("n0"), TotalRecords.ToString("n0")); base.Render(writer); }
public override string ToString() { if (!Content.Contains("{")) { return(Content); } var str = Content.FormatInvariant( Description.NaIfEmpty(), (int)Math.Round(ProcessedPercent), TotalProcessed.ToString("N0"), TotalRecords.ToString("N0"), Success.ToString("N0"), Failure.ToString("N0"), Skipped.ToString("N0"), Added.ToString("N0"), Updated.ToString("N0") ); return(str); }
void GetTotalByGSTRName() { DataSet ds = CLSCommon.CallApiGet("api/CaHome/GetCaHomeData?Ind=2&CaCode=" + Session["CaCode"].ToString() + "&CaCodeOdp=" + Session["CaCodeOdp"].ToString() + "&RecordNo=" + ddlGSTR.SelectedValue.ToString()); if (ds != null) { decimal TotalRecords, TotalCompleted, PercentData, PercentSubmit, PercentFiled, PercentSaved, TotalSubmit, TotalFiled, TotalSaved; TotalRecords = decimal.Parse(ds.Tables[0].Rows[0]["TotalClient"].ToString()); TotalCompleted = decimal.Parse(ds.Tables[1].Rows[0]["TotalCompleted"].ToString()); lblTotalRecords.Text = TotalRecords.ToString(); lblCompleted.InnerHtml = TotalCompleted.ToString(); TotalSaved = decimal.Parse(ds.Tables[2].Rows[0]["TotalSaved"].ToString()); TotalSubmit = decimal.Parse(ds.Tables[3].Rows[0]["TotalSubmit"].ToString()); TotalFiled = decimal.Parse(ds.Tables[4].Rows[0]["TotalFiled"].ToString()); if (TotalRecords > 0) { PercentData = (TotalCompleted / TotalRecords) * 100; PercentSubmit = (TotalSubmit / TotalRecords) * 100; PercentSaved = (TotalSaved / TotalRecords) * 100; PercentFiled = (TotalFiled / TotalRecords) * 100; } else { PercentData = 0; PercentSubmit = 0; PercentSaved = 0; PercentFiled = 0; } // divCompleted.Attributes.Add("data-label", TotalCompleted.ToString()); divCompleted.Attributes.Add("data-percent", Math.Floor(PercentData).ToString()); divSaved.Attributes.Add("data-percent", Math.Floor(PercentSaved).ToString()); divSubmit.Attributes.Add("data-percent", Math.Floor(PercentSubmit).ToString()); divFiled.Attributes.Add("data-percent", Math.Floor(PercentFiled).ToString()); lblSaved.InnerText = TotalSaved.ToString(); lblSubmit.InnerText = TotalSubmit.ToString(); lblFiled.InnerText = TotalFiled.ToString(); } }
public XmlDocument ToXml() { if (Data != null) { int BeginIndex = (Convert.ToInt32(HttpContext.Current.Request.Form["PageSize"]) * Convert.ToInt32(HttpContext.Current.Request.Form["PageIndex"])); BeginIndex++; XmlDocument xmldoc = new XmlDocument(); xmldoc.AppendChild(xmldoc.CreateXmlDeclaration("1.0", "utf-8", null)); XmlElement DatasetRoot = xmldoc.CreateElement("dataset"); XmlElement XmlRow, XmlCol; XmlAttribute attr; attr = xmldoc.CreateAttribute("name"); if (!string.IsNullOrEmpty(this.Title)) { attr.Value = HttpUtility.HtmlEncode(this.Title); DatasetRoot.Attributes.Append(attr); } attr = xmldoc.CreateAttribute("index"); attr.Value = HttpContext.Current.Request.Form["PageIndex"]; DatasetRoot.Attributes.Append(attr); attr = xmldoc.CreateAttribute("total"); attr.Value = TotalRecords.ToString(); DatasetRoot.Attributes.Append(attr); StringBuilder sb = new StringBuilder(); var items = (IEnumerable)Data; if (Columns.Count == 0) { GenerateColumns(); } if (EnableRowNo) { Columns.Insert(0, new GridColumn { BindRow = "RowNo", EnableSort = false, Name = "" }); } XmlCDataSection cda; foreach (var row in items) { DataBindRow RowData = new DataBindRow(row); XmlRow = xmldoc.CreateElement("row"); foreach (var col in Columns) { XmlCol = xmldoc.CreateElement("col"); attr = xmldoc.CreateAttribute("name"); attr.Value = col.Name; XmlCol.Attributes.Append(attr); attr = xmldoc.CreateAttribute("field"); attr.Value = col.BindRow; XmlCol.Attributes.Append(attr); var value = RowData[col.BindRow]; cda = xmldoc.CreateCDataSection(col.ToString(RowData, value)); XmlCol.AppendChild(cda); if (col.BindRow == "RowNo") { attr = xmldoc.CreateAttribute("no"); attr.Value = BeginIndex.ToString(); XmlRow.Attributes.Append(attr); BeginIndex++; } XmlRow.AppendChild(XmlCol); } DatasetRoot.AppendChild(XmlRow); } xmldoc.AppendChild(DatasetRoot); return(xmldoc); } else { return(new XmlDocument()); } }