public async Task <int> SaveCustomerHdAsync(MstrCustomerHeader mstrCustomerHeader) { DynamicParameters para = new DynamicParameters(); para.Add("AutoId", mstrCustomerHeader.AutoId); para.Add("Name", mstrCustomerHeader.Name.Trim()); para.Add("Address", mstrCustomerHeader.Address.Trim()); para.Add("Email", mstrCustomerHeader.Email.Trim()); para.Add("Tel", mstrCustomerHeader.Tel.Trim()); para.Add("LocationId", mstrCustomerHeader.LocationId); para.Add("ShortCode", mstrCustomerHeader.ShortCode.ToUpper().Trim()); para.Add("CustomerID", mstrCustomerHeader.CustomerID); para.Add("City", mstrCustomerHeader.City.Trim()); para.Add("CountryId", mstrCustomerHeader.CountryId); para.Add("CurrencyId", mstrCustomerHeader.CurrencyId); para.Add("VATNo", mstrCustomerHeader.VATNo.Trim()); para.Add("TaxNo", mstrCustomerHeader.TaxNo.Trim()); para.Add("TinNo", mstrCustomerHeader.TinNo.Trim()); para.Add("ZipPostalCode", mstrCustomerHeader.ZipPostalCode.Trim()); para.Add("CreditDays", mstrCustomerHeader.CreditDays); para.Add("UserId", mstrCustomerHeader.CreateUserId); para.Add("@Result", dbType: DbType.Int32, direction: ParameterDirection.Output); var result = await DbConnection.ExecuteAsync("spMstrCustomerHeaderSave", para , commandType : CommandType.StoredProcedure); return(para.Get <int>("Result")); }
public async Task <int> DeactiveCustomerHdAsync(MstrCustomerHeader mstrCustomerHeader) { DynamicParameters para = new DynamicParameters(); para.Add("AutoID", mstrCustomerHeader.AutoId); para.Add("bActive", mstrCustomerHeader.bActive); para.Add("UserId", mstrCustomerHeader.CreateUserId); para.Add("@Result", dbType: DbType.Int32, direction: ParameterDirection.Output); var result = await DbConnection.ExecuteAsync("spMstrCustomerHeaderDeactive", para , commandType : CommandType.StoredProcedure); return(para.Get <int>("Result")); }
public async Task <ActionResult> SaveCustomerHeader(MstrCustomerHeader MstrCustomerHeader) { var result = await _masterRepository.SaveCustomerHdAsync(MstrCustomerHeader); return(Ok(result)); }