/// <summary> /// 用作特定类型的哈希函数。 /// </summary> /// <returns>当前Object的哈希代码。</returns> /// <remarks> /// 有关此函数的更多信息,请参见:http://msdn.microsoft.com/zh-cn/library/system.object.gethashcode。 /// </remarks> public override int GetHashCode() { return(TotalPages.GetHashCode() ^ TotalRecords.GetHashCode() ^ PageNumber.GetHashCode() ^ PageSize.GetHashCode()); }
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 async Task FilterAsync(string name, string value) { Page = 1; _filterValue = value; _filterColumn = name; OnFilter?.Invoke(name); Items = (await DataSet.Invoke(Page - 1, _sortColumn, _desc, _filterColumn, _filterValue)).ToList(); _itemCount = TotalRecords.Invoke(); await InvokeAsync(StateHasChanged); }
public int Update(TotalRecords pObjTotalRecords) { try { return(mObjTotalRecordsTableDAO.Update(pObjTotalRecords)); } catch (Exception lObjException) { LogService.WriteError(string.Format("[TotalsRecordsService - Update]: {0}", lObjException.Message)); throw lObjException; } }
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); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (TotalRecords != null) { hashCode = hashCode * 59 + TotalRecords.GetHashCode(); } if (TotalPages != null) { hashCode = hashCode * 59 + TotalPages.GetHashCode(); } return(hashCode); } }
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(); } }
private TagBuilder AddDisplayInfo() { var infoDiv = new TagBuilder("div"); infoDiv.AddCssClass($"{ClassInfoDiv}"); var txt = string.Empty; if (ShowTotalPages == true) { infoDiv.InnerHtml.AppendHtml($"<span class=\"{ClassTotalPages}\">{TotalPages.ToNumberFormat(NumberFormat)} {TextTotalPages}</span>"); } if (ShowTotalRecords == true) { infoDiv.InnerHtml.AppendHtml($"<span class=\"{ClassTotalRecords}\">{TotalRecords.ToNumberFormat(NumberFormat)} {TextTotalRecords}</span>"); } return(infoDiv); }
/// <summary> /// Returns true if Meta instances are equal /// </summary> /// <param name="other">Instance of Meta to be compared</param> /// <returns>Boolean</returns> public bool Equals(Meta other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( TotalRecords == other.TotalRecords || TotalRecords != null && TotalRecords.Equals(other.TotalRecords) ) && ( TotalPages == other.TotalPages || TotalPages != null && TotalPages.Equals(other.TotalPages) )); }
public async Task Refresh() { _itemCount = TotalRecords.Invoke(); Items = (await DataSet.Invoke(Page - 1, _sortColumn, _desc, _filterColumn, _filterValue)).ToList(); await InvokeAsync(StateHasChanged); }
protected override async Task OnInitializedAsync() { Page = StartPage; _itemCount = TotalRecords.Invoke(); Items = (await DataSet.Invoke(Page - 1, _sortColumn, false, _filterColumn, _filterValue)).ToList(); }
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()); } }