/// <summary> /// /// </summary> /// <param name="t"></param> /// <param name="d"></param> /// <param name="p"></param> /// <param name="a"></param> private void AddDuringWaterValue(DataTable t, DuringWaterClass d, string waterUserName, double amount) { foreach (DataRow row in t.Rows) { string duringName = row[0].ToString(); if (duringName == d.Name) { row[waterUserName] = amount; } } }
/// <summary> /// /// </summary> /// <returns></returns> static public DuringWaterCollection CreateDuringWaterCollection() { DuringWaterCollection d = new DuringWaterCollection(); DataTable t = DuringWaterDBI.GetDuringDataTable(); foreach (DataRow row in t.Rows) { DuringWaterClass item = CreateDuringWater(row); d.Add(item); } return(d); }
/// <summary> /// /// </summary> /// <param name="row"></param> /// <returns></returns> private static DuringWaterClass CreateDuringWater(DataRow row) { //DataRow row = tbl.Rows[0]; string name = row[YongShuiGuanLiDBI.DBNames.tblDuringWater.Name].ToString(); int id = Convert.ToInt32(row[YongShuiGuanLiDBI.DBNames.tblDuringWater.DuringWaterID]); DateTime b = Convert.ToDateTime(row[YongShuiGuanLiDBI.DBNames.tblDuringWater.BeginDT]); DateTime e = Convert.ToDateTime(row[YongShuiGuanLiDBI.DBNames.tblDuringWater.EndDT]); DuringWaterClass d = new DuringWaterClass(); d.ID = id; d.Name = name; d.Begin = b; d.End = e; return(d); }