public async Task <RegisterVendorResponse> ConfirmRegistration(int vendorId, string password, string passwordSalt) { RegisterVendorResponse registerVendorResponse = new RegisterVendorResponse(); List <SqlParameter> sqlParameters = new List <SqlParameter>() { new SqlParameter("VendorId", vendorId), new SqlParameter("Password", password), new SqlParameter("PasswordSalt", passwordSalt) }; SqlParameter[] outputParameter = { new SqlParameter("IsUserExists", SqlDbType.Bit), new SqlParameter("Success", SqlDbType.Bit) }; var result = _databaseContext.Repository <Task>().ExecuteSp(StoreProcedureSchemas.usp_ConfirmVendorRegistration, sqlParameters.ToArray(), outputParameter); registerVendorResponse.IsUserExists = Convert.ToBoolean(result.OutParam[0].Value); registerVendorResponse.Success = Convert.ToBoolean(result.OutParam[1].Value); registerVendorResponse.Content = result.Data.AsEnumerable().Select(dataRow => new VendorDetails { VendorId = dataRow.Field <int>("VendorId"), VendorName = dataRow.Field <string>("VendorName"), VendorEmail = dataRow.Field <string>("VendorEmail"), Mobile = dataRow.Field <string>("Mobile"), Landline = dataRow.Field <string>("Landline"), }).FirstOrDefault(); return(await Task.FromResult(registerVendorResponse)); }
public async Task <RegisterVendorResponse> RegisterVendor(RegisterVendor registerVenderModel) { RegisterVendorResponse registerVendorResponse = new RegisterVendorResponse(); List <SqlParameter> sqlParameters = new List <SqlParameter>() { new SqlParameter("VendorName", registerVenderModel.VendorName), new SqlParameter("VendorEmail", registerVenderModel.VendorEmail), new SqlParameter("IsBranch", false), new SqlParameter("Mobile", registerVenderModel.VendorMobile), new SqlParameter("Landline", registerVenderModel.VendorLandline), new SqlParameter("AddressLine", registerVenderModel.AddressLine), new SqlParameter("City", registerVenderModel.City), new SqlParameter("State", registerVenderModel.State), new SqlParameter("PinCode", registerVenderModel.PinCode) }; SqlParameter[] outputParameter = { new SqlParameter("IsUserExists", SqlDbType.Bit), new SqlParameter("Success", SqlDbType.Bit), }; var result = _databaseContext.Repository <Task>().ExecuteSp(StoreProcedureSchemas.usp_RegisterVendor, sqlParameters.ToArray(), outputParameter); registerVendorResponse.IsUserExists = Convert.ToBoolean(result.OutParam[0].Value); registerVendorResponse.Success = Convert.ToBoolean(result.OutParam[1].Value); registerVendorResponse.Content = result.Data.AsEnumerable().Select(dataRow => new VendorDetails { VendorId = dataRow.Field <int>("VendorId"), VendorName = dataRow.Field <string>("VendorName"), VendorEmail = dataRow.Field <string>("VendorEmail"), Mobile = dataRow.Field <string>("Mobile"), Landline = dataRow.Field <string>("Landline"), }).FirstOrDefault(); return(await Task.FromResult(registerVendorResponse)); }