예제 #1
0
 /// <summary>
 /// 执行插入人员信息方法
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>影响行数</returns>
 public int Insert(material_info obj)
 {
     try
     {
         string sql = "insert into fimp.material_info(category_id,material_code,material_name,material_type,material_inventory,remark,createtime)values({0},'{1}','{2}','{3}',{4},'{5}','{6}')";
         sql = string.Format(sql, obj.category_id, obj.material_code, obj.material_name, obj.material_type, obj.material_inventory, obj.remark, DateTime.Now.AddHours(GlobalDefine.SysTimeZone));
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 public material_info SelectSingleByID(int id)
 {
     try
     {
         material_info obj = new material_info();
         string        sql = "select * from fimp.material_info where id={0}";
         sql = string.Format(sql, id);
         obj = PostgreHelper.GetSingleEntity <material_info>(sql);
         return(obj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 /// <summary>
 /// 更新信息
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int Update(material_info obj)
 {
     try
     {
         int    count = 0;
         string sql   = "update fimp.material_info set category_id={0},material_code='{1}',material_name='{2}',material_type='{3}',material_inventory={4},remark='{5}',createtime='{6}' where id={7}";
         sql   = string.Format(sql, obj.category_id, obj.material_code, obj.material_name, obj.material_type, obj.material_inventory, obj.remark, obj.createtime, obj.id);
         count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public int Update(material_info obj)
        {
            int count = AIS.Update(obj);

            return(count);
        }
        public int Insert(material_info obj)
        {
            int count = AIS.Insert(obj);

            return(count);
        }
        public material_info SelectSingleID(int id)
        {
            material_info obj = AIS.SelectSingleByID(id);

            return(obj);
        }
예제 #7
0
        public material_info SelectSingle(int id)
        {
            material_info objList = MIS.SelectSingleByID(id);

            return(objList);
        }