Ejemplo n.º 1
0
        public async Task <int> SaveUnitAsync(MstrUnits mstrUnits)
        {
            DynamicParameters para = new DynamicParameters();

            para.Add("AutoId", mstrUnits.AutoId);
            para.Add("Code", mstrUnits.Code.ToUpper().Trim());
            para.Add("Name", mstrUnits.Name.Trim());
            para.Add("UserId", mstrUnits.CreateUserId);
            para.Add("@Result", dbType: DbType.Int32, direction: ParameterDirection.Output);

            var result = await DbConnection.ExecuteAsync("spMstrUnitsSave", para
                                                         , commandType : CommandType.StoredProcedure);

            return(para.Get <int>("Result"));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> saveUnits(MstrUnits units)
        {
            var result = await _masterRepository.SaveUnitAsync(units);

            return(Ok(result));
        }