Ejemplo n.º 1
0
        /// <summary>
        /// 插入记录
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public string InsertRemark(ItemDamageCount.Class.Item item)
        {
            string result;
            string sql;

            try
            {
                sql  = "Insert into ItemDamage values";
                sql += "('" + item.Drugcode + "'";
                sql += ",'" + item.Drugname + "'";
                sql += ",'" + item.Spec + "'";
                sql += ",'" + item.Count + "'";
                sql += ",'" + item.Money + "'";
                sql += ",'" + item.Reason + "'";
                sql += ",'" + item.Responsibilityid + "'";
                sql += ",'" + item.Responsibilityer + "'";
                sql += ",'" + item.Reportid + "'";
                sql += ",'" + item.Reporter + "'";
                sql += ",'" + item.Damagetime + "'";
                sql += ",'" + item.Date + "')";

                result = DB.SetPIVAsDB(sql) != 0 ? "插入成功" : "插入失败";
            }
            catch (Exception ex)
            {
                result = "插入出错";
                throw ex;
            }

            return(result);
        }
Ejemplo n.º 2
0
        public void DeleteItem(ItemDamageCount.Class.Item item)
        {
            string sql;

            try
            {
                sql = "Delete from ItemDamage where id='" + item.Id + "' ";
                DB.SetPIVAsDB(sql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }