Esempio n. 1
0
        public async Task <int> SaveCustomerLocAsync(MstrCustomerLocation customerLocation)
        {
            DynamicParameters para = new DynamicParameters();

            para.Add("AutoId", customerLocation.AutoId);
            para.Add("Name", customerLocation.Name.Trim());
            para.Add("ShortCode", customerLocation.ShortCode.Trim().ToUpper());
            para.Add("Address", customerLocation.Address.Trim());
            para.Add("Email", customerLocation.Email.Trim());
            para.Add("Tel", customerLocation.Tel.Trim());
            para.Add("CustomerId", customerLocation.CustomerId);
            para.Add("UserId", customerLocation.CreateUserId);
            para.Add("@Result", dbType: DbType.Int32, direction: ParameterDirection.Output);

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

            return(para.Get <int>("Result"));
        }
Esempio n. 2
0
        public async Task <ActionResult> SaveCustomerLoc(MstrCustomerLocation customerLoc)
        {
            var result = await _masterRepository.SaveCustomerLocAsync(customerLoc);

            return(Ok(result));
        }