public static IList<ExtendModule.Recipients> GetBorrowedRecipientsList() { IList<ExtendModule.Recipients> recipients = new List<ExtendModule.Recipients>(); ExtendModule.Recipients recipient; DataSet recipientset = BorrowedRecipients(); foreach (DataRow dr in recipientset.Tables[0].Rows) { recipient=new ExtendModule.Recipients(); recipient.Numbers = dr["Numbers"].ToString(); recipient.Name = dr["Name"].ToString(); recipient.Standards = dr["Standards"].ToString(); recipient.UnitPrice = dr["UnitPrice"].ToString(); recipient.FactoryCode = dr["FactoryCode"].ToString(); recipient.MRecipients = dr["MRecipients"].ToString(); recipient.EncodedTime = (DateTime)dr["EncodedTime"]; recipient.Operator = dr["Operator"].ToString(); recipient.BorrowedState = dr["BorrowedState"].ToString(); recipients.Add(recipient); } return recipients; }
/// <summary> /// 获得数据列表 /// </summary> public List<ExtendModule.Recipients> GetExtendModelList(string strWhere) { DataSet ds = dal.GetInnerList(strWhere); List<ExtendModule.Recipients> modelList = new List<ExtendModule.Recipients>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { ExtendModule.Recipients model; for (int n = 0; n < rowsCount; n++) { model = new ExtendModule.Recipients(); model.ID = long.Parse(ds.Tables[0].Rows[n]["ID"].ToString()); model.Numbers = ds.Tables[0].Rows[n]["Numbers"].ToString(); model.Type = ds.Tables[0].Rows[n]["Type"].ToString(); model.Name = ds.Tables[0].Rows[n]["Name"].ToString(); model.MRecipients = ds.Tables[0].Rows[n]["MRecipients"].ToString(); if (ds.Tables[0].Rows[n]["EncodedTime"].ToString() != "") { model.EncodedTime = DateTime.Parse(ds.Tables[0].Rows[n]["EncodedTime"].ToString()); } if (ds.Tables[0].Rows[n]["ReturnTime"].ToString() != "") { model.ReturnTime = DateTime.Parse(ds.Tables[0].Rows[n]["ReturnTime"].ToString()); } model.BorrowedState = ds.Tables[0].Rows[n]["BorrowedState"].ToString(); model.Comment = ds.Tables[0].Rows[n]["Comment"].ToString(); model.Operator = ds.Tables[0].Rows[n]["Operator"].ToString(); if (ds.Tables[0].Rows[n]["OperatDate"].ToString() != "") { model.OperatDate = DateTime.Parse(ds.Tables[0].Rows[n]["OperatDate"].ToString()); } model.Standards = ds.Tables[0].Rows[n]["Standards"].ToString(); model.UnitPrice = ds.Tables[0].Rows[n]["UnitPrice"].ToString(); model.FactoryCode = ds.Tables[0].Rows[n]["FactoryCode"].ToString(); modelList.Add(model); } } return modelList; }