Пример #1
0
        public void AddProductUPHInfo(UPHInfo itemui)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            try
            {

                Entity.Repository.Meta.IMESSKU.UPH items = new Entity.Repository.Meta.IMESSKU.UPH
                {
                    Process = itemui.Process,
                    Attend_normal = itemui.Attend_normal,
                    Family = itemui.Family,
                    ST = itemui.ST,
                    NormalUPH = itemui.NormalUPH,
                    Cycle = itemui.Cycle,
                    Remark = itemui.Remark,
                    Special = itemui.Special,
                    Editor = itemui.Editor,
                    Cdt = itemui.Cdt,
                    Udt = itemui.Udt

                };
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<Entity.Repository.Meta.IMESSKU.UPH> ecoModelRep = new Repository<Entity.Repository.Meta.IMESSKU.UPH>("UPHDBServer");
                    ecoModelRep.Insert(items);
                    uow.Commit();
                }



            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }

        }
Пример #2
0
        public IList<ProductUPHInfo> GetProductUPHInfoList(DateTime fromtime, DateTime totime)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            IList<ProductUPHInfo> ret = new List<ProductUPHInfo>();
            try
            {
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<ProductUPH> ecoModelRep = new Repository<ProductUPH>("UPHDBServer");//连接字符串 查询ProductUPH 表的数据
                    ret = (from q in ecoModelRep.Query()
                           where q.Date >= fromtime
                               && q.Date <= totime
                           select new ProductUPHInfo
                           {
                               ID = q.ID,
                               Date = q.Date,
                               Line = q.Line,
                               Lesson = q.Lesson,
                               TimeRange = q.TimeRange,
                               Family = q.Family,
                               ProductRatio = q.ProductRatio
                           }).ToList();
                }

                return ret;

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        
        }
Пример #3
0
        public IList<AlarmInfo> GetAllAlarmInfo()
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            IList<AlarmInfo> ret = new List<AlarmInfo>();
            try
            {
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<Alarm> ecoModelRep = new Repository<Alarm>("UPHDBServer");//连接字符串 查询ProductUPH 表的数据
                    ret = (from q in ecoModelRep.Query()
                           select new AlarmInfo
                           {
                               ID = q.ID,
                               process = q.Process,
                               Class = q.Class,
                               PdLine = q.PdLine,
                               BeginTime = q.BeginTime,
                               EndTime = q.EndTime,
                               Status = q.Status,
                               Remark = q.Remark,
                               Editor = q.Editor,
                               Cdt = q.Cdt,
                               Udt = q.Udt
                           }).ToList();
                }

                return ret;

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        }
Пример #4
0
        public void AddAlarmlog(AlarmInfoLog itemui)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            try
            {
                AlarmLog items = new AlarmLog
                {
                    Process = itemui.process,
                    Class = itemui.Class,
                    PdLine = itemui.PdLine,
                    BeginTime = itemui.BeginTime,
                    EndTime = itemui.EndTime,
                    Status = itemui.Status,
                    Remark = itemui.Remark,
                    Editor = itemui.Editor,
                    Cdt = itemui.Cdt,
                };
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<AlarmLog> ecoModelRep = new Repository<AlarmLog>("UPHDBServer");
                    ecoModelRep.Insert(items);
                    uow.Commit();
                }

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        }
Пример #5
0
        public void DelAlarmInfo(AlarmInfo itemui)
        {

            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            try
            {
                Alarm items = new Alarm
                {
                    ID=itemui.ID
                };
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<Alarm> ecoModelRep = new Repository<Alarm>("UPHDBServer");
                    ecoModelRep.Delete(items, true);//删掉记录 根据设置的条件
                    uow.Commit();
                }

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        }
Пример #6
0
        public void AddProductUPHInfo(ProductUPHInfo itemui)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            try
            {
               
                 ProductUPH items = new ProductUPH
                    {
                        Date = itemui.Date,
                        Line = itemui.Line,
                        Lesson = itemui.Lesson,
                        TimeRange = itemui.TimeRange,
                        Family = itemui.Family,
                        ProductRatio = itemui.ProductRatio

                    };
                    using (UnitOfWork uow = new UnitOfWork())
                    {
                        IRepository<ProductUPH> ecoModelRep = new Repository<ProductUPH>("UPHDBServer");
                        ecoModelRep.Insert(items);
                        uow.Commit();
                    }
               
               
               
                }
             catch (Exception e)
                {
                    BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                    throw;
                }
             finally
                {
                    BaseLog.LoggingEnd(logger, methodName);
                }
        
        }
Пример #7
0
        public List<ProductQty> GetProductQty()
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            List<ProductQty> ret = new List<ProductQty>();
            try
            {
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<ProductQty> ecoModelRep = new Repository<ProductQty>("UPHDBServer");//连接字符串 查询ProductUPH 表的数据
                    ret = (from q in ecoModelRep.Query()
                           select q).OrderBy(x => x.ShipDate).ToList();
                }

                return ret;

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        }
Пример #8
0
        public List<Efficiency_Process_Hour> GetEfficiency_Process_Hour(string Process, DateTime begin, DateTime end)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            List<Efficiency_Process_Hour> ret = new List<Efficiency_Process_Hour>();
            try
            {
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<Efficiency_Process_Hour> ecoModelRep = new Repository<Efficiency_Process_Hour>("UPHDBServer");//连接字符串 查询ProductUPH 表的数据
                    ret = (from q in ecoModelRep.Query()
                           where Convert.ToDateTime(q.Dt + " " + q.Hour.Trim().PadLeft(2, '0') + ":00") >= begin && Convert.ToDateTime(q.Dt + " " + q.Hour.Trim().PadLeft(2, '0') + ":00") <= end
                                  &&   q.Process == Process
                           select q).OrderBy(x=>x.Dt).ThenBy(y=>Convert.ToInt32(y.Hour)).ToList();
                }

                return ret;

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        }
Пример #9
0
        public List<Efficiency_Day> GetEfficiency_Day(string line, string Process, DateTime begin, DateTime end)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            List<Efficiency_Day> ret = new List<Efficiency_Day>();
            try
            {
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<Efficiency_Day> ecoModelRep = new Repository<Efficiency_Day>("UPHDBServer");//连接字符串 查询ProductUPH 表的数据
                    ret = (from q in ecoModelRep.Query()
                           where Convert.ToDateTime(q.Dt) >= begin && Convert.ToDateTime(q.Dt) <= end
                                  && q.PdLine == line && q.Process == Process
                           select q).OrderBy(x=>x.Dt).ToList();
                }

                return ret;

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        }
Пример #10
0
        public void DelProductUPHInfo(UPHInfo itemui)
        {

            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            try
            {
                Entity.Repository.Meta.IMESSKU.UPH items = new Entity.Repository.Meta.IMESSKU.UPH
                {
                    Process = itemui.Process,
                    Family = itemui.Family,
                    Special = itemui.Remark,


                };


                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<Entity.Repository.Meta.IMESSKU.UPH> ecoModelRep = new Repository<Entity.Repository.Meta.IMESSKU.UPH>("UPHDBServer");
                    var ret = from q in ecoModelRep.Query()
                              where q.Process == itemui.Process
                          && q.Family == itemui.Family
                          && q.Special == itemui.Special
                              select new UPHInfo
                              {
                                  ID = q.ID,
                                  Process = q.Process,
                                  Attend_normal = q.Attend_normal,
                                  Family = q.Family,
                                  ST = q.ST.ToString(),
                                  NormalUPH = q.NormalUPH,
                                  Cycle = q.Cycle.ToString(),
                                  Remark = q.Remark,
                                  Special = q.Special,
                                  Editor = q.Editor,
                                  Cdt = q.Cdt,
                                  Udt = q.Udt
                              };
                    var first = ret.First();
                    items.ID = first.ID;
                    items.Process = first.Process;
                    items.Attend_normal = first.Attend_normal;
                    items.ST = first.ST;
                    items.NormalUPH = first.NormalUPH;
                    items.Cycle = first.Cycle;
                    items.Remark = first.Remark;
                    items.Special = first.Special;
                    items.Editor = first.Editor;
                    items.Cdt = first.Cdt;
                    items.Udt = first.Udt;


                    //IRepository<Entity.Repository.Meta.IMESSKU.UPH> ecoModelRep = new Repository<Entity.Repository.Meta.IMESSKU.UPH>("UPHDBServer");
                    ecoModelRep.Delete(items, true);//删掉记录 根据设置的条件

                    uow.Commit();
                }

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        }
Пример #11
0
        public IList<UPHInfo> GetProductUPHInfoList(UPHInfo item)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            IList<UPHInfo> ret = new List<UPHInfo>();
            try
            {
                using (UnitOfWork uow = new UnitOfWork())
                {
                    IRepository<Entity.Repository.Meta.IMESSKU.UPH> ecoModelRep = new Repository<Entity.Repository.Meta.IMESSKU.UPH>("UPHDBServer");//连接字符串 查询ProductUPH 表的数据
                    ret = (from q in ecoModelRep.Query()
                           where q.Process == item.Process
                           && q.Family == item.Family
                           && q.Special == item.Special
                           select new UPHInfo
                           {
                               Process = q.Process,
                               Attend_normal = q.Attend_normal,
                               Family = q.Family,
                               ST = q.ST.ToString(),
                               NormalUPH = q.NormalUPH,
                               Cycle = q.Cycle.ToString(),
                               Remark = q.Remark,
                               Special = q.Special,
                               Editor = q.Editor,
                               Cdt = q.Cdt,
                               Udt = q.Udt
                           }).ToList();
                }

                return ret;

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }

        }
Пример #12
0
        public void UpdateProductUPHInfo(UPHInfo itemui)
        {
            string methodName = MethodBase.GetCurrentMethod().Name;
            BaseLog.LoggingBegin(logger, methodName);
            try
            {
                IRepository<Entity.Repository.Meta.IMESSKU.UPH> ecoModelRep = new Repository<Entity.Repository.Meta.IMESSKU.UPH>("UPHDBServer");

                var ret = from q in ecoModelRep.Query()
                          where q.Process == itemui.Process
                      && q.Family == itemui.Family
                      && q.Special == itemui.Special
                          select new UPHInfo
                          {
                              ID = q.ID,
                              Process = q.Process,
                              Attend_normal = q.Attend_normal,
                              Family = q.Family,
                              ST = q.ST.ToString(),
                              NormalUPH = q.NormalUPH,
                              Cycle = q.Cycle.ToString(),
                              Remark = q.Remark,
                              Special = q.Remark,
                              Editor = q.Editor,
                              Cdt = q.Cdt,
                              Udt = q.Udt
                          };
                var first = ret.First();

                Entity.Repository.Meta.IMESSKU.UPH items = new Entity.Repository.Meta.IMESSKU.UPH
                {
                    ID = first.ID,
                    Process = itemui.Process,
                    Attend_normal = itemui.Attend_normal,
                    Family = itemui.Family,
                    ST = itemui.ST,
                    NormalUPH = itemui.NormalUPH,
                    Cycle = itemui.Cycle,
                    Remark = itemui.Remark,
                    Special = itemui.Special,
                    Editor = itemui.Editor,
                    Cdt = first.Cdt,
                    Udt = itemui.Udt

                };
                using (UnitOfWork uow = new UnitOfWork())
                {
                    ecoModelRep.Update(items);
                    uow.Commit();
                }

            }
            catch (Exception e)
            {
                BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
                throw;
            }
            finally
            {
                BaseLog.LoggingEnd(logger, methodName);
            }
        }
Пример #13
0
 public void AddDinnerLogInfo(DinnerLogInfo q)
 {
     string methodName = MethodBase.GetCurrentMethod().Name;
     BaseLog.LoggingBegin(logger, methodName);
     try
     {
         DinnerLog items = new DinnerLog
         {
             ID = q.ID,
             Process = q.Process,
             Type = q.Type,
             Class = q.Class,
             PdLine = q.PdLine,
             BeginTime = q.BeginTime,
             EndTime = q.EndTime,
             Remark = q.Remark,
             Editor = q.Editor,
             Cdt = q.Cdt
         };
         using (UnitOfWork uow = new UnitOfWork())
         {
             IRepository<DinnerLog> ecoModelRep = new Repository<DinnerLog>("UPHDBServer");
             ecoModelRep.Insert(items);
             uow.Commit();
         }
     }
     catch (Exception e)
     {
         BaseLog.LoggingError(logger, MethodBase.GetCurrentMethod(), e);
         throw;
     }
     finally
     {
         BaseLog.LoggingEnd(logger, methodName);
     }
 }