Пример #1
0
 //
 public bool Update(Arbitration model)
 {
     try
     {
         StringBuilder strSql = new StringBuilder();
         strSql.Append("update T_Arbitration set ");
         strSql.Append("FK_BidId=@FK_BidId,");
         strSql.Append("FK_LiceId=@FK_LiceId,");
         strSql.Append("FK_TranId=@FK_TranId,");
         strSql.Append("Fact=@Fact,");
         strSql.Append("Grounds=@Grounds,");
         strSql.Append("Results=@Results,");
         strSql.Append("AcceptName=@AcceptName,");
         strSql.Append("AcceptDate=@AcceptDate");
         strSql.Append(" where Id=@Id");
         if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { throw; }
 }
Пример #2
0
        public static string ToString(Arbitration ar)
        {
            var sb   = new StringBuilder();
            var time = (ar.expiry - DateTime.Now).Humanize(int.MaxValue, CultureInfo.GetCultureInfo("zh-CN"), TimeUnit.Day, TimeUnit.Minute, " ");

            sb.AppendLine($"[{ar.node}] {time} 后过期");
            sb.AppendLine($"-类型:    {ar.type}-{ar.enemy}");
            return(sb.ToString().Trim());
        }
Пример #3
0
 public void TranslateArbitrationMission(Arbitration ar)
 {
     ar.activation = GetRealTime(ar.activation);
     ar.expiry     = GetRealTime(ar.expiry);
     ar.node       = TranslateNode(ar.node);
     // // trick
     // 不需要trick了
     ar.type = dictTranslator.Translate(ar.type);
 }
Пример #4
0
        public void ProcessArbitration(NotificationState state, Arbitration arbi)
        {
            var sendFCM = ProcessSingleExpirable(state, arbi, arbi.StatType);

            if (sendFCM)
            {
                var ttl     = arbi.TimeLeft;
                var message = FCM.CreateMessage($"Arbitration: {arbi.Enemy} {arbi.Type}", $"Expired in {ttl.ToFormattedString()}", platform, YawsNotification.Topic.Arbitration, nameof(Arbitration), ttl);
                NotificationMessages.Add(message);
            }
        }
Пример #5
0
 //
 public bool Create(Arbitration model)
 {
     try
     {
         StringBuilder strSql = new StringBuilder();
         strSql.Append("insert into T_Arbitration(");
         strSql.Append("FK_BidId,FK_LiceId,FK_TranId,Fact,Grounds,Results,AcceptName,AcceptDate,OrgCode)");
         strSql.Append(" values (");
         strSql.Append("@FK_BidId,@FK_LiceId,@FK_TranId,@Fact,@Grounds,@Results,@AcceptName,@AcceptDate,@OrgCode)");
         if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { throw; }
 }
Пример #6
0
        private dynamic GetModels(HttpContext context)
        {
            dynamic model = new Arbitration();

            try { model.FK_BidId = int.Parse(context.Request.Form["FK_BidId"].ToString()); }
            catch { }
            try { model.FK_LiceId = int.Parse(context.Request.Form["FK_LiceId"].ToString()); }
            catch { }
            try { model.FK_TranId = int.Parse(context.Request.Form["FK_TranId"].ToString()); }
            catch { }
            model.Fact       = context.Request.Form["Fact"].ToString();
            model.Grounds    = context.Request.Form["Grounds"].ToString();
            model.Results    = context.Request.Form["Results"].ToString();
            model.AcceptName = adminUser.AdminName;
            model.AcceptDate = DateTime.Now;
            model.OrgCode    = adminUser.OrgCode;
            try { model.Id = int.Parse(context.Request.Form["Id"].ToString()); }
            catch { model.Id = 0; }
            return(model);
        }
Пример #7
0
 //
 public dynamic GetModel(int Id)
 {
     try
     {
         dynamic       model  = null;
         StringBuilder strSql = new StringBuilder();
         strSql.Append("select top 1 Id,FK_BidId,FK_LiceId,FK_TranId,Fact,Grounds,Results,OrgCode,AcceptName,AcceptDate from T_Arbitration ");
         strSql.Append(" where Id=@Id");
         SqlParameter[] parameters =
         {
             new SqlParameter("@Id", SqlDbType.Int, 4)
         };
         parameters[0].Value = Id;
         using (dynamic read = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters))
         {
             if (read.Read())
             {
                 model = new Arbitration();
                 try { model.Id = int.Parse(read["Id"].ToString()); }
                 catch { }
                 try { model.FK_BidId = int.Parse(read["FK_BidId"].ToString()); }
                 catch { }
                 try { model.FK_LiceId = int.Parse(read["FK_LiceId"].ToString()); }
                 catch { }
                 try { model.FK_TranId = int.Parse(read["FK_TranId"].ToString()); }
                 catch { }
                 model.Fact       = read["Fact"].ToString();
                 model.Grounds    = read["Grounds"].ToString();
                 model.Results    = read["Results"].ToString();
                 model.AcceptName = read["AcceptName"].ToString();
                 model.OrgCode    = read["OrgCode"].ToString();
                 try { model.AcceptDate = DateTime.Parse(read["AcceptDate"].ToString()); }
                 catch { }
             }
             read.Dispose();
         }
         return(model);
     }
     catch { throw; }
 }