public DataTable getLigsPick() { DataTable dt1; try { DataTable dt = (DataTable)this.Session[this._nameSessionData]; if (dt == null || dt.Rows.Count == 0) { return(new DataTable()); } dt1 = DataTableExtensions.CopyToDataTable <DataRow>((IEnumerable <DataRow>)EnumerableRowCollectionExtensions.Where <DataRow>(DataTableExtensions.AsEnumerable(dt), (Func <DataRow, bool>)(x => DataRowExtensions.Field <string>(x, "liq_estid").Equals("PM") || DataRowExtensions.Field <string>(x, "liq_estid").Equals("PF")))); return(dt1); //return DataTableExtensions.CopyToDataTable<DataRow>((IEnumerable<DataRow>)EnumerableRowCollectionExtensions.Where<DataRow>(DataTableExtensions.AsEnumerable(dt), (Func<DataRow, bool>)(x => DataRowExtensions.Field<string>(x, "liq_estid").Equals("PF")))); } catch { return(new DataTable()); } }
public DataTable getLiqsHalls() { try { DataTable dt = (DataTable)this.Session[this._nameSessionData]; if (dt == null || dt.Rows.Count == 0) { return(new DataTable()); } return(DataTableExtensions.CopyToDataTable <DataRow>((IEnumerable <DataRow>)EnumerableRowCollectionExtensions.Where <DataRow>(DataTableExtensions.AsEnumerable(dt), (Func <DataRow, bool>)(x => !DataRowExtensions.Field <string>(x, "lhv_status").Equals("PM"))))); } catch { return(new DataTable()); } }
/// <summary> /// Calculo de totales /// </summary> /// <param name="gv"></param> /// <param name="dt"></param> /// <param name="printLabels"></param> protected void calculateTotals(GridView gv, DataTable dt, bool printLabels, bool showAlert) { try { if (dt == null || dt.Rows.Count <= 0) { return; } var fAnonymousType3 = Enumerable.FirstOrDefault(Enumerable.Select(Enumerable.GroupBy <DataRow, DataTable>((IEnumerable <DataRow>)DataTableExtensions.AsEnumerable(dt), (Func <DataRow, DataTable>)(x => x.Table)), y => { var local_0 = new { x1 = Enumerable.Count <DataRow>((IEnumerable <DataRow>)y), x2 = Enumerable.Sum <DataRow>((IEnumerable <DataRow>)y, (Func <DataRow, Decimal>)(x => DataRowExtensions.Field <Decimal>(x, "Cantidad"))), x3 = Enumerable.Count <DataRow>(Enumerable.Where <DataRow>((IEnumerable <DataRow>)y, (Func <DataRow, bool>)(x => !string.IsNullOrEmpty(x["pin_employee"].ToString())))), x4 = Enumerable.Sum <DataRow>(Enumerable.Where <DataRow>((IEnumerable <DataRow>)y, (Func <DataRow, bool>)(x => !string.IsNullOrEmpty(x["pin_employee"].ToString()))), (Func <DataRow, Decimal>)(x => DataRowExtensions.Field <Decimal>(x, "Cantidad"))) }; return(local_0); })); gv.FooterRow.Cells[0].Text = "TOTALES:"; gv.FooterRow.Cells[1].Text = fAnonymousType3.x1.ToString("N0"); gv.FooterRow.Cells[6].Text = fAnonymousType3.x2.ToString("N0"); // Pedidos sin asignacion de marcacion if (showAlert) { int num = (fAnonymousType3.x1 - fAnonymousType3.x3); if (num > 0) { string script = string.Empty; script += "dialogInfo('Marcación de pedidos','Nuevos pedidos en marcación','Tiene <b> " + num + " nuevos pedidos </b>');"; System.Web.UI.ScriptManager.RegisterStartupScript(upMsg, Page.GetType(), "dialogInfo", script, true); } } if (printLabels) { Label label1 = this.lblLiqInPick; int num1 = fAnonymousType3.x3; string str1 = num1.ToString("N0"); label1.Text = str1; Label label2 = this.lblQtysInPick; Decimal num2 = fAnonymousType3.x4; string str2 = num2.ToString("N0"); label2.Text = str2; Label label3 = this.lblLiqNotPick; num1 = fAnonymousType3.x1 - fAnonymousType3.x3; string str3 = num1.ToString("N0"); label3.Text = str3; Label label4 = this.lblQtyNotPick; num2 = fAnonymousType3.x2 - fAnonymousType3.x4; string str4 = num2.ToString("N0"); label4.Text = str4; } } catch { } }
public void AsEnumerable_NullSource_ThrowsArgumentNullException() { AssertExtensions.Throws <ArgumentNullException>("source", () => DataTableExtensions.AsEnumerable(null)); }