コード例 #1
0
ファイル: UPH_Family.cs プロジェクト: wra222/testgit
        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
ファイル: AlarmMaintain.cs プロジェクト: wra222/testgit
        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);
            }
        }
コード例 #3
0
ファイル: AlarmMaintain.cs プロジェクト: wra222/testgit
        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);
            }
        }
コード例 #4
0
ファイル: UPH.cs プロジェクト: wra222/testgit
        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);
                }
        
        }
コード例 #5
0
ファイル: UPH_Family.cs プロジェクト: wra222/testgit
        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);
            }
        }
コード例 #6
0
ファイル: UPH_Family.cs プロジェクト: wra222/testgit
        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);
            }
        }
コード例 #7
0
ファイル: Dinner.cs プロジェクト: wra222/testgit
 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);
     }
 }