public int Update(OABooksApplyMain model) { StringBuilder builder = new StringBuilder(); builder.Append("update OA_Books_ApplyMain set "); builder.Append(" RecordDate='" + model.RecordDate + "',"); builder.Append(" Remark='" + model.Remark + "' "); builder.Append(" where RecordID='" + model.RecordID + "'"); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
public int Add(OABooksApplyMain model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into OA_Books_ApplyMain("); builder.Append("RecordID,AuditState,CorpCode,UserCode,RecordDate,SumMoney,Remark,IsInStorage"); builder.Append(")"); builder.Append(" values ("); builder.Append("'" + model.RecordID + "',"); builder.Append(model.AuditState + ","); builder.Append("'" + model.CorpCode + "',"); builder.Append("'" + model.UserCode + "',"); builder.Append("'" + model.RecordDate + "',"); builder.Append(model.SumMoney + ","); builder.Append("'" + model.Remark + "',"); builder.Append("'" + model.IsInStorage + "'"); builder.Append(")"); return(publicDbOpClass.ExecSqlString(builder.ToString())); }
public OABooksApplyMain GetModel(Guid RecordID) { StringBuilder builder = new StringBuilder(); builder.Append("select * "); builder.Append(" RecordID,AuditState,CorpCode,UserCode,RecordDate,SumMoney,Remark,IsInStorage "); builder.Append(" from OA_Books_ApplyMain "); builder.Append(" where RecordID=" + RecordID); OABooksApplyMain main = new OABooksApplyMain(); DataSet set = publicDbOpClass.DataSetQuary(builder.ToString()); if (set.Tables[0].Rows.Count <= 0) { return(null); } if (set.Tables[0].Rows[0]["RecordID"].ToString() != "") { main.RecordID = new Guid(set.Tables[0].Rows[0]["RecordID"].ToString()); } if (set.Tables[0].Rows[0]["AuditState"].ToString() != "") { main.AuditState = int.Parse(set.Tables[0].Rows[0]["AuditState"].ToString()); } main.CorpCode = set.Tables[0].Rows[0]["CorpCode"].ToString(); main.UserCode = set.Tables[0].Rows[0]["UserCode"].ToString(); if (set.Tables[0].Rows[0]["RecordDate"].ToString() != "") { main.RecordDate = DateTime.Parse(set.Tables[0].Rows[0]["RecordDate"].ToString()); } if (set.Tables[0].Rows[0]["SumMoney"].ToString() != "") { main.SumMoney = decimal.Parse(set.Tables[0].Rows[0]["SumMoney"].ToString()); } main.Remark = set.Tables[0].Rows[0]["Remark"].ToString(); main.IsInStorage = set.Tables[0].Rows[0]["IsInStorage"].ToString(); return(main); }