Пример #1
0
 //
 public bool Update(BidAuction model)
 {
     try
     {
         StringBuilder strSql = new StringBuilder();
         strSql.Append("update T_BidAuction set ");
         strSql.Append("FK_BidId=@FK_BidId,");
         strSql.Append("LiceTranId=@LiceTranId,");
         strSql.Append("SeveralBid=@SeveralBid,");
         strSql.Append("Price=@Price,");
         strSql.Append("AuctionDate=@AuctionDate,");
         strSql.Append("Editor=@Editor,");
         strSql.Append("CreateDate=@CreateDate");
         strSql.Append(" where Id=@Id");
         if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { throw; }
 }
Пример #2
0
        private dynamic GetModels(HttpContext context)
        {
            BidAuction model = new BidAuction();

            try { model.Id = int.Parse(context.Request.QueryString["Id"].ToString()); }
            catch { model.Id = 0; }
            model.FK_BidId    = int.Parse(context.Request.QueryString["FK_BidId"].ToString());
            model.LiceTranId  = int.Parse(context.Request.QueryString["LiceTranId"].ToString());
            model.SeveralBid  = int.Parse(context.Request.QueryString["SeveralBid"].ToString());
            model.Price       = decimal.Parse(context.Request.QueryString["Price"].ToString());
            model.AuctionDate = DateTime.Now;
            model.Editor      = adminUser.AdminName;
            model.CreateDate  = DateTime.Now;
            return(model);
        }
Пример #3
0
 //
 public bool Create(BidAuction model)
 {
     try
     {
         StringBuilder strSql = new StringBuilder();
         strSql.Append("insert into T_BidAuction(");
         strSql.Append("FK_BidId,LiceTranId,SeveralBid,Price,AuctionDate,Editor,CreateDate)");
         strSql.Append(" values (");
         strSql.Append("@FK_BidId,@LiceTranId,@SeveralBid,@Price,@AuctionDate,@Editor,@CreateDate)");
         if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { throw; }
 }
Пример #4
0
 //
 private string Create(HttpContext context)
 {
     try
     {
         SysLogBll.Create("竞价单", "添加竞价单操作", adminUser.AdminName);
         BidAuction mde = GetModels(context);
         if (dal.Create(mde))
         {
             BidTransDal btd = new BidTransDal();
             btd.UpdateState(" TradingStatus = 2 ", string.Format(" FK_BidId={0} ", mde.FK_BidId));
             btd.UpdateState(" TradingStatus = 1 ", string.Format(" FK_BidId={0} and FK_LiceTranId={1} ", mde.FK_BidId, mde.LiceTranId));
             return("交易成功!");
         }
         else
         {
             return("添加失败请重新操作! ");
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord("时间:[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]类名:[" + this.GetType().Name + "],行号:[" + Component.GetLineNum().ToString() + "行],错误信息:[" + ex.Message + "]");
         return("添加失败请重新操作,错误代码:500 ");
     }
 }