Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        public static bool unFreeze(int id, AmtunFreezeMode mode)
        {
            try
            {
                SqlParameter[] parameters =
                {
                    new SqlParameter("@result",       SqlDbType.Bit),
                    new SqlParameter("@id",           SqlDbType.Int,  4),
                    new SqlParameter("@checktime",    SqlDbType.DateTime),
                    new SqlParameter("@unfreezemode", SqlDbType.TinyInt, 1)
                };
                parameters[0].Direction = ParameterDirection.Output;
                parameters[1].Value     = id;
                parameters[2].Value     = DateTime.Now;
                parameters[3].Value     = (int)mode;

                if (DataBase.ExecuteNonQuery(CommandType.StoredProcedure, "proc_usersAmt_unFreeze", parameters) > 0)
                {
                    return((bool)parameters[0].Value);
                }
                return(false);
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(ex);
                return(false);
            }
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 protected void rptUsers_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     try
     {
         AmtunFreezeMode mode = AmtunFreezeMode.未处理;
         if (e.CommandName == "unfreeze1")
         {
             mode = AmtunFreezeMode.解冻到余额;
         }
         else if (e.CommandName == "unfreeze2")
         {
             mode = AmtunFreezeMode.解冻并扣除;
         }
         if (mode != AmtunFreezeMode.未处理)
         {
             int id = int.Parse(e.CommandArgument.ToString());
             if (viviapi.BLL.Settled.UsersAmtFreeze.unFreeze(id, mode))
             {
                 AlertAndRedirect("操作成功");
                 return;
             }
             else
             {
                 AlertAndRedirect("操作失败");
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         AlertAndRedirect(ex.Message);
     }
 }