} //employees Edit public string Edit(Model.Parts parts) { string sqlStr = "update Parts set name=@name,type=@type,price=@price,info=@info Where partID=@partID"; SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@partID", parts.PartID), new SqlParameter("@name", parts.Name), new SqlParameter("@type", parts.Type), new SqlParameter("@price", parts.Price), new SqlParameter("@info", parts.Info) }; if (userDao.Edit(sqlStr, paras)) { return("Success"); } else { return("Fail"); } } //parts Edit
} //orderList Insert public string Insert(Model.Parts parts) { string sqlStr = "insert into Parts(partID,name,type,price,info) values(@partID,@name,@type,@price,@info)"; SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@partID", parts.PartID), new SqlParameter("@name", parts.Name), new SqlParameter("@type", parts.Type), new SqlParameter("@price", parts.Price), new SqlParameter("@info", parts.Info) }; if (userDao.Insert(sqlStr, paras)) { return("Success"); } else { return("Fail"); } } //parts Insert