Beispiel #1
0
        //更新数据
        public int Update(material_request_info obj)
        {
            try
            {
                int count = 0;
                if (obj.depot_ack_time < Convert.ToDateTime("2000-01-01 00:00:00"))
                {
                    string sql = "Update fimp.material_request_info set take_person_id={0}, take_time='{1}' where id={2}";
                    sql   = string.Format(sql, obj.take_person_id, obj.take_time, obj.id);
                    count = PostgreHelper.ExecuteNonQuery(sql);
                }
                else
                {
                    string sql = "Update fimp.material_request_info set depot_ack_time='{0}' where id={1}";
                    sql   = string.Format(sql, obj.depot_ack_time, obj.id);
                    count = PostgreHelper.ExecuteNonQuery(sql);
                }


                return(count);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        //插入数据

        public int Insert(material_request_info obj)
        {
            try
            {
                string sql = "Insert into fimp.material_request_info(material_id,station_id,request_person_id,work_order,part_num,request_count,take_person_id,take_time,remark,createtime FROM fimp.material_request_info)values({0},{1},{2},N'{3}',N'{4}',{5},{6},'{7}','{8}','{9}')";
                sql = string.Format(sql, obj.material_id, obj.station_id, obj.request_person_id, obj.work_order, obj.part_num, obj.request_count, obj.take_person_id, obj.take_time, obj.remark, obj.createtime);
                //int count = PostgreHelper.ExecuteNonQuery(sql);
                int count = PostgreHelper.InsertSingleEntity <material_request_info>(obj);
                return(count);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #3
0
 //查询所有material_request_info
 public material_request_info SelectById(int id)
 {
     try
     {
         material_request_info obj = new material_request_info();
         string sql = "SELECT id, material_id,station_id,request_person_id,work_order,part_num,request_count,take_person_id,take_time,remark,createtime FROM fimp.material_request_info where id ={0}";
         sql = string.Format(sql, id);
         obj = PostgreHelper.GetSingleEntity <material_request_info>(sql);
         return(obj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #4
0
        /// <summary>
        /// 物料呼叫增加
        /// </summary>
        /// <param name="materialID">物料id</param>
        /// <param name="count">数量</param>
        /// <param name="stationId">站位id</param>
        /// <param name="part_num">机种</param>
        /// <param name="work_order">工单</param>
        public bool AddMaterialRequest(int materialID, int count, int stationId, string part_num = "", string work_order = "")
        {
            material_request_info request_Info = new material_request_info();

            var list = SelectUnfinishedRequestInfo(materialID, stationId);

            if (list == null || list.Count == 0)
            {
                request_Info.station_id    = stationId;
                request_Info.createtime    = DateTime.Now.AddHours(GlobalDefine.SysTimeZone);
                request_Info.request_count = count;
                request_Info.material_id   = materialID;

                request_Info.part_num   = part_num;   //机种
                request_Info.work_order = work_order; //工单

                Insert(request_Info);
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        public int Update(material_request_info obj)
        {
            int count = MRIS.Update(obj);

            return(count);
        }
Beispiel #6
0
        public int Insert(material_request_info obj)
        {
            int count = MRIS.Insert(obj);

            return(count);
        }
Beispiel #7
0
        public material_request_info SelectById(int id)
        {
            material_request_info objList = MRIS.SelectById(id);

            return(objList);
        }