Ejemplo n.º 1
0
        public IActionResult Add(AddOpticalDiscViewModel opticalDisc)
        {
            OpticalDiscBusiness opticalDiscBusiness = new OpticalDiscBusiness();
            var result = opticalDiscBusiness.AddOpticalDisc(opticalDisc);

            return(Ok(result));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Add(AddOpticalDiscViewModel opticalDisc)
        {
            opticalDisc.CreatedBy = _userSessionHelper.GetUserSession().UserName;
            string apiUrl = _appUrlHelper.GetApiUrl(ApiUrlPath.OPTICAL_DISC_ADD);
            var    result = await HttpUtilities.PostAsyncApi <ReturnResult <OpticalDisc> >(apiUrl, JsonConvert.SerializeObject(opticalDisc));

            return(Json(result));
        }
Ejemplo n.º 3
0
        public ReturnResult <OpticalDisc> Add(AddOpticalDiscViewModel opticalDisc)
        {
            DbProvider dbProvider = new DbProvider();
            string     outCode    = String.Empty;
            string     outMessage = String.Empty;
            StoredProcedureConfigs <OpticalDisc> storedProcedureConfigs = new StoredProcedureConfigs <OpticalDisc>();

            dbProvider.SetQuery(storedProcedureConfigs._INSERT_SINGLE_STORED_PROCEDURE, CommandType.StoredProcedure)
            .SetParameter("Name", SqlDbType.NVarChar, opticalDisc.Name, ParameterDirection.Input)
            .SetParameter("Status", SqlDbType.Int, opticalDisc.Status, ParameterDirection.Input)
            .SetParameter("CreatedBy", SqlDbType.NVarChar, opticalDisc.CreatedBy, ParameterDirection.Input)
            .SetParameter("ERROR_CODE", SqlDbType.NVarChar, DBNull.Value, 100, ParameterDirection.Output)
            .SetParameter("ERROR_MESSAGE", SqlDbType.NVarChar, DBNull.Value, 400, ParameterDirection.Output)
            .ExcuteNonQuery()
            .Complete();
            dbProvider.GetOutValue("ERROR_CODE", out outCode)
            .GetOutValue("ERROR_MESSAGE", out outMessage);
            return(new ReturnResult <OpticalDisc>()
            {
                ErrorCode = outCode,
                ErrorMessage = outMessage,
            });
        }
 public ReturnResult <OpticalDisc> AddOpticalDisc(AddOpticalDiscViewModel opticalDisc)
 {
     return(OpticalDiscDAL.Add(opticalDisc));
 }