コード例 #1
0
 public LoaispModel Updateloaisp([FromBody] LoaispModel model)
 {
     if (model.anhloai != null)
     {
         var arrData = model.anhloai.Split(';');
         if (arrData.Length == 3)
         {
             var savePath = $@"assets/images/{arrData[0]}";
             model.anhloai = $"{savePath}";
             SaveFileFromBase64String(savePath, arrData[2]);
         }
     }
     _loaispBusiness.Update(model);
     return(model);
 }
コード例 #2
0
        public bool Update(LoaispModel model)
        {
            string msgError = "";

            try
            {
                var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "sp_loaisp_update",
                                                                              "@maloai", model.maloai,
                                                                              "@anhloai", model.anhloai,
                                                                              "@tenloai", model.tenloai);
                if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError))
                {
                    throw new Exception(Convert.ToString(result) + msgError);
                }
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        public bool Create(LoaispModel model)
        {
            string msgError = "";

            try
            {
                var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "themloaisp",
                                                                              "@MALOAI", model.MALOAI,
                                                                              "@TENLOAI", model.TENLOAI,
                                                                              "@PARENTID", model.PARENTID,
                                                                              "@HINH", model.HINH,
                                                                              "@KEYWORD", model.KEYWORD,
                                                                              "@URL", model.URL);
                if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError))
                {
                    throw new Exception(Convert.ToString(result) + msgError);
                }
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
 public bool Update(LoaispModel model)
 {
     return(_res.Update(model));
 }
コード例 #5
0
 //admin
 public bool Create(LoaispModel model)
 {
     return(_res.Create(model));
 }
コード例 #6
0
 public LoaispModel UpdateLSP([FromBody] LoaispModel model)
 {
     _LoaispBusiness.Create(model);
     return(model);
 }