public SqlParameter[] GetParameters(M_SQL model) { SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.TagName; sp[2].Value = model.TableName; sp[3].Value = model.Unit; sp[4].Value = model.Icon; sp[5].Value = model.UserID; sp[6].Value = model.BtnName; sp[7].Value = model.SqlUrl; sp[8].Value = model.RunTime; sp[9].Value = model.RunNum; sp[10].Value = model.Explain; return(sp); }
public M_SQL GetModelFromReader(DbDataReader rdr) { M_SQL model = new M_SQL(); model.ID = Convert.ToInt32(rdr["ID"]); model.TagName = rdr["TagName"].ToString(); model.TableName = rdr["TableName"].ToString(); model.Unit = rdr["Unit"].ToString(); model.Icon = rdr["Icon"].ToString(); model.UserID = rdr["UserID"].ToString(); model.BtnName = rdr["BtnName"].ToString(); model.SqlUrl = rdr["SqlUrl"].ToString(); model.RunNum = Convert.ToInt32(rdr["RunNum"]); model.RunTime = rdr["RunTime"].ToString(); model.Explain = rdr["Explain"].ToString(); rdr.Close(); return(model); }