public bool Add(Model_Two_WayChecklistDetailToAttr model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into Two_WayChecklistDetailToAttr("); builder.Append("Two_WayChecklistDetailToAttr_Id,Two_WayChecklist_Id,Two_WayChecklistDetail_Id,Attr_Type,Attr_Value,CreateUser,CreateTime)"); builder.Append(" values ("); builder.Append("@Two_WayChecklistDetailToAttr_Id,@Two_WayChecklist_Id,@Two_WayChecklistDetail_Id,@Attr_Type,@Attr_Value,@CreateUser,@CreateTime)"); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@Two_WayChecklistDetailToAttr_Id", SqlDbType.Char, 0x24), new SqlParameter("@Two_WayChecklist_Id", SqlDbType.Char, 0x24), new SqlParameter("@Two_WayChecklistDetail_Id", SqlDbType.Char, 0x24), new SqlParameter("@Attr_Type", SqlDbType.Char, 1), new SqlParameter("@Attr_Value", SqlDbType.NVarChar, 0x3e8), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime) }; cmdParms[0].Value = model.Two_WayChecklistDetailToAttr_Id; cmdParms[1].Value = model.Two_WayChecklist_Id; cmdParms[2].Value = model.Two_WayChecklistDetail_Id; cmdParms[3].Value = model.Attr_Type; cmdParms[4].Value = model.Attr_Value; cmdParms[5].Value = model.CreateUser; cmdParms[6].Value = model.CreateTime; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public List <Model_Two_WayChecklistDetailToAttr> DataTableToList(DataTable dt) { List <Model_Two_WayChecklistDetailToAttr> list = new List <Model_Two_WayChecklistDetailToAttr>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { Model_Two_WayChecklistDetailToAttr item = this.dal.DataRowToModel(dt.Rows[i]); if (item != null) { list.Add(item); } } } return(list); }
public bool Update(Model_Two_WayChecklistDetailToAttr model) { StringBuilder builder = new StringBuilder(); builder.Append("update Two_WayChecklistDetailToAttr set "); builder.Append("Two_WayChecklist_Id=@Two_WayChecklist_Id,"); builder.Append("Two_WayChecklistDetail_Id=@Two_WayChecklistDetail_Id,"); builder.Append("Attr_Type=@Attr_Type,"); builder.Append("Attr_Value=@Attr_Value,"); builder.Append("CreateUser=@CreateUser,"); builder.Append("CreateTime=@CreateTime"); builder.Append(" where Two_WayChecklistDetailToAttr_Id=@Two_WayChecklistDetailToAttr_Id "); SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@Two_WayChecklist_Id", SqlDbType.Char, 0x24), new SqlParameter("@Two_WayChecklistDetail_Id", SqlDbType.Char, 0x24), new SqlParameter("@Attr_Type", SqlDbType.Char, 1), new SqlParameter("@Attr_Value", SqlDbType.NVarChar, 0x3e8), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@Two_WayChecklistDetailToAttr_Id", SqlDbType.Char, 0x24) }; cmdParms[0].Value = model.Two_WayChecklist_Id; cmdParms[1].Value = model.Two_WayChecklistDetail_Id; cmdParms[2].Value = model.Attr_Type; cmdParms[3].Value = model.Attr_Value; cmdParms[4].Value = model.CreateUser; cmdParms[5].Value = model.CreateTime; cmdParms[6].Value = model.Two_WayChecklistDetailToAttr_Id; return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public Model_Two_WayChecklistDetailToAttr DataRowToModel(DataRow row) { Model_Two_WayChecklistDetailToAttr attr = new Model_Two_WayChecklistDetailToAttr(); if (row != null) { if (row["Two_WayChecklistDetailToAttr_Id"] != null) { attr.Two_WayChecklistDetailToAttr_Id = row["Two_WayChecklistDetailToAttr_Id"].ToString(); } if (row["Two_WayChecklist_Id"] != null) { attr.Two_WayChecklist_Id = row["Two_WayChecklist_Id"].ToString(); } if (row["Two_WayChecklistDetail_Id"] != null) { attr.Two_WayChecklistDetail_Id = row["Two_WayChecklistDetail_Id"].ToString(); } if (row["Attr_Type"] != null) { attr.Attr_Type = row["Attr_Type"].ToString(); } if (row["Attr_Value"] != null) { attr.Attr_Value = row["Attr_Value"].ToString(); } if (row["CreateUser"] != null) { attr.CreateUser = row["CreateUser"].ToString(); } if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != "")) { attr.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString())); } } return(attr); }
public bool Add(Model_Two_WayChecklistDetailToAttr model) { return(this.dal.Add(model)); }
public bool Update(Model_Two_WayChecklistDetailToAttr model) { return(this.dal.Update(model)); }