Beispiel #1
0
        public override async Task <long> SaveAsync(IThemeModel model, CancellationToken cancellationToken)
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add(DBObjects.SPParameter.Name, GetParameter(DBObjects.SPParameter.Name, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, PublicFunctions.ConvertNulltoDBNull(model.Name)));
            param.Add(DBObjects.SPParameter.Description, GetParameter(DBObjects.SPParameter.Description, ParameterDirection.Input, ((int)SqlDbType.VarChar), 500, PublicFunctions.ConvertNulltoDBNull(model.Description)));
            param.Add(DBObjects.SPParameter.Code, GetParameter(DBObjects.SPParameter.Code, ParameterDirection.Input, ((int)SqlDbType.VarChar), 5, PublicFunctions.ConvertNulltoDBNull(model.Code)));
            param.Add(DBObjects.SPParameter.IsActive, GetParameter(DBObjects.SPParameter.IsActive, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.IsActive));
            param.Add(DBObjects.SPParameter.AddUserId, GetParameter(DBObjects.SPParameter.AddUserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.UserId));
            param.Add(DBObjects.SPParameter.ThemeId, GetParameter(DBObjects.SPParameter.ThemeId, ParameterDirection.Output, ((int)SqlDbType.BigInt), 8, 0));
            param.Add(DBObjects.SPParameter.RetVal, GetParameter(DBObjects.SPParameter.RetVal, ParameterDirection.Output, ((int)SqlDbType.Int), 4, 0));

            await this.ExecuteSPAsync(DBObjects.StoredProcedures.pspThemeSave.ToString(), cancellationToken, param);

            return((long)(((SqlParameter)param[DBObjects.SPParameter.ThemeId]).Value));
        }
Beispiel #2
0
        public override async Task <bool> UpdateAsync(IObjectModel model, CancellationToken cancellationToken)
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add(DBObjects.SPParameter.ObjectId, GetParameter(DBObjects.SPParameter.ObjectId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.ObjectId));
            param.Add(DBObjects.SPParameter.ModuleId, GetParameter(DBObjects.SPParameter.ModuleId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.ModuleId));
            param.Add(DBObjects.SPParameter.Name, GetParameter(DBObjects.SPParameter.Name, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, model.Name));
            param.Add(DBObjects.SPParameter.Description, GetParameter(DBObjects.SPParameter.Description, ParameterDirection.Input, ((int)SqlDbType.VarChar), 500, PublicFunctions.ConvertNulltoDBNull(model.Description)));
            param.Add(DBObjects.SPParameter.Caption, GetParameter(DBObjects.SPParameter.Caption, ParameterDirection.Input, ((int)SqlDbType.VarChar), 500, model.Caption));
            param.Add(DBObjects.SPParameter.URL, GetParameter(DBObjects.SPParameter.URL, ParameterDirection.Input, ((int)SqlDbType.VarChar), 1024, PublicFunctions.ConvertNulltoDBNull(model.URL)));
            param.Add(DBObjects.SPParameter.ParentObjectId, GetParameter(DBObjects.SPParameter.ParentObjectId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.ParentObjectId));
            param.Add(DBObjects.SPParameter.AllowWrite, GetParameter(DBObjects.SPParameter.AllowWrite, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.AllowWrite));
            param.Add(DBObjects.SPParameter.AllowDelete, GetParameter(DBObjects.SPParameter.AllowDelete, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.AllowDelete));
            param.Add(DBObjects.SPParameter.ObjectLevel, GetParameter(DBObjects.SPParameter.ObjectLevel, ParameterDirection.Input, ((int)SqlDbType.Int), 4, model.ObjectLevel));
            param.Add(DBObjects.SPParameter.IsActive, GetParameter(DBObjects.SPParameter.IsActive, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.IsActive));
            param.Add(DBObjects.SPParameter.UpdateUserId, GetParameter(DBObjects.SPParameter.UpdateUserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.UserId));
            param.Add(DBObjects.SPParameter.ObjectOrder, GetParameter(DBObjects.SPParameter.ObjectOrder, ParameterDirection.Input, ((int)SqlDbType.TinyInt), 3, PublicFunctions.ConvertNulltoDBNull(model.ObjectOrder)));
            param.Add(DBObjects.SPParameter.ObjectImage, GetParameter(DBObjects.SPParameter.ObjectImage, ParameterDirection.Input, ((int)SqlDbType.VarChar), 150, PublicFunctions.ConvertNulltoDBNull(model.ObjectImage)));
            param.Add(DBObjects.SPParameter.RetVal, GetParameter(DBObjects.SPParameter.RetVal, ParameterDirection.Output, ((int)SqlDbType.Int), 4, 0));

            await this.ExecuteSPAsync(DBObjects.StoredProcedures.pspObjectUpdate.ToString(), cancellationToken, param);

            int ret = (int)(((SqlParameter)param[DBObjects.SPParameter.RetVal]).Value);

            return(Convert.ToBoolean(ret));
        }
Beispiel #3
0
        public override async Task <long> SaveAsync(IAdvertisementModel model, CancellationToken cancellationToken)
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            string csIds = "", csPrices = "";

            if (model.TimePrices != null && model.TimePrices.Count > 0)
            {
                foreach (ValueId par in model.TimePrices)
                {
                    csIds    = csIds + par.Id + ",";
                    csPrices = csPrices + par.Price + ",";
                }
            }

            param.Add(DBObjects.SPParameter.Name, GetParameter(DBObjects.SPParameter.Name, ParameterDirection.Input, ((int)SqlDbType.NVarChar), model.Name.Length, PublicFunctions.ConvertNulltoDBNull(model.Name)));
            param.Add(DBObjects.SPParameter.Address, GetParameter(DBObjects.SPParameter.Address, ParameterDirection.Input, ((int)SqlDbType.NVarChar), model.Address.Length, PublicFunctions.ConvertNulltoDBNull(model.Address)));
            param.Add(DBObjects.SPParameter.PhoneNumber, GetParameter(DBObjects.SPParameter.PhoneNumber, ParameterDirection.Input, ((int)SqlDbType.NVarChar), model.PhoneNumber.Length, PublicFunctions.ConvertNulltoDBNull(model.PhoneNumber)));
            param.Add(DBObjects.SPParameter.Web, GetParameter(DBObjects.SPParameter.Web, ParameterDirection.Input, ((int)SqlDbType.NVarChar), model.Web.Length, PublicFunctions.ConvertNulltoDBNull(model.Web)));
            param.Add(DBObjects.SPParameter.Email, GetParameter(DBObjects.SPParameter.Email, ParameterDirection.Input, ((int)SqlDbType.NVarChar), model.Email.Length, PublicFunctions.ConvertNulltoDBNull(model.Email)));
            param.Add(DBObjects.SPParameter.AdvertiserId, GetParameter(DBObjects.SPParameter.AdvertiserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.AdvertiserId)));
            param.Add(DBObjects.SPParameter.CategoryId, GetParameter(DBObjects.SPParameter.CategoryId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.CategoryIds[0])));
            param.Add(DBObjects.SPParameter.LocationId, GetParameter(DBObjects.SPParameter.LocationId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.LocationId)));
            param.Add(DBObjects.SPParameter.VisibilityType, GetParameter(DBObjects.SPParameter.VisibilityType, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.VisibilityType)));
            param.Add(DBObjects.SPParameter.SpecialTerms, GetParameter(DBObjects.SPParameter.SpecialTerms, ParameterDirection.Input, ((int)SqlDbType.NVarChar), model.SpecialTerms.Length, PublicFunctions.ConvertNulltoDBNull(model.SpecialTerms)));
            param.Add(DBObjects.SPParameter.FixedRateLabel, GetParameter(DBObjects.SPParameter.FixedRateLabel, ParameterDirection.Input, ((int)SqlDbType.NVarChar), model.FixedRateLabel.Length, PublicFunctions.ConvertNulltoDBNull(model.FixedRateLabel)));
            param.Add(DBObjects.SPParameter.FixedRateCharges, GetParameter(DBObjects.SPParameter.FixedRateCharges, ParameterDirection.Input, ((int)SqlDbType.Decimal), 16, PublicFunctions.ConvertNulltoDBNull(model.FixedRateCharges)));
            param.Add(DBObjects.SPParameter.DepositCharges, GetParameter(DBObjects.SPParameter.DepositCharges, ParameterDirection.Input, ((int)SqlDbType.Decimal), 16, PublicFunctions.ConvertNULL(model.DepositCharges, (Decimal)0)));
            param.Add(DBObjects.SPParameter.BondCharges, GetParameter(DBObjects.SPParameter.BondCharges, ParameterDirection.Input, ((int)SqlDbType.Decimal), 16, PublicFunctions.ConvertNULL(model.BondCharges, (Decimal)0)));
            param.Add(DBObjects.SPParameter.MinimumCharges, GetParameter(DBObjects.SPParameter.MinimumCharges, ParameterDirection.Input, ((int)SqlDbType.Decimal), 16, PublicFunctions.ConvertNULL(model.MinimumCharges, (Decimal)0)));
            param.Add(DBObjects.SPParameter.DefaultTimeChargingId, GetParameter(DBObjects.SPParameter.DefaultTimeChargingId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 16, PublicFunctions.ConvertNulltoDBNull(model.DefaultTimeChargingId)));
            param.Add(DBObjects.SPParameter.ChargingTypeId, GetParameter(DBObjects.SPParameter.ChargingTypeId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 16, PublicFunctions.ConvertNulltoDBNull(model.ChargingTypeId)));
            param.Add(DBObjects.SPParameter.IsVisibleToPublic, GetParameter(DBObjects.SPParameter.IsVisibleToPublic, ParameterDirection.Input, ((int)SqlDbType.Bit), 4, PublicFunctions.ConvertNulltoDBNull(Convert.ToBoolean(model.IsVisibleToPublic))));
            param.Add(DBObjects.SPParameter.Quantity, GetParameter(DBObjects.SPParameter.Quantity, ParameterDirection.Input, ((int)SqlDbType.Int), 16, PublicFunctions.ConvertNulltoDBNull(model.Quantity)));
            param.Add(DBObjects.SPParameter.IsMoreThanOne, GetParameter(DBObjects.SPParameter.IsMoreThanOne, ParameterDirection.Input, ((int)SqlDbType.Bit), 4, PublicFunctions.ConvertNulltoDBNull(Convert.ToBoolean(model.IsMoreThanOne))));
            param.Add(DBObjects.SPParameter.Description, GetParameter(DBObjects.SPParameter.Description, ParameterDirection.Input, ((int)SqlDbType.NVarChar), model.Description.Length, PublicFunctions.ConvertNulltoDBNull(model.Description)));
            param.Add(DBObjects.SPParameter.IdList, GetParameter(DBObjects.SPParameter.IdList, ParameterDirection.Input, ((int)SqlDbType.NVarChar), csIds.Length, PublicFunctions.ConvertNulltoDBNull(csIds)));

            param.Add(DBObjects.SPParameter.PriceList, GetParameter(DBObjects.SPParameter.PriceList, ParameterDirection.Input, ((int)SqlDbType.NVarChar), csPrices.Length, PublicFunctions.ConvertNulltoDBNull(csPrices)));
            param.Add(DBObjects.SPParameter.AddUserId, GetParameter(DBObjects.SPParameter.AddUserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.UserId));
            param.Add(DBObjects.SPParameter.AdvertisementId, GetParameter(DBObjects.SPParameter.AdvertisementId, ParameterDirection.Output, ((int)SqlDbType.BigInt), 8, 0));
            param.Add(DBObjects.SPParameter.RetVal, GetParameter(DBObjects.SPParameter.RetVal, ParameterDirection.Output, ((int)SqlDbType.Int), 4, 0));

            await this.ExecuteSPAsync(DBObjects.StoredProcedures.hspAdvertisementSave.ToString(), cancellationToken, param);

            return(Convert.ToInt64(((SqlParameter)param[DBObjects.SPParameter.RetVal]).Value));
        }
Beispiel #4
0
        public override async Task <bool> UpdateAsync(IEmailServerModel model, CancellationToken cancellationToken)
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add(DBObjects.SPParameter.ServerName, GetParameter(DBObjects.SPParameter.ServerName, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, model.ServerName));
            param.Add(DBObjects.SPParameter.ServerIP, GetParameter(DBObjects.SPParameter.ServerIP, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, model.ServerIP));
            param.Add(DBObjects.SPParameter.EmailPort, GetParameter(DBObjects.SPParameter.EmailPort, ParameterDirection.Input, ((int)SqlDbType.Int), 4, model.EmailPort));
            param.Add(DBObjects.SPParameter.UserName, GetParameter(DBObjects.SPParameter.UserName, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, model.UserName));
            param.Add(DBObjects.SPParameter.UserPswd, GetParameter(DBObjects.SPParameter.UserPswd, ParameterDirection.Input, ((int)SqlDbType.VarChar), -1, model.UserPswd));
            param.Add(DBObjects.SPParameter.UseDefaultCredentials, GetParameter(DBObjects.SPParameter.UseDefaultCredentials, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.UseDefaultCredentials));
            param.Add(DBObjects.SPParameter.EnableSSL, GetParameter(DBObjects.SPParameter.EnableSSL, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.EnableSSL));
            param.Add(DBObjects.SPParameter.IsActive, GetParameter(DBObjects.SPParameter.IsActive, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.IsActive));
            param.Add(DBObjects.SPParameter.UpdateUserID, GetParameter(DBObjects.SPParameter.UpdateUserID, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.UserId)));
            param.Add(DBObjects.SPParameter.Priority, GetParameter(DBObjects.SPParameter.Priority, ParameterDirection.Input, ((int)SqlDbType.TinyInt), 1, PublicFunctions.ConvertNulltoDBNull(model.Priority)));
            param.Add(DBObjects.SPParameter.ServerId, GetParameter(DBObjects.SPParameter.ServerId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.ServerId)));
            param.Add(DBObjects.SPParameter.RetVal, GetParameter(DBObjects.SPParameter.RetVal, ParameterDirection.Output, ((int)SqlDbType.Int), 4, 0));

            await this.ExecuteSPAsync(DBObjects.StoredProcedures.pspEmailServerUpdate.ToString(), cancellationToken, param);

            return(Convert.ToBoolean((Int32)((SqlParameter)param[DBObjects.SPParameter.RetVal]).Value));
        }
        public int GetEmailTemplate(long userId, string userName, string callBackUrl, ref string RetEmailTemplate, ref string RetEmailSubject, Constant.EmailType emailType)
        {
            //int retVal = 0;

            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add(DBObjects.SPParameter.UserId, GetParameter(DBObjects.SPParameter.UserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, userId));
            param.Add(DBObjects.SPParameter.UserName, GetParameter(DBObjects.SPParameter.UserName, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, userName));
            param.Add(DBObjects.SPParameter.CallBackUrl, GetParameter(DBObjects.SPParameter.CallBackUrl, ParameterDirection.Input, ((int)SqlDbType.VarChar), 1024, PublicFunctions.ConvertNulltoDBNull(callBackUrl)));
            param.Add(DBObjects.SPParameter.RetEmailTemplate, GetParameter(DBObjects.SPParameter.RetEmailTemplate, ParameterDirection.Output, ((int)SqlDbType.VarChar), 3096, RetEmailTemplate));
            param.Add(DBObjects.SPParameter.RetEmailSubject, GetParameter(DBObjects.SPParameter.RetEmailSubject, ParameterDirection.Output, ((int)SqlDbType.VarChar), 500, RetEmailSubject));
            param.Add(DBObjects.SPParameter.RetVal, GetParameter(DBObjects.SPParameter.RetVal, ParameterDirection.Output, ((int)SqlDbType.Int), 4, null));
            param.Add(DBObjects.SPParameter.EmailType, GetParameter(DBObjects.SPParameter.EmailType, ParameterDirection.Input, ((int)SqlDbType.Int), 4, emailType));

            this.ExecuteSP(DBObjects.StoredProcedures.pspEmailTemplate.ToString(), ref param);

            RetEmailTemplate = (string)((SqlParameter)param[DBObjects.SPParameter.RetEmailTemplate]).Value;
            RetEmailSubject  = (string)((SqlParameter)param[DBObjects.SPParameter.RetEmailSubject]).Value;
            return((int)(((SqlParameter)param[DBObjects.SPParameter.RetVal]).Value));
        }
        public async Task <bool> UpdateProfileAsync(IHireThingsUser model, CancellationToken cancellationToken)
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add(DBObjects.SPParameter.LocationID, GetParameter(DBObjects.SPParameter.LocationID, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.LocationId)));
            param.Add(DBObjects.SPParameter.CountryId, GetParameter(DBObjects.SPParameter.CountryId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.CountryId)));
            param.Add(DBObjects.SPParameter.RoleId, GetParameter(DBObjects.SPParameter.RoleId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.RoleId));
            param.Add(DBObjects.SPParameter.FIRSTNAME, GetParameter(DBObjects.SPParameter.FIRSTNAME, ParameterDirection.Input, ((int)SqlDbType.VarChar), 30, model.FirstName));
            param.Add(DBObjects.SPParameter.MIDDLENAME, GetParameter(DBObjects.SPParameter.MIDDLENAME, ParameterDirection.Input, ((int)SqlDbType.VarChar), 1, PublicFunctions.ConvertNulltoDBNull(model.MiddleName)));
            param.Add(DBObjects.SPParameter.LASTNAME, GetParameter(DBObjects.SPParameter.LASTNAME, ParameterDirection.Input, ((int)SqlDbType.VarChar), 30, model.LastName));
            param.Add(DBObjects.SPParameter.EMAIL, GetParameter(DBObjects.SPParameter.EMAIL, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, model.EmailId));
            param.Add(DBObjects.SPParameter.PHONENUMBER, GetParameter(DBObjects.SPParameter.PHONENUMBER, ParameterDirection.Input, ((int)SqlDbType.VarChar), 30, PublicFunctions.ConvertNulltoDBNull(model.PhoneNo)));
            param.Add(DBObjects.SPParameter.Address1, GetParameter(DBObjects.SPParameter.Address1, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, PublicFunctions.ConvertNulltoDBNull(model.Address1)));
            param.Add(DBObjects.SPParameter.Address2, GetParameter(DBObjects.SPParameter.Address2, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, PublicFunctions.ConvertNulltoDBNull(model.Address2)));
            param.Add(DBObjects.SPParameter.Address3, GetParameter(DBObjects.SPParameter.Address3, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, PublicFunctions.ConvertNulltoDBNull(model.Address3)));
            param.Add(DBObjects.SPParameter.Active, GetParameter(DBObjects.SPParameter.Active, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.IsActive));
            param.Add(DBObjects.SPParameter.UserId, GetParameter(DBObjects.SPParameter.UserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.Id));
            param.Add(DBObjects.SPParameter.SecurityQuestionId, GetParameter(DBObjects.SPParameter.SecurityQuestionId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.SecurityQuestionID));
            param.Add(DBObjects.SPParameter.Answer, GetParameter(DBObjects.SPParameter.Answer, ParameterDirection.Input, ((int)SqlDbType.VarChar), 1024, model.SecurityAnswer));
            param.Add(DBObjects.SPParameter.DOB, GetParameter(DBObjects.SPParameter.DOB, ParameterDirection.Input, ((int)SqlDbType.Date), 8, PublicFunctions.ConvertNulltoDBNull(model.DOB)));
            param.Add(DBObjects.SPParameter.GenderId, GetParameter(DBObjects.SPParameter.GenderId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.GenderId)));
            param.Add(DBObjects.SPParameter.RetVal, GetParameter(DBObjects.SPParameter.RetVal, ParameterDirection.Output, ((int)SqlDbType.Int), 4, 1));
            param.Add(DBObjects.SPParameter.UpdateUserId, GetParameter(DBObjects.SPParameter.UpdateUserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.UserId));
            await this.ExecuteSPAsync(DBObjects.StoredProcedures.pspUserProfileUpdate.ToString(), cancellationToken, param);

            return(Convert.ToBoolean((Int32)(((SqlParameter)param[DBObjects.SPParameter.RetVal]).Value)));
        }
        public async override Task <long> SaveAsync(IHireThingsUser model, CancellationToken cancellationToken)
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add(DBObjects.SPParameter.LocationID, GetParameter(DBObjects.SPParameter.LocationID, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.LocationId)));
            param.Add(DBObjects.SPParameter.CountryId, GetParameter(DBObjects.SPParameter.CountryId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.CountryId)));
            param.Add(DBObjects.SPParameter.RoleId, GetParameter(DBObjects.SPParameter.RoleId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.RoleId)));
            param.Add(DBObjects.SPParameter.FIRSTNAME, GetParameter(DBObjects.SPParameter.FIRSTNAME, ParameterDirection.Input, ((int)SqlDbType.VarChar), 30, PublicFunctions.ConvertNulltoDBNull(model.FirstName)));
            param.Add(DBObjects.SPParameter.MIDDLENAME, GetParameter(DBObjects.SPParameter.MIDDLENAME, ParameterDirection.Input, ((int)SqlDbType.VarChar), 1, PublicFunctions.ConvertNulltoDBNull(model.MiddleName)));
            param.Add(DBObjects.SPParameter.LASTNAME, GetParameter(DBObjects.SPParameter.LASTNAME, ParameterDirection.Input, ((int)SqlDbType.VarChar), 30, PublicFunctions.ConvertNulltoDBNull(model.LastName)));
            param.Add(DBObjects.SPParameter.EMAIL, GetParameter(DBObjects.SPParameter.EMAIL, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, PublicFunctions.ConvertNulltoDBNull(model.EmailId)));
            param.Add(DBObjects.SPParameter.PHONENUMBER, GetParameter(DBObjects.SPParameter.PHONENUMBER, ParameterDirection.Input, ((int)SqlDbType.VarChar), 30, PublicFunctions.ConvertNulltoDBNull(model.PhoneNo)));
            param.Add(DBObjects.SPParameter.Address1, GetParameter(DBObjects.SPParameter.Address1, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, PublicFunctions.ConvertNulltoDBNull(model.Address1)));
            param.Add(DBObjects.SPParameter.Address2, GetParameter(DBObjects.SPParameter.Address2, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, PublicFunctions.ConvertNulltoDBNull(model.Address2)));
            param.Add(DBObjects.SPParameter.Address3, GetParameter(DBObjects.SPParameter.Address3, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, PublicFunctions.ConvertNulltoDBNull(model.Address3)));
            param.Add(DBObjects.SPParameter.PIN, GetParameter(DBObjects.SPParameter.PIN, ParameterDirection.Input, ((int)SqlDbType.VarChar), 20, model.Pin));
            param.Add(DBObjects.SPParameter.Active, GetParameter(DBObjects.SPParameter.Active, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.IsActive));
            param.Add(DBObjects.SPParameter.RFIDPIN, GetParameter(DBObjects.SPParameter.RFIDPIN, ParameterDirection.Input, ((int)SqlDbType.VarChar), 100, "0x01000000428EC9DAF430F49BD0DBD9CF4994647BA7EABC48E7AF9D7E"));
            param.Add(DBObjects.SPParameter.UserId, GetParameter(DBObjects.SPParameter.UserId, ParameterDirection.Output, ((int)SqlDbType.BigInt), 8, 0));

            param.Add(DBObjects.SPParameter.PINHash, GetParameter(DBObjects.SPParameter.PINHash, ParameterDirection.Input, ((int)SqlDbType.VarChar), 255, model.PINHash));
            param.Add(DBObjects.SPParameter.RetVal, GetParameter(DBObjects.SPParameter.RetVal, ParameterDirection.Output, ((int)SqlDbType.Int), 4, 1));
            param.Add(DBObjects.SPParameter.EmailConfirmed, GetParameter(DBObjects.SPParameter.EmailConfirmed, ParameterDirection.Input, ((int)SqlDbType.Bit), 1, model.IsEmailConfirmed));
            param.Add(DBObjects.SPParameter.AddUserId, GetParameter(DBObjects.SPParameter.AddUserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.UserId));
            param.Add(DBObjects.SPParameter.SecurityQuestionId, GetParameter(DBObjects.SPParameter.SecurityQuestionId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, model.SecurityQuestionID));
            param.Add(DBObjects.SPParameter.Answer, GetParameter(DBObjects.SPParameter.Answer, ParameterDirection.Input, ((int)SqlDbType.VarChar), 1024, model.SecurityAnswer));
            param.Add(DBObjects.SPParameter.DOB, GetParameter(DBObjects.SPParameter.DOB, ParameterDirection.Input, ((int)SqlDbType.Date), 8, PublicFunctions.ConvertNulltoDBNull(model.DOB)));
            param.Add(DBObjects.SPParameter.GenderId, GetParameter(DBObjects.SPParameter.GenderId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.GenderId)));
            await this.ExecuteSPAsync(DBObjects.StoredProcedures.pspUserSave.ToString(), cancellationToken, param);

            return((long)(((SqlParameter)param[DBObjects.SPParameter.UserId]).Value));
        }
        public bool EmailLog(IEmailLogModel model)
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add(DBObjects.SPParameter.UserId, GetParameter(DBObjects.SPParameter.UserId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.UserId)));
            param.Add(DBObjects.SPParameter.SystemId, GetParameter(DBObjects.SPParameter.SystemId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.SystemId)));
            param.Add(DBObjects.SPParameter.OrganizationID, GetParameter(DBObjects.SPParameter.OrganizationID, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.OrganizationId)));
            param.Add(DBObjects.SPParameter.WSId, GetParameter(DBObjects.SPParameter.WSId, ParameterDirection.Input, ((int)SqlDbType.BigInt), 8, PublicFunctions.ConvertNulltoDBNull(model.WSId)));
            param.Add(DBObjects.SPParameter.To, GetParameter(DBObjects.SPParameter.To, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, PublicFunctions.ConvertNulltoDBNull(model.To)));
            param.Add(DBObjects.SPParameter.Cc, GetParameter(DBObjects.SPParameter.Cc, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, PublicFunctions.ConvertNulltoDBNull(model.Cc)));
            param.Add(DBObjects.SPParameter.Bcc, GetParameter(DBObjects.SPParameter.Bcc, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, PublicFunctions.ConvertNulltoDBNull(model.Bcc)));
            param.Add(DBObjects.SPParameter.Subject, GetParameter(DBObjects.SPParameter.Subject, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, model.Subject));
            param.Add(DBObjects.SPParameter.Body, GetParameter(DBObjects.SPParameter.Body, ParameterDirection.Input, ((int)SqlDbType.VarChar), 1024, model.Body));
            param.Add(DBObjects.SPParameter.SentStatus, GetParameter(DBObjects.SPParameter.SentStatus, ParameterDirection.Input, ((int)SqlDbType.TinyInt), 2, model.SentStatus));
            param.Add(DBObjects.SPParameter.UnSentReason, GetParameter(DBObjects.SPParameter.UnSentReason, ParameterDirection.Input, ((int)SqlDbType.VarChar), 50, PublicFunctions.ConvertNulltoDBNull(model.UnSentReason)));
            param.Add(DBObjects.SPParameter.EmailType, GetParameter(DBObjects.SPParameter.EmailType, ParameterDirection.Input, ((int)SqlDbType.Int), 4, model.EmailType));
            param.Add(DBObjects.SPParameter.RetVal, GetParameter(DBObjects.SPParameter.RetVal, ParameterDirection.Output, ((int)SqlDbType.Int), 4, 1));

            this.ExecuteSP(DBObjects.StoredProcedures.pspEmailLog.ToString(), ref param);

            return(Convert.ToBoolean((Int32)(((SqlParameter)param[DBObjects.SPParameter.RetVal]).Value)));
        }