/// <summary> /// 添加数据 /// </summary> /// <param name="materielInfo"></param> /// <returns></returns> public bool InsertInfo(MaterielInfo materielInfo) { string sqlstr = string.Format("INSERT INTO Materiel VALUES('{0}',{1},{2},'{3}',{4},{5},'{6}',{7},'{8}','{9}')", materielInfo.ID, materielInfo.Partition.PID, materielInfo.unit.UID, materielInfo.MName, materielInfo.PuPrice, materielInfo.SaPrice, materielInfo.Specifications, materielInfo.Number, materielInfo.FirstDate, materielInfo.LastDate); return(DBHelper.Update(sqlstr)); }
/// <summary> /// 数据更新 /// </summary> /// <param name="materielInfo"></param> /// <param name="MID"></param> /// <returns></returns> public bool UpdateInfo(MaterielInfo materielInfo, string MID) { string sqlstr = string.Format("UPDATE Materiel SET PID={0},UID={1},MName='{2}',PuPrice={3},SaPrice={4}," + "Specifications='{5}',Number={6},LastDate='{7}' WHERE ID='{8}'", materielInfo.Partition.PID, materielInfo.unit.UID, materielInfo.MName, materielInfo.PuPrice, materielInfo.SaPrice, materielInfo.Specifications, materielInfo.Number, materielInfo.LastDate, MID ); return((bool)DBHelper.Update(sqlstr)); }