public com.jwsoft.pm.entpm.model.DepositoryClass GetModel(int DepoClassID) { StringBuilder builder = new StringBuilder(); builder.Append("select "); builder.Append(" DepoClassID,ClassCode,ClassName,IsValid,i_ChildNum "); builder.Append(" from pm_Repe_DepositoryClass "); builder.Append(" where DepoClassID=" + DepoClassID + " "); com.jwsoft.pm.entpm.model.DepositoryClass class2 = new com.jwsoft.pm.entpm.model.DepositoryClass(); DataSet set = publicDbOpClass.DataSetQuary(builder.ToString()); if (set.Tables[0].Rows.Count <= 0) { return(null); } if (set.Tables[0].Rows[0]["DepoClassID"].ToString() != "") { class2.DepoClassID = int.Parse(set.Tables[0].Rows[0]["DepoClassID"].ToString()); } class2.ClassCode = set.Tables[0].Rows[0]["ClassCode"].ToString(); class2.ClassName = set.Tables[0].Rows[0]["ClassName"].ToString(); class2.IsValid = set.Tables[0].Rows[0]["IsValid"].ToString(); if (set.Tables[0].Rows[0]["i_ChildNum"].ToString() != "") { class2.i_ChildNum = int.Parse(set.Tables[0].Rows[0]["i_ChildNum"].ToString()); } return(class2); }
public bool Update(com.jwsoft.pm.entpm.model.DepositoryClass model) { StringBuilder builder = new StringBuilder(); builder.Append("update pm_Repe_DepositoryClass set "); builder.Append("ClassCode='" + model.ClassCode + "',"); builder.Append("ClassName='" + model.ClassName + "',"); builder.Append("IsValid='" + model.IsValid + "',"); builder.Append("i_ChildNum=" + model.i_ChildNum); builder.Append(" where DepoClassID=" + model.DepoClassID + " "); return(publicDbOpClass.NonQuerySqlString(builder.ToString())); }
public bool Add(com.jwsoft.pm.entpm.model.DepositoryClass model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into pm_Repe_DepositoryClass("); builder.Append("ClassCode,ClassName,IsValid,i_ChildNum"); builder.Append(")"); builder.Append(" values ("); builder.Append("'" + model.ClassCode + "',"); builder.Append("'" + model.ClassName + "',"); builder.Append("'" + model.IsValid + "',"); builder.Append(model.i_ChildNum); builder.Append(")"); return(publicDbOpClass.NonQuerySqlString(builder.ToString())); }