public Model_ClientTabToTab DataRowToModel(DataRow row) { Model_ClientTabToTab tab = new Model_ClientTabToTab(); if (row != null) { if (row["ClientTabToTab_Id"] != null) { tab.ClientTabToTab_Id = row["ClientTabToTab_Id"].ToString(); } if (row["Tabindex"] != null) { tab.Tabindex = row["Tabindex"].ToString(); } if (row["ToTabindex"] != null) { tab.ToTabindex = row["ToTabindex"].ToString(); } if (row["Remark"] != null) { tab.Remark = row["Remark"].ToString(); } if (row["CreateUser"] != null) { tab.CreateUser = row["CreateUser"].ToString(); } if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != "")) { tab.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString())); } } return(tab); }
public bool Add(Model_ClientTabToTab model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into ClientTabToTab("); builder.Append("ClientTabToTab_Id,Tabindex,ToTabindex,Remark,CreateUser,CreateTime)"); builder.Append(" values ("); builder.Append("@ClientTabToTab_Id,@Tabindex,@ToTabindex,@Remark,@CreateUser,@CreateTime)"); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@ClientTabToTab_Id", SqlDbType.Char, 0x24), new SqlParameter("@Tabindex", SqlDbType.VarChar, 100), new SqlParameter("@ToTabindex", SqlDbType.VarChar, 100), new SqlParameter("@Remark", SqlDbType.VarChar, 0x3e8), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime) }; cmdParms[0].Value = model.ClientTabToTab_Id; cmdParms[1].Value = model.Tabindex; cmdParms[2].Value = model.ToTabindex; cmdParms[3].Value = model.Remark; cmdParms[4].Value = model.CreateUser; cmdParms[5].Value = model.CreateTime; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public List <Model_ClientTabToTab> DataTableToList(DataTable dt) { List <Model_ClientTabToTab> list = new List <Model_ClientTabToTab>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { Model_ClientTabToTab item = this.dal.DataRowToModel(dt.Rows[i]); if (item != null) { list.Add(item); } } } return(list); }
public bool Update(Model_ClientTabToTab model) { StringBuilder builder = new StringBuilder(); builder.Append("update ClientTabToTab set "); builder.Append("ClientTabToTab_Id=@ClientTabToTab_Id,"); builder.Append("ToTabindex=@ToTabindex,"); builder.Append("Remark=@Remark,"); builder.Append("CreateUser=@CreateUser,"); builder.Append("CreateTime=@CreateTime"); builder.Append(" where Tabindex=@Tabindex "); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@ClientTabToTab_Id", SqlDbType.Char, 0x24), new SqlParameter("@ToTabindex", SqlDbType.VarChar, 100), new SqlParameter("@Remark", SqlDbType.VarChar, 0x3e8), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@Tabindex", SqlDbType.VarChar, 100) }; cmdParms[0].Value = model.ClientTabToTab_Id; cmdParms[1].Value = model.ToTabindex; cmdParms[2].Value = model.Remark; cmdParms[3].Value = model.CreateUser; cmdParms[4].Value = model.CreateTime; cmdParms[5].Value = model.Tabindex; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public bool Add(Model_ClientTabToTab model) { return(this.dal.Add(model)); }
public bool Update(Model_ClientTabToTab model) { return(this.dal.Update(model)); }