public Model_Student_Mutual_Correct DataRowToModel(DataRow row) { Model_Student_Mutual_Correct correct = new Model_Student_Mutual_Correct(); if (row != null) { if (row["Student_Mutual_Correct_Id"] != null) { correct.Student_Mutual_Correct_Id = row["Student_Mutual_Correct_Id"].ToString(); } if (row["Correct_Guid"] != null) { correct.Correct_Guid = row["Correct_Guid"].ToString(); } if (row["HomeWork_Id"] != null) { correct.HomeWork_Id = row["HomeWork_Id"].ToString(); } if (row["Student_Id"] != null) { correct.Student_Id = row["Student_Id"].ToString(); } if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != "")) { correct.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString())); } if (row["Remark"] != null) { correct.Remark = row["Remark"].ToString(); } } return(correct); }
public bool Add(Model_Student_Mutual_Correct model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into Student_Mutual_Correct("); builder.Append("Student_Mutual_Correct_Id,Correct_Guid,HomeWork_Id,Student_Id,CreateTime,Remark)"); builder.Append(" values ("); builder.Append("@Student_Mutual_Correct_Id,@Correct_Guid,@HomeWork_Id,@Student_Id,@CreateTime,@Remark)"); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@Student_Mutual_Correct_Id", SqlDbType.Char, 0x24), new SqlParameter("@Correct_Guid", SqlDbType.Char, 0x24), new SqlParameter("@HomeWork_Id", SqlDbType.Char, 0x24), new SqlParameter("@Student_Id", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@Remark", SqlDbType.NVarChar, 0x7d0) }; cmdParms[0].Value = model.Student_Mutual_Correct_Id; cmdParms[1].Value = model.Correct_Guid; cmdParms[2].Value = model.HomeWork_Id; cmdParms[3].Value = model.Student_Id; cmdParms[4].Value = model.CreateTime; cmdParms[5].Value = model.Remark; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public List <Model_Student_Mutual_Correct> DataTableToList(DataTable dt) { List <Model_Student_Mutual_Correct> list = new List <Model_Student_Mutual_Correct>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { Model_Student_Mutual_Correct item = this.dal.DataRowToModel(dt.Rows[i]); if (item != null) { list.Add(item); } } } return(list); }
public bool Update(Model_Student_Mutual_Correct model) { StringBuilder builder = new StringBuilder(); builder.Append("update Student_Mutual_Correct set "); builder.Append("Correct_Guid=@Correct_Guid,"); builder.Append("HomeWork_Id=@HomeWork_Id,"); builder.Append("Student_Id=@Student_Id,"); builder.Append("CreateTime=@CreateTime,"); builder.Append("Remark=@Remark"); builder.Append(" where Student_Mutual_Correct_Id=@Student_Mutual_Correct_Id "); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@Correct_Guid", SqlDbType.Char, 0x24), new SqlParameter("@HomeWork_Id", SqlDbType.Char, 0x24), new SqlParameter("@Student_Id", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@Remark", SqlDbType.NVarChar, 0x7d0), new SqlParameter("@Student_Mutual_Correct_Id", SqlDbType.Char, 0x24) }; cmdParms[0].Value = model.Correct_Guid; cmdParms[1].Value = model.HomeWork_Id; cmdParms[2].Value = model.Student_Id; cmdParms[3].Value = model.CreateTime; cmdParms[4].Value = model.Remark; cmdParms[5].Value = model.Student_Mutual_Correct_Id; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public bool Add(Model_Student_Mutual_Correct model) { return(this.dal.Add(model)); }
public bool Update(Model_Student_Mutual_Correct model) { return(this.dal.Update(model)); }