public static void UpdateStewardshipInfo(OrganizationInfo objOrg, ContactInfo objPrimaryContact, Phones objPrimaryContactBusinessPhone, Phones objPrimaryContactCellPhone, ContactInfo objBillingContact, Phones objBillingContactBusinessPhone, Phones objBillingContactCellPhone, Organization_Address objBusinessOrganization_Address, Organization_Address objMailingOrganization_Address) { try { using (DbManager DB = DbManager.GetDbManager()) { List<SqlParameter> prm = new List<SqlParameter>(); #region Organization Info if (objOrg.OrganizationId > 0) prm.Add(DB.MakeInParam("@OrganizationId", SqlDbType.Int, 4, objOrg.OrganizationId)); else prm.Add(DB.MakeInParam("@OrganizationId", SqlDbType.Int, 4, DBNull.Value)); prm.Add(DB.MakeInParam("@LegalName", SqlDbType.NVarChar, 255, objOrg.LegalName)); prm.Add(DB.MakeInParam("@DBAName", SqlDbType.NVarChar, 255, objOrg.DBAName)); // prm.Add(DB.MakeInParam("@OrganizationTypeId", SqlDbType.Int, 4, objOrg.OrganizationTypeId)); prm.Add(DB.MakeInParam("@Website", SqlDbType.NVarChar, 255, objOrg.Website)); prm.Add(DB.MakeInParam("@OrgIsActive", SqlDbType.Bit, 1, objOrg.IsActive)); //prm.Add(DB.MakeInParam("@AcceptTextMessage", SqlDbType.Bit, 1, objOrg.AcceptTextMessages)); //prm.Add(DB.MakeInParam("@CellAcceptTextMessages", SqlDbType.Bit, 1, objOrg.CellAcceptTextMessages)); prm.Add(DB.MakeInParam("@OrgLanguageId", SqlDbType.Int, 4, objOrg.LanguageId)); // prm.Add(DB.MakeInParam("@RoleId", SqlDbType.Int, 4, objOrg.RoleId)); #endregion #region Primary Contact Info // prm.Add(DB.MakeInParam("@PrimaryContactTypeId", SqlDbType.Int, 4, objPrimaryContact.ContactTypeId)); prm.Add(DB.MakeInParam("@PrimaryContactFirstName", SqlDbType.NVarChar, 255, objPrimaryContact.FirstName)); prm.Add(DB.MakeInParam("@PrimaryContactLastName", SqlDbType.NVarChar, 255, objPrimaryContact.LastName)); // prm.Add(DB.MakeInParam("@PrimaryContactTitleId", SqlDbType.Int, 4, objPrimaryContact.ContactTitleId)); prm.Add(DB.MakeInParam("@PrimaryContactEmail", SqlDbType.NVarChar, 200, objPrimaryContact.Email)); prm.Add(DB.MakeInParam("@PrimaryContactIsActive", SqlDbType.Bit, 1, objPrimaryContact.IsActive)); prm.Add(DB.MakeInParam("@PrimaryContactIsPrimary", SqlDbType.Bit, 1, objPrimaryContact.IsPrimary)); // prm.Add(DB.MakeInParam("@PrimaryContactLanguageId", SqlDbType.Int, 4, objPrimaryContact.LanguageId)); #endregion #region Primary Contact Business Phone Info prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneNumber", SqlDbType.NVarChar, 15, objPrimaryContactBusinessPhone.Number)); prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneExtension", SqlDbType.NVarChar, 7, objPrimaryContactBusinessPhone.Extension)); // prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneTypeId", SqlDbType.Int, 4, objPrimaryContactBusinessPhone.PhoneTypeId)); prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneIsActive", SqlDbType.Bit, 1, objPrimaryContactBusinessPhone.IsActive)); #endregion //#region Primary Contact Cell Phone Info //prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneNumber", SqlDbType.NVarChar, 15, objPrimaryContactCellPhone.Number)); //prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneIsAcceptTextMessages", SqlDbType.Bit, 1, objPrimaryContactCellPhone.IsAcceptTextMessages)); //prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneTypeId", SqlDbType.Int, 4, objPrimaryContactCellPhone.PhoneTypeId)); //prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneIsActive", SqlDbType.Bit, 1, objPrimaryContactCellPhone.IsActive)); //#endregion //#region Billing Contact Info //prm.Add(DB.MakeInParam("@BillingContactTypeId", SqlDbType.Int, 4, objBillingContact.ContactTypeId)); //prm.Add(DB.MakeInParam("@BillingContactFirstName", SqlDbType.NVarChar, 255, objBillingContact.FirstName)); //prm.Add(DB.MakeInParam("@BillingContactLastName", SqlDbType.NVarChar, 255, objBillingContact.LastName)); //prm.Add(DB.MakeInParam("@BillingContactTitleId", SqlDbType.Int, 4, objBillingContact.ContactTitleId)); //prm.Add(DB.MakeInParam("@BillingContactEmail", SqlDbType.NVarChar, 200, objBillingContact.Email)); //prm.Add(DB.MakeInParam("@BillingContactIsActive", SqlDbType.Bit, 1, objBillingContact.IsActive)); //prm.Add(DB.MakeInParam("@BillingContactIsPrimary", SqlDbType.Bit, 1, objBillingContact.IsPrimary)); //prm.Add(DB.MakeInParam("@BillingContactLanguageId", SqlDbType.Int, 4, objBillingContact.LanguageId)); //#endregion //#region Billing Contact Business Phone Info //prm.Add(DB.MakeInParam("@BillingContactBusinessPhoneNumber", SqlDbType.NVarChar, 15, objBillingContactBusinessPhone.Number)); //prm.Add(DB.MakeInParam("@BillingContactBusinessPhoneExtension", SqlDbType.NVarChar, 7, objBillingContactBusinessPhone.Extension)); //prm.Add(DB.MakeInParam("@BillingContactBusinessPhoneTypeId", SqlDbType.Int, 4, objBillingContactBusinessPhone.PhoneTypeId)); //prm.Add(DB.MakeInParam("@BillingContactBusinessPhoneIsActive", SqlDbType.Bit, 1, objBillingContactBusinessPhone.IsActive)); //#endregion //#region Billing Contact Cell Phone Info //prm.Add(DB.MakeInParam("@BillingContactCellPhoneNumber", SqlDbType.NVarChar, 15, objBillingContactCellPhone.Number)); //prm.Add(DB.MakeInParam("@BillingContactCellPhoneIsAcceptTextMessages", SqlDbType.Bit, 1, objBillingContactCellPhone.IsAcceptTextMessages)); //prm.Add(DB.MakeInParam("@BillingContactCellPhoneTypeId", SqlDbType.Int, 4, objBillingContactCellPhone.PhoneTypeId)); //prm.Add(DB.MakeInParam("@BillingContactCellPhoneIsActive", SqlDbType.Bit, 1, objBillingContactCellPhone.IsActive)); //#endregion #region Business Organization Address Info prm.Add(DB.MakeInParam("@BusinessOrganization_AddressZipCodeId", SqlDbType.Int, 4, objBusinessOrganization_Address.ZipCodeID)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressZipCode", SqlDbType.NVarChar, 100, objBusinessOrganization_Address.ZipPostalCode)); prm.Add(DB.MakeInParam("@BusinessOrganizationAddress1", SqlDbType.NVarChar, 250, objBusinessOrganization_Address.Address1)); prm.Add(DB.MakeInParam("@BusinessOrganizationAddress2", SqlDbType.NVarChar, 250, objBusinessOrganization_Address.Address2)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressCity", SqlDbType.NVarChar, 100, objBusinessOrganization_Address.City)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressStateId", SqlDbType.Int, 4, objBusinessOrganization_Address.StateID)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressCountryID", SqlDbType.Int, 4, objBusinessOrganization_Address.CountryID)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressIsActive", SqlDbType.Bit, 1, objBusinessOrganization_Address.IsActive)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressDateCreated", SqlDbType.DateTime, 8, objBusinessOrganization_Address.DateCreated)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressTypeId", SqlDbType.Int, 4, objBusinessOrganization_Address.Organization_AddressTypeId)); #endregion //#region Mailing Organization Address Info //prm.Add(DB.MakeInParam("@MailingOrganization_AddressZipCodeId", SqlDbType.Int, 4, objMailingOrganization_Address.ZipCodeID)); //prm.Add(DB.MakeInParam("@MailingOrganization_AddressZipCode", SqlDbType.NVarChar, 100, objMailingOrganization_Address.ZipPostalCode)); //prm.Add(DB.MakeInParam("@MailingOrganizationAddress1", SqlDbType.NVarChar, 250, objMailingOrganization_Address.Address1)); //prm.Add(DB.MakeInParam("@MailingOrganizationAddress2", SqlDbType.NVarChar, 250, objMailingOrganization_Address.Address2)); //prm.Add(DB.MakeInParam("@MailingOrganization_AddressCity", SqlDbType.NVarChar, 100, objMailingOrganization_Address.City)); //prm.Add(DB.MakeInParam("@MailingOrganization_AddressStateId", SqlDbType.Int, 4, objMailingOrganization_Address.StateID)); //prm.Add(DB.MakeInParam("@MailingOrganization_AddressCountryID", SqlDbType.Int, 4, objMailingOrganization_Address.CountryID)); //prm.Add(DB.MakeInParam("@MailingOrganization_AddressIsActive", SqlDbType.Bit, 1, objMailingOrganization_Address.IsActive)); //prm.Add(DB.MakeInParam("@MailingOrganization_AddressDateCreated", SqlDbType.DateTime, 8, objMailingOrganization_Address.DateCreated)); //prm.Add(DB.MakeInParam("@MailingOrganization_AddressTypeId", SqlDbType.Int, 4, objMailingOrganization_Address.Organization_AddressTypeId)); //#endregion objOrg.OrganizationId = DB.RunProc("up_updateStewardshipByOrgId", prm.ToArray()); } } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "OrganizationInfo.UpdateStewardshipInfo", ex); } }
public static void SavePrimaryInfo(OrganizationInfo objOrg, ContactInfo objPrimaryContact, Phones objPrimaryContactBusinessPhone, Phones objPrimaryContactCellPhone, ContactInfo objBillingContact, Phones objBillingContactBusinessPhone, Phones objBillingContactCellPhone, Organization_Address objBusinessOrganization_Address, Organization_Address objMailingOrganization_Address, string catIds) { try { using (DbManager DB = DbManager.GetDbManager()) { List<SqlParameter> prm = new List<SqlParameter>(); #region Organization Info if (objOrg.OrganizationId > 0) prm.Add(DB.MakeInParam("@OrganizationId", SqlDbType.Int, 4, objOrg.OrganizationId)); else prm.Add(DB.MakeInParam("@OrganizationId", SqlDbType.Int, 4, DBNull.Value)); prm.Add(DB.MakeInParam("@LegalName", SqlDbType.NVarChar, 255, objOrg.LegalName)); prm.Add(DB.MakeInParam("@DBAName", SqlDbType.NVarChar, 255, objOrg.DBAName)); prm.Add(DB.MakeInParam("@OrganizationTypeId", SqlDbType.Int, 4, objOrg.OrganizationTypeId)); prm.Add(DB.MakeInParam("@OrganizationSubTypeId", SqlDbType.Int, 0, objOrg.OrganizationSubTypeID)); prm.Add(DB.MakeInParam("@Website", SqlDbType.NVarChar, 255, objOrg.Website)); prm.Add(DB.MakeInParam("@AccountingInterfaceId", SqlDbType.Int, 4, objOrg.AccountingInterfaceId)); prm.Add(DB.MakeInParam("@InventoryInterfaceId", SqlDbType.Int, 4, objOrg.InventoryInterfaceId)); prm.Add(DB.MakeInParam("@IsAutoFundTransfer", SqlDbType.Bit, 1, objOrg.IsAutoFundTransfer)); prm.Add(DB.MakeInParam("@OrgIsActive", SqlDbType.Bit, 1, objOrg.IsActive)); prm.Add(DB.MakeInParam("@OrgLanguageId", SqlDbType.Int, 4, objOrg.LanguageId)); prm.Add(DB.MakeInParam("@RoleId", SqlDbType.Int, 4, objOrg.RoleId)); #endregion #region Primary Contact Info prm.Add(DB.MakeInParam("@PrimaryContactTypeId", SqlDbType.Int, 4, objPrimaryContact.ContactTypeId)); prm.Add(DB.MakeInParam("@PrimaryContactFirstName", SqlDbType.NVarChar, 255, objPrimaryContact.FirstName)); prm.Add(DB.MakeInParam("@PrimaryContactLastName", SqlDbType.NVarChar, 255, objPrimaryContact.LastName)); prm.Add(DB.MakeInParam("@PrimaryContactTitleId", SqlDbType.Int, 4, objPrimaryContact.ContactTitleId)); prm.Add(DB.MakeInParam("@PrimaryContactEmail", SqlDbType.NVarChar, 200, objPrimaryContact.Email)); prm.Add(DB.MakeInParam("@PrimaryContactIsActive", SqlDbType.Bit, 1, objPrimaryContact.IsActive)); prm.Add(DB.MakeInParam("@PrimaryContactIsPrimary", SqlDbType.Bit, 1, objPrimaryContact.IsPrimary)); prm.Add(DB.MakeInParam("@PrimaryContactLanguageId", SqlDbType.Int, 4, objPrimaryContact.LanguageId)); #endregion #region Primary Contact Business Phone Info prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneNumber", SqlDbType.NVarChar, 15, objPrimaryContactBusinessPhone.Number)); prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneExtension", SqlDbType.NVarChar, 7, objPrimaryContactBusinessPhone.Extension)); prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneTypeId", SqlDbType.Int, 4, objPrimaryContactBusinessPhone.PhoneTypeId)); prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneIsActive", SqlDbType.Bit, 1, objPrimaryContactBusinessPhone.IsActive)); #endregion #region Primary Contact Cell Phone Info prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneNumber", SqlDbType.NVarChar, 15, objPrimaryContactCellPhone.Number)); prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneIsAcceptTextMessages", SqlDbType.Bit, 1, objPrimaryContactCellPhone.IsAcceptTextMessages)); prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneTypeId", SqlDbType.Int, 4, objPrimaryContactCellPhone.PhoneTypeId)); prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneIsActive", SqlDbType.Bit, 1, objPrimaryContactCellPhone.IsActive)); #endregion #region Billing Contact Info prm.Add(DB.MakeInParam("@BillingContactTypeId", SqlDbType.Int, 4, objBillingContact.ContactTypeId)); prm.Add(DB.MakeInParam("@BillingContactFirstName", SqlDbType.NVarChar, 255, objBillingContact.FirstName)); prm.Add(DB.MakeInParam("@BillingContactLastName", SqlDbType.NVarChar, 255, objBillingContact.LastName)); prm.Add(DB.MakeInParam("@BillingContactTitleId", SqlDbType.Int, 4, objBillingContact.ContactTitleId)); prm.Add(DB.MakeInParam("@BillingContactEmail", SqlDbType.NVarChar, 200, objBillingContact.Email)); prm.Add(DB.MakeInParam("@BillingContactIsActive", SqlDbType.Bit, 1, objBillingContact.IsActive)); prm.Add(DB.MakeInParam("@BillingContactIsPrimary", SqlDbType.Bit, 1, objBillingContact.IsPrimary)); prm.Add(DB.MakeInParam("@BillingContactLanguageId", SqlDbType.Int, 4, objBillingContact.LanguageId)); #endregion #region Billing Contact Business Phone Info prm.Add(DB.MakeInParam("@BillingContactBusinessPhoneNumber", SqlDbType.NVarChar, 15, objBillingContactBusinessPhone.Number)); prm.Add(DB.MakeInParam("@BillingContactBusinessPhoneExtension", SqlDbType.NVarChar, 7, objBillingContactBusinessPhone.Extension)); prm.Add(DB.MakeInParam("@BillingContactBusinessPhoneTypeId", SqlDbType.Int, 4, objBillingContactBusinessPhone.PhoneTypeId)); prm.Add(DB.MakeInParam("@BillingContactBusinessPhoneIsActive", SqlDbType.Bit, 1, objBillingContactBusinessPhone.IsActive)); #endregion #region Billing Contact Cell Phone Info prm.Add(DB.MakeInParam("@BillingContactCellPhoneNumber", SqlDbType.NVarChar, 15, objBillingContactCellPhone.Number)); prm.Add(DB.MakeInParam("@BillingContactCellPhoneIsAcceptTextMessages", SqlDbType.Bit, 1, objBillingContactCellPhone.IsAcceptTextMessages)); prm.Add(DB.MakeInParam("@BillingContactCellPhoneTypeId", SqlDbType.Int, 4, objBillingContactCellPhone.PhoneTypeId)); prm.Add(DB.MakeInParam("@BillingContactCellPhoneIsActive", SqlDbType.Bit, 1, objBillingContactCellPhone.IsActive)); #endregion #region Business Organization Address Info prm.Add(DB.MakeInParam("@BusinessOrganization_AddressZipCodeId", SqlDbType.Int, 4, objBusinessOrganization_Address.ZipCodeID)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressZipCode", SqlDbType.NVarChar, 100, objBusinessOrganization_Address.ZipPostalCode)); prm.Add(DB.MakeInParam("@BusinessOrganizationAddress1", SqlDbType.NVarChar, 250, objBusinessOrganization_Address.Address1)); prm.Add(DB.MakeInParam("@BusinessOrganizationAddress2", SqlDbType.NVarChar, 250, objBusinessOrganization_Address.Address2)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressCity", SqlDbType.NVarChar, 100, objBusinessOrganization_Address.City)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressStateId", SqlDbType.Int, 4, objBusinessOrganization_Address.StateID)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressCountryID", SqlDbType.Int, 4, objBusinessOrganization_Address.CountryID)); prm.Add(DB.MakeInParam("@BusinessOrganization_CityId", SqlDbType.BigInt, 10, objBusinessOrganization_Address.CityId)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressIsActive", SqlDbType.Bit, 1, objBusinessOrganization_Address.IsActive)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressDateCreated", SqlDbType.DateTime, 8, objBusinessOrganization_Address.DateCreated)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressTypeId", SqlDbType.Int, 4, objBusinessOrganization_Address.Organization_AddressTypeId)); #endregion #region Mailing Organization Address Info prm.Add(DB.MakeInParam("@MailingOrganization_AddressZipCodeId", SqlDbType.Int, 4, objMailingOrganization_Address.ZipCodeID)); prm.Add(DB.MakeInParam("@MailingOrganization_AddressZipCode", SqlDbType.NVarChar, 100, objMailingOrganization_Address.ZipPostalCode)); prm.Add(DB.MakeInParam("@MailingOrganizationAddress1", SqlDbType.NVarChar, 250, objMailingOrganization_Address.Address1)); prm.Add(DB.MakeInParam("@MailingOrganizationAddress2", SqlDbType.NVarChar, 250, objMailingOrganization_Address.Address2)); prm.Add(DB.MakeInParam("@MailingOrganization_AddressCity", SqlDbType.NVarChar, 100, objMailingOrganization_Address.City)); prm.Add(DB.MakeInParam("@MailingOrganization_CityId", SqlDbType.BigInt, 10, objMailingOrganization_Address.CityId)); prm.Add(DB.MakeInParam("@MailingOrganization_AddressStateId", SqlDbType.Int, 4, objMailingOrganization_Address.StateID)); prm.Add(DB.MakeInParam("@MailingOrganization_AddressCountryID", SqlDbType.Int, 4, objMailingOrganization_Address.CountryID)); prm.Add(DB.MakeInParam("@MailingOrganization_AddressIsActive", SqlDbType.Bit, 1, objMailingOrganization_Address.IsActive)); prm.Add(DB.MakeInParam("@MailingOrganization_AddressDateCreated", SqlDbType.DateTime, 8, objMailingOrganization_Address.DateCreated)); prm.Add(DB.MakeInParam("@MailingOrganization_AddressTypeId", SqlDbType.Int, 4, objMailingOrganization_Address.Organization_AddressTypeId)); #endregion //For making application generalized prm.Add(DB.MakeInParam("@CategoryIds", SqlDbType.VarChar, 50, catIds)); objOrg.OrganizationId = DB.RunProc("up_OrganizationInsertUpdatePrimaryInfo", prm.ToArray()); } } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "OrganizationInfo.SaveBasicInfo", ex); } }
public static void SaveAdditionalLocationInfo(OrganizationInfo objOrg, ContactInfo objPrimaryContact, Phones objPrimaryContactBusinessPhone, Phones objPrimaryContactCellPhone, OrganizationInfo.Organization_Address objBusinessOrganization_Address) { try { using (DbManager DB = DbManager.GetDbManager()) { List<SqlParameter> prm = new List<SqlParameter>(); #region Organization Info prm.Add(DB.MakeInParam("@LegalName", SqlDbType.NVarChar, 255, objOrg.LegalName)); prm.Add(DB.MakeInParam("@DBAName", SqlDbType.NVarChar, 255, objOrg.DBAName)); prm.Add(DB.MakeInParam("@IsLocationEventPermanent", SqlDbType.Bit, 1, objOrg.IsLocationEventPermanent)); if (objOrg.IsLocationEventPermanent == false) { prm.Add(DB.MakeInParam("@LocationEventStartDate", SqlDbType.DateTime, 8, objOrg.LocationEventStartDate)); prm.Add(DB.MakeInParam("@LocationEventEndDate", SqlDbType.DateTime, 8, objOrg.LocationEventEndDate)); prm.Add(DB.MakeInParam("@LocationEventTypeId", SqlDbType.Int, 4, objOrg.LocationEventTypeId)); } else { prm.Add(DB.MakeInParam("@LocationEventStartDate", SqlDbType.DateTime, 8, DBNull.Value)); prm.Add(DB.MakeInParam("@LocationEventEndDate", SqlDbType.DateTime, 8, DBNull.Value)); prm.Add(DB.MakeInParam("@LocationEventTypeId", SqlDbType.Int, 4, DBNull.Value)); } prm.Add(DB.MakeInParam("@LocationPermitNumber", SqlDbType.NVarChar, 255, objOrg.LocationPermitNumber)); prm.Add(DB.MakeInParam("@OrgIsActive", SqlDbType.Bit, 1, objOrg.IsActive)); prm.Add(DB.MakeInParam("@OrgLanguageId", SqlDbType.Int, 4, objOrg.LanguageId)); prm.Add(DB.MakeInParam("@ParentId", SqlDbType.Int, 4, objOrg.ParentId)); #endregion #region Primary Contact Info prm.Add(DB.MakeInParam("@PrimaryContactTypeId", SqlDbType.Int, 4, objPrimaryContact.ContactTypeId)); prm.Add(DB.MakeInParam("@PrimaryContactFirstName", SqlDbType.NVarChar, 255, objPrimaryContact.FirstName)); prm.Add(DB.MakeInParam("@PrimaryContactLastName", SqlDbType.NVarChar, 255, objPrimaryContact.LastName)); prm.Add(DB.MakeInParam("@PrimaryContactTitleId", SqlDbType.Int, 4, objPrimaryContact.ContactTitleId)); prm.Add(DB.MakeInParam("@PrimaryContactEmail", SqlDbType.NVarChar, 200, objPrimaryContact.Email)); prm.Add(DB.MakeInParam("@PrimaryContactIsActive", SqlDbType.Bit, 1, objPrimaryContact.IsActive)); prm.Add(DB.MakeInParam("@PrimaryContactIsPrimary", SqlDbType.Bit, 1, objPrimaryContact.IsPrimary)); prm.Add(DB.MakeInParam("@PrimaryContactLanguageId", SqlDbType.Int, 4, objPrimaryContact.LanguageId)); #endregion #region Primary Contact Business Phone Info prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneNumber", SqlDbType.NVarChar, 15, objPrimaryContactBusinessPhone.Number)); prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneExtension", SqlDbType.NVarChar, 7, objPrimaryContactBusinessPhone.Extension)); prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneTypeId", SqlDbType.Int, 4, objPrimaryContactBusinessPhone.PhoneTypeId)); prm.Add(DB.MakeInParam("@PrimaryContactBusinessPhoneIsActive", SqlDbType.Bit, 1, objPrimaryContactBusinessPhone.IsActive)); #endregion #region Primary Contact Cell Phone Info prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneNumber", SqlDbType.NVarChar, 15, objPrimaryContactCellPhone.Number)); prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneIsAcceptTextMessages", SqlDbType.Bit, 1, objPrimaryContactCellPhone.IsAcceptTextMessages)); prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneTypeId", SqlDbType.Int, 4, objPrimaryContactCellPhone.PhoneTypeId)); prm.Add(DB.MakeInParam("@PrimaryContactCellPhoneIsActive", SqlDbType.Bit, 1, objPrimaryContactCellPhone.IsActive)); #endregion #region Business Organization Address Info prm.Add(DB.MakeInParam("@BusinessOrganization_AddressZipCodeId", SqlDbType.Int, 4, objBusinessOrganization_Address.ZipCodeID)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressZipCode", SqlDbType.NVarChar, 100, objBusinessOrganization_Address.ZipPostalCode)); prm.Add(DB.MakeInParam("@BusinessOrganizationAddress1", SqlDbType.NVarChar, 250, objBusinessOrganization_Address.Address1)); prm.Add(DB.MakeInParam("@BusinessOrganizationAddress2", SqlDbType.NVarChar, 250, objBusinessOrganization_Address.Address2)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressCity", SqlDbType.NVarChar, 100, objBusinessOrganization_Address.City)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressStateId", SqlDbType.Int, 4, objBusinessOrganization_Address.StateID)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressCountryID", SqlDbType.Int, 4, objBusinessOrganization_Address.CountryID)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressIsActive", SqlDbType.Bit, 1, objBusinessOrganization_Address.IsActive)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressDateCreated", SqlDbType.DateTime, 8, objBusinessOrganization_Address.DateCreated)); prm.Add(DB.MakeInParam("@BusinessOrganization_AddressTypeId", SqlDbType.Int, 4, objBusinessOrganization_Address.Organization_AddressTypeId)); #endregion objOrg.OrganizationId = DB.RunProc("up_OrganizationAdditionalLocationAdd", prm.ToArray()); } } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "OrganizationInfo.SaveAdditionalLocationInfo", ex); } }
public static void SaveBasicInfo(OrganizationInfo ObjOrg, ContactInfo objContactInfo, Phones objPhones) { try { using (DbManager DB = DbManager.GetDbManager()) { List<SqlParameter> prm = new List<SqlParameter>(); if (ObjOrg.OrganizationId > 0) prm.Add(DB.MakeInParam("@OrganizationId", SqlDbType.Int, 4, ObjOrg.OrganizationId)); else prm.Add(DB.MakeInParam("@OrganizationId", SqlDbType.Int, 4, DBNull.Value)); prm.Add(DB.MakeInParam("@LegalName", SqlDbType.NVarChar, 255, ObjOrg.LegalName)); prm.Add(DB.MakeInParam("@DBAName", SqlDbType.NVarChar, 255, ObjOrg.DBAName)); prm.Add(DB.MakeInParam("@FranchiseName", SqlDbType.NVarChar, 255, ObjOrg.FranchiseName)); if(ObjOrg.BusinessType != null) prm.Add(DB.MakeInParam("@BusinessType", SqlDbType.VarChar, -1, String.Join<int>(",", ObjOrg.BusinessType))); else prm.Add(DB.MakeInParam("@BusinessType", SqlDbType.VarChar, -1, DBNull.Value)); prm.Add(DB.MakeInParam("@OrgIsActive", SqlDbType.Bit, 1, ObjOrg.IsActive)); prm.Add(DB.MakeInParam("@OrganizationTypeId", SqlDbType.Int, 4, ObjOrg.OrganizationTypeId)); prm.Add(DB.MakeInParam("@OrganizationSubTypeId", SqlDbType.Int, 4, ObjOrg.OrganizationSubTypeID)); prm.Add(DB.MakeInParam("@ParentId", SqlDbType.Int, 4, ObjOrg.ParentId)); prm.Add(DB.MakeInParam("@Website", SqlDbType.NVarChar, 255, ObjOrg.Website)); prm.Add(DB.MakeInParam("@TX_ID", SqlDbType.NVarChar, 90, ObjOrg.TX_ID)); prm.Add(DB.MakeInParam("@OrgLanguageId", SqlDbType.Int, 4, ObjOrg.LanguageId)); prm.Add(DB.MakeInParam("@AgencyType", SqlDbType.Int, 4, ObjOrg.AgencyType)); prm.Add(DB.MakeInParam("@RoleId", SqlDbType.Int, 4, ObjOrg.RoleId)); prm.Add(DB.MakeInParam("@PhoneId", SqlDbType.Int, 4, objPhones.PhoneId)); prm.Add(DB.MakeInParam("@Number", SqlDbType.NVarChar, 15, objPhones.Number)); prm.Add(DB.MakeInParam("@Extension", SqlDbType.NVarChar, 7, objPhones.Extension)); prm.Add(DB.MakeInParam("@PhoneTypeId", SqlDbType.Int, 4, objPhones.PhoneTypeId)); prm.Add(DB.MakeInParam("@PhoneIsActive", SqlDbType.Bit, 1, objPhones.IsActive)); prm.Add(DB.MakeInParam("@ContactId", SqlDbType.Int, 4, objContactInfo.ContactId)); prm.Add(DB.MakeInParam("@ContactTypeId", SqlDbType.Int, 4, objContactInfo.ContactTypeId)); prm.Add(DB.MakeInParam("@FirstName", SqlDbType.NVarChar, 30, objContactInfo.FirstName)); prm.Add(DB.MakeInParam("@MiddleName", SqlDbType.NVarChar, 10, objContactInfo.MiddleName)); prm.Add(DB.MakeInParam("@LastName", SqlDbType.NVarChar, 30, objContactInfo.LastName)); prm.Add(DB.MakeInParam("@Email", SqlDbType.NVarChar, 90, objContactInfo.Email)); prm.Add(DB.MakeInParam("@IsPrimary", SqlDbType.Bit, 1, objContactInfo.IsPrimary)); prm.Add(DB.MakeInParam("@ContactIsActive", SqlDbType.Bit, 1, objContactInfo.IsActive)); prm.Add(DB.MakeInParam("@ContactLanguageId", SqlDbType.Int, 4, objContactInfo.LanguageId)); //prm.Add(DB.MakeInParam("@LocationID", SqlDbType.Int, 4, ObjOrg.LocationID)); //prm.Add(DB.MakeInParam("@Description", SqlDbType.NVarChar, 100, ObjOrg.Description)); //prm.Add(DB.MakeInParam("@Address", SqlDbType.NVarChar, 250, ObjOrg.Address)); //prm.Add(DB.MakeInParam("@City", SqlDbType.NVarChar, 100, ObjOrg.City)); //prm.Add(DB.MakeInParam("@StateId", SqlDbType.Int, 4, ObjOrg.StateID)); //prm.Add(DB.MakeInParam("@CountryID", SqlDbType.Int, 4, ObjOrg.CountryID)); //prm.Add(DB.MakeInParam("@ZipPostalCode", SqlDbType.NVarChar, 100, ObjOrg.ZipPostalCode)); //prm.Add(DB.MakeInParam("@AddressIsActive", SqlDbType.Bit, 1, ObjOrg.IsActive)); //prm.Add(DB.MakeInParam("@DateCreated", SqlDbType.DateTime, 8, ObjOrg.DateCreated)); //prm.Add(DB.MakeInParam("@BillMailAddress", SqlDbType.NVarChar, 250, ObjOrg.BillMailAddress)); //prm.Add(DB.MakeInParam("@OwnerManager", SqlDbType.NVarChar, 50, ObjOrg.OwnerManager)); //prm.Add(DB.MakeInParam("@BilingContact", SqlDbType.NVarChar, 50, ObjOrg.BillingContact)); //prm.Add(DB.MakeInParam("@Fax", SqlDbType.NVarChar, 20, ObjOrg.Fax)); ObjOrg.OrganizationId = DB.RunProc("up_OrganizationInsertUpdateBasicInfo", prm.ToArray()); } } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "OrganizationInfo.SaveBasicInfo", ex); } }