Exemplo n.º 1
0
        public void CommitEvent(object key)
        {
            Guid id = new Guid(key.ToString());
            PTPrjInfoZTBService service  = new PTPrjInfoZTBService();
            PTPrjInfoService    service2 = new PTPrjInfoService();
            PTPrjInfoZTB        byId     = service.GetById(id);

            if (byId.PrjState.ToString() == ProjectParameter.WinBid)
            {
                service2.ChangePrjInfo(byId, 5, 1);
            }
        }
Exemplo n.º 2
0
 public static void ClearPTPrjInfo(object o)
 {
     try
     {
         Log4netHelper.Error(new Exception("ClearPTPrjInfo 开始执行"), "ClearPTPrjInfo", "bery");
         BasicConfigService service = new BasicConfigService();
         BasicConfig        byName  = service.GetByName("IsClearPTPrjInfo");
         if (byName == null)
         {
             byName = new BasicConfig {
                 Id        = Guid.NewGuid().ToString(),
                 ParaName  = "IsClearPTPrjInfo",
                 ParaValue = "0",
                 Note      = "是否已经把PT_PrjInfo_ZTB表的数据导入PT_PrjInfo表中"
             };
             service.Add(byName);
         }
         if (byName.ParaValue != "1")
         {
             string cmdText = "SELECT PrjGuid FROM PT_PrjInfo_ZTB WHERE PrjGuid Not IN (SELECT PrjGuid FROM PT_PrjInfo)";
             foreach (DataRow row in SqlHelper.ExecuteQuery(CommandType.Text, cmdText, new SqlParameter[0]).Rows)
             {
                 Guid id = new Guid(row[0].ToString());
                 PTPrjInfoZTBService service2 = new PTPrjInfoZTBService();
                 PTPrjInfoService    service3 = new PTPrjInfoService();
                 PTPrjInfoZTB        byId     = service2.GetById(id);
                 service3.ChangePrjInfo(byId, 2, 1);
             }
             byName.ParaValue = "1";
             service.Update(byName);
         }
     }
     catch (Exception exception)
     {
         Log4netHelper.Error(exception, "ClearPTPrjInfo", "bery");
     }
 }