Exemplo n.º 1
0
 public bool Update(int?Id, StatusParam statusParam)
 {
     if (Id != null && statusParam != null)
     {
         status = _statusRepository.Update(Id, statusParam);
     }
     return(status);
 }
Exemplo n.º 2
0
 public bool Insert(StatusParam statusParam)
 {
     if (statusParam != null)
     {
         status = _statusRepository.Insert(statusParam);
     }
     return(status);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 上下架商品
 /// </summary>
 /// <param name="id"></param>
 /// <param name="status"></param>
 public void SetSaleStatus(StatusParam param)
 {
     using (var conn = new MySqlConnection(_configuration["ConnectString"]))
     {
         var sql    = $"UPDATE {_productTableName} SET STATUS =@status WHERE ID= @id ";
         var result = conn.Execute(sql, new { status = param.Status, id = param.ID });
         if (result == 0)
         {
             throw new Exception("商品不存在");
         }
     }
 }
Exemplo n.º 4
0
        public bool Update(int?Id, StatusParam statusParam)
        {
            var result = 0;
            var status = Get(Id);

            status.Name       = statusParam.Name;
            status.UpdateDate = DateTimeOffset.UtcNow.LocalDateTime;
            result            = myContext.SaveChanges();
            if (result > 0)
            {
                statusR = true;
            }
            return(statusR);
        }
Exemplo n.º 5
0
        public bool Insert(StatusParam statusParam)
        {
            var result = 0;

            status.Name       = statusParam.Name;
            status.CreateDate = DateTimeOffset.UtcNow.LocalDateTime;
            myContext.Statuses.Add(status);
            result = myContext.SaveChanges();
            if (result > 0)
            {
                statusR = true;
            }
            return(statusR);
        }
Exemplo n.º 6
0
 public void Add(StatusParam status, int comb)
 {
     this.Hp   += (int)status.hp;
     this.Atk  += (int)status.atk;
     this.Def  += (int)status.def;
     this.Matk += (int)status.mag;
     this.Mdef += (int)status.mnd;
     this.Dex  += (int)status.dex;
     this.Spd  += (int)status.spd;
     this.Cri  += (int)status.cri;
     this.Luck += (int)status.luk;
     this.Move += (int)status.mov;
     this.Jmp  += (int)status.jmp;
     this.Cmb  += comb;
 }
Exemplo n.º 7
0
 public bool Deserialize(JSON_UnitJobOverwriteParam json)
 {
     if (json == null)
     {
         return(false);
     }
     this.mUnitIname = json.unit_iname;
     this.mJobIname  = json.job_iname;
     this.mAvoid     = json.avoid;
     this.mInimp     = json.inimp;
     this.status     = new StatusParam();
     this.status.hp  = (OInt)json.hp;
     this.status.mp  = (OShort)json.mp;
     this.status.atk = (OShort)json.atk;
     this.status.def = (OShort)json.def;
     this.status.mag = (OShort)json.mag;
     this.status.mnd = (OShort)json.mnd;
     this.status.dex = (OShort)json.dex;
     this.status.spd = (OShort)json.spd;
     this.status.cri = (OShort)json.cri;
     this.status.luk = (OShort)json.luk;
     return(true);
 }
 // PUT: api/Priorities/5
 public void Put(int id, StatusParam StatusParam)
 {
     _statusService.Update(id, StatusParam);
 }
 // POST: api/Priorities
 public void Post(StatusParam StatusParam)
 {
     _statusService.Insert(StatusParam);
 }