/// <summary> /// 获得数据列表 /// </summary> public List <ZQUSR.Model.sr_Lunwen> DataTableToList(DataTable dt) { List <ZQUSR.Model.sr_Lunwen> modelList = new List <ZQUSR.Model.sr_Lunwen>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ZQUSR.Model.sr_Lunwen model; for (int n = 0; n < rowsCount; n++) { model = new ZQUSR.Model.sr_Lunwen(); if (dt.Rows[n]["PK_LID"].ToString() != "") { model.PK_LID = int.Parse(dt.Rows[n]["PK_LID"].ToString()); } model.Type = dt.Rows[n]["Type"].ToString(); model.Situation = dt.Rows[n]["Situation"].ToString(); if (dt.Rows[n]["Factor1"].ToString() != "") { model.Factor1 = decimal.Parse(dt.Rows[n]["Factor1"].ToString()); //model.Factor1 = dt.Rows[n]["Factor1"].ToString(); //--by caiyuying } if (dt.Rows[n]["Factor2"].ToString() != "") { model.Factor2 = decimal.Parse(dt.Rows[n]["Factor2"].ToString()); //model.Factor2 = dt.Rows[n]["Factor2"].ToString(); //--by caiyuying } model.JiBie = dt.Rows[n]["JiBie"].ToString(); if (dt.Rows[n]["LevelFactor"].ToString() != "") { model.LevelFactor = decimal.Parse(dt.Rows[n]["LevelFactor"].ToString()); //model.LevelFactor = dt.Rows[n]["LevelFactor"].ToString(); //--by caiyuying } model.Extra1 = dt.Rows[n]["Extra1"].ToString(); model.Extra2 = dt.Rows[n]["Extra2"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// ��������б� /// </summary> public List<ZQUSR.Model.sr_Lunwen> DataTableToList(DataTable dt) { List<ZQUSR.Model.sr_Lunwen> modelList = new List<ZQUSR.Model.sr_Lunwen>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ZQUSR.Model.sr_Lunwen model; for (int n = 0; n < rowsCount; n++) { model = new ZQUSR.Model.sr_Lunwen(); if(dt.Rows[n]["PK_LID"].ToString()!="") { model.PK_LID=int.Parse(dt.Rows[n]["PK_LID"].ToString()); } model.Type=dt.Rows[n]["Type"].ToString(); model.Situation=dt.Rows[n]["Situation"].ToString(); if(dt.Rows[n]["Factor1"].ToString()!="") { model.Factor1=decimal.Parse(dt.Rows[n]["Factor1"].ToString()); //model.Factor1 = dt.Rows[n]["Factor1"].ToString(); //--by caiyuying } if(dt.Rows[n]["Factor2"].ToString()!="") { model.Factor2=decimal.Parse(dt.Rows[n]["Factor2"].ToString()); //model.Factor2 = dt.Rows[n]["Factor2"].ToString(); //--by caiyuying } model.JiBie=dt.Rows[n]["JiBie"].ToString(); if(dt.Rows[n]["LevelFactor"].ToString()!="") { model.LevelFactor=decimal.Parse(dt.Rows[n]["LevelFactor"].ToString()); //model.LevelFactor = dt.Rows[n]["LevelFactor"].ToString(); //--by caiyuying } model.Extra1=dt.Rows[n]["Extra1"].ToString(); model.Extra2=dt.Rows[n]["Extra2"].ToString(); modelList.Add(model); } } return modelList; }
/// <summary> /// 更新一条数据 /// </summary> public void Update(ZQUSR.Model.sr_Lunwen model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ZQUSR.Model.sr_Lunwen model) { return(dal.Add(model)); }
/// <summary> /// 是否存在该记录(Type/Situation)-By Jianguo Fung /// </summary> public bool Exists(ZQUSR.Model.sr_Lunwen model) { return(dal.Exists(model)); }