Esempio n. 1
0
        //---------------------------------------------------------------------------
        #endregion


        #region ---------------------------RegisterInSms---------------------------
        //---------------------------------------------------------------------------
        public static void RegisterInSms(MessagesEntity msg)
        {
            MessagesModuleOptions msgModule = MessagesModuleOptions.GetType(msg.ModuleTypeID);
            Languages             langID    = (Languages)SiteSettings.Languages_DefaultLanguageID;

            SMSNumbersFactory.RegisterInSms(msg.ModuleTypeID, msg.Mobile, langID, msgModule.SmsAutomaticActivation);
        }
Esempio n. 2
0
        //----------------------------------------------------------------------------
        #endregion

        #region --------------------------SetMetaTags----------------------------
        //----------------------------------------------------------------------------
        //SetMetaTags
        //----------------------------------------------------------------------------
        public static void SetMetaTags(MessagesEntity msg)
        {
            DCMetaBuilder metaBuilder = DCMetaBuilder.Instance;
            string        siteName    = SiteTextsManager.Instance.SiteName.Trim();

            //------------------------------------------------------------
            metaBuilder.Title = msg.Title;
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(msg.KeyWords))
            {
                metaBuilder.Keywords = msg.KeyWords;
            }
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(msg.ShortDescription))
            {
                metaBuilder.Description = msg.ShortDescription;
            }
            //------------------------------------------------------------
            if (!string.IsNullOrEmpty(msg.Name))
            {
                metaBuilder.Author = msg.Name + " , " + siteName;
            }
            //------------------------------------------------------------
            metaBuilder.PubDate = msg.Date_Added.ToUniversalTime().ToString();
            //------------------------------------------------------------
            metaBuilder.LastModification = msg.LastModification.ToUniversalTime().ToString();
            //------------------------------------------------------------
            metaBuilder.Source = siteName;
            //------------------------------------------------------------
        }
Esempio n. 3
0
        public MessagesEntity GetMessagesObject(int messageID, UsersTypes viewerType, Guid OwnerID)
        {
            MessagesEntity msg = null;

            using (SqlConnection myConnection = GetSqlConnection())
            {
                SqlCommand myCommand = new SqlCommand("Messages_GetOneByID", myConnection);
                myCommand.CommandType = CommandType.StoredProcedure;
                // Set the parameters
                myCommand.Parameters.Add("@ViewerType ", SqlDbType.Int, 4).Value = (int)viewerType;
                myCommand.Parameters.Add("@MessageID", SqlDbType.Int, 4).Value   = messageID;
                //---------------------------------------------------------------------
                myCommand.Parameters.Add("@OwnerID", SqlDbType.UniqueIdentifier).Value = OwnerID;
                //---------------------------------------------------------------------
                // Execute the command
                myConnection.Open();
                using (SqlDataReader dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    if (dr.Read())
                    {
                        //msg = PopulateEntity(dr);
                        msg = (MessagesEntity)GetEntity(dr, typeof(MessagesEntity));
                    }
                    dr.Close();
                }
                myConnection.Close();
                return(msg);
            }
        }
Esempio n. 4
0
        //------------------------------------------
        #endregion


        #region ---------------------------RegisterInMailList---------------------------
        //---------------------------------------------------------------------------
        public static void RegisterInMailList(MessagesEntity msg)
        {
            MessagesModuleOptions msgModule = MessagesModuleOptions.GetType(msg.ModuleTypeID);
            Languages             langID    = (Languages)SiteSettings.Languages_DefaultLanguageID;

            MailListUsersFactory.RegisterInMailList(msg.ModuleTypeID, msg.EMail, langID, msgModule.MailListAutomaticActivation, msgModule.MailListSendingMailActivation);
        }
Esempio n. 5
0
        //------------------------------------------
        #endregion


        #region --------------GetMessagesObject--------------
        public static MessagesEntity GetMessagesObject(int messageID, UsersTypes viewerType, Guid OwnerID)
        {
            MessagesEntity msg = MessagesSqlDataPrvider.Instance.GetMessagesObject(messageID, viewerType, OwnerID);

            //return the object
            return(msg);
        }
Esempio n. 6
0
        /// <summary>
        /// Creates Messages object by calling Messages data provider create method.
        /// <example>[Example]bool status=MessagesFactory.Create(msg);.</example>
        /// </summary>
        /// <param name="msg">The Messages object.</param>
        /// <returns>Status of create operation.</returns>
        public static bool Create(MessagesEntity msg, bool createMsgFolder)
        {
            //Insert user name------------------------------------------
            string username = "";

            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                username           = HttpContext.Current.User.Identity.Name;
                msg.InsertUserName = username;
            }
            //----------------------------------------------------------
            bool status = MessagesSqlDataPrvider.Instance.Create(msg);

            //-------------------------------------
            if (status && createMsgFolder)
            {
                // Create msg folder
                string folder             = DCSiteUrls.GetPath_MessagesDirectory(msg.OwnerName, msg.ModuleTypeID, msg.CategoryID, msg.MessageID);
                string folderPhysicalPath = DCServer.MapPath(folder);
                if (!Directory.Exists(folderPhysicalPath))
                {
                    string        defaultFolder             = DCSiteUrls.GetPath_DefaultMessageFolder();
                    string        defaultFolderPhysicalPath = DCServer.MapPath(defaultFolder);
                    DirectoryInfo diSource = new DirectoryInfo(defaultFolderPhysicalPath);
                    DirectoryInfo diTarget = new DirectoryInfo(folderPhysicalPath);
                    DcDirectoryManager.CopyAll(diSource, diTarget);
                }
            }
            //-------------------------------------
            return(status);
        }
Esempio n. 7
0
        //------------------------------------------
        #endregion

        #region --------------Update--------------
        /// <summary>
        /// Updates Messages object by calling Messages data provider update method.
        /// <example>[Example]bool status=MessagesFactory.Update(msg);.</example>
        /// </summary>
        /// <param name="msg">The Messages object.</param>
        /// <returns>Status of update operation.</returns>
        public static bool Update(MessagesEntity msg)
        {
            //Update user name------------------------------------------
            string username = "";

            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                username = HttpContext.Current.User.Identity.Name;
                msg.LastUpdateUserName = username;
            }
            //----------------------------------------------------------
            bool status = MessagesSqlDataPrvider.Instance.Update(msg);

            return(status);
        }
Esempio n. 8
0
        //------------------------------------------
        #endregion

        #region --------------Delete--------------
        /// <summary>
        /// Deletes single Messages object .
        /// <example>[Example]bool status=MessagesFactory.Delete(messageID);.</example>
        /// </summary>
        /// <param name="messageID">The msg id.</param>
        /// <returns>Status of delete operation.</returns>
        public static bool Delete(int messageID)
        {
            MessagesEntity msg    = MessagesFactory.GetMessagesObject(messageID, UsersTypes.Admin, SitesHandler.GetOwnerIDAsGuid());
            bool           status = MessagesSqlDataPrvider.Instance.Delete(messageID);

            //-------------------------------------
            if (status)
            {
                //delete message folder
                //-------------------------------------
                string folder             = DCSiteUrls.GetPath_MessagesDirectory(msg.OwnerName, msg.ModuleTypeID, msg.CategoryID, msg.MessageID);
                string folderPhysicalPath = DCServer.MapPath(folder);
                if (Directory.Exists(folderPhysicalPath))
                {
                    DirectoryInfo dir = new DirectoryInfo(folderPhysicalPath);
                    DcDirectoryManager.DeletDirectory(dir);
                }
            }
            //-------------------------------------
            return(status);
        }
Esempio n. 9
0
        //---------------------------------------------------------------------------
        public static void UpdateSmsMobileNo(string oldMobile, MessagesEntity msg)
        {
            SMSNumbersEntity smsUser = SMSNumbersFactory.GetObject(msg.ModuleTypeID, oldMobile);

            if (smsUser != null)
            {
                if (!string.IsNullOrEmpty(msg.Mobile))
                {
                    smsUser.Numbers = msg.Mobile;
                    SMSNumbersFactory.Update(smsUser);
                }
                else
                {
                    SMSNumbersFactory.Delete(smsUser.NumID);
                }
            }
            else
            {
                MessagesFactory.RegisterInSms(msg);
            }
        }
Esempio n. 10
0
        //---------------------------------------------------------------------------
        public static void UpdateMailListEmail(string oldEmail, MessagesEntity msg)
        {
            MailListUsersEntity mlUser = MailListUsersFactory.GetObject(msg.ModuleTypeID, oldEmail);

            if (mlUser != null)
            {
                if (!string.IsNullOrEmpty(msg.EMail))
                {
                    mlUser.Email = msg.EMail;
                    MailListUsersFactory.Update(mlUser);
                }
                else
                {
                    MailListUsersFactory.Delete(mlUser.UserID);
                }
            }
            else
            {
                MessagesFactory.RegisterInMailList(msg);
            }
        }
Esempio n. 11
0
        public static void AddTitlePath(PathLinksClass pc, Label lblTitle)
        {
            if (MoversFW.Components.UrlManager.ChechIsValidIntegerParameter("id"))
            {
                int            messageID = Convert.ToInt32(HttpContext.Current.Request.QueryString["id"]);
                Languages      lang      = SiteSettings.GetCurrentLanguage();
                MessagesEntity msg       = MessagesFactory.GetMessagesObject(messageID, UsersTypes.Admin, SitesHandler.GetOwnerIDAsGuid());

                if (msg != null)
                {
                    if (pc != null)
                    {
                        pc.AddLink(msg.Title, null);
                    }
                    if (lblTitle != null)
                    {
                        lblTitle.Text = msg.Title;
                    }
                }
            }
        }
Esempio n. 12
0
        //-------------------------------------------------------

        public void InitializeAllOpjects()
        {
            #region Initial lItem
            InitialItem = new ItemsEntity();
            //InitialItem.CategoryID = xxxx;
            //InitialItem.ItemID
            //InitialItem.CategoryID
            //InitialItem.ModuleTypeID = moduleType;
            //InitialItem.PhotoExtension
            InitialItem.Url             = Url;
            InitialItem.Email           = Email;
            InitialItem.MailBox         = MailBox;
            InitialItem.ZipCode         = ZipCode;
            InitialItem.Tels            = Tels;
            InitialItem.Fax             = Fax;
            InitialItem.Mobile          = Mobile;
            InitialItem.ItemDate        = ItemDate;
            InitialItem.ItemEndDate     = ItemEndDate;
            InitialItem.IsAvailable     = IsAvailable;
            InitialItem.YoutubeCode     = YoutubeCode;
            InitialItem.GoogleLatitude  = GoogleLatitude;
            InitialItem.GoogleLongitude = GoogleLongitude;
            InitialItem.Price           = Price;

            /*
             * InitialItem.SenderName
             * InitialItem.SenderEMail
             * InitialItem.SenderCountryID
             * InitialItem.Reply
             * InitialItem.ReplyDate
             * InitialItem.IsSeen
             * InitialItem.IsReplied
             * InitialItem.IsReviewed
             * InitialItem.ToUserID
             * InitialItem.ActivatedBy
             * InitialItem.ReviewedBy
             * InitialItem.OwnerID	*/
            InitialItem.Type = Type;
            #endregion
            #region InitialItemArDetails
            InitialItemArDetails = new ItemsDetailsEntity();
            //InitialItemArDetails.ItemID = InitialItem.ItemID;
            InitialItemArDetails.LangID           = Languages.Ar;
            InitialItemArDetails.Title            = ArItemTitle;
            InitialItemArDetails.ShortDescription = ArItemShortDescrpyion;
            InitialItemArDetails.Description      = ArItemDetails;
            InitialItemArDetails.KeyWords         = ArItemSeoKeyWords;
            InitialItemArDetails.Address          = ArItemAddress;
            InitialItemArDetails.AuthorName       = ArItemAuthorName;
            #endregion
            #region InitialItemArDetails

            InitialItemEnDetails = new ItemsDetailsEntity();
            //InitialItemEnDetails.ItemID = InitialItem.ItemID;
            InitialItemEnDetails.LangID           = Languages.En;
            InitialItemEnDetails.Title            = EnItemTitle;
            InitialItemEnDetails.ShortDescription = EnItemShortDescrpyion;
            InitialItemEnDetails.Description      = EnItemDetails;
            InitialItemEnDetails.KeyWords         = EnItemSeoKeyWords;
            InitialItemEnDetails.Address          = EnItemAddress;
            InitialItemEnDetails.AuthorName       = EnItemAuthorName;
            #endregion



            #region Initial Category
            InitialCategory = new ItemCategoriesEntity();
            //InitialCategory.CategoryID;
            //InitialCategory.PhotoExtension;
            //InitialCategory.ModuleTypeID;
            //InitialCategory.ParentID;
            //InitialCategory.TypeID	=Type;
            InitialCategory.ItemDate        = ItemDate;
            InitialCategory.IsAvailable     = IsAvailable;
            InitialCategory.YoutubeCode     = YoutubeCode;
            InitialCategory.GoogleLatitude  = GoogleLatitude;
            InitialCategory.GoogleLongitude = GoogleLongitude;
            #endregion
            #region Initial Category Parent
            InitialCategoryParent = new ItemCategoriesEntity();
            //InitialCategoryParent.CategoryID;
            //InitialCategoryParent.PhotoExtension;
            //InitialCategoryParent.ModuleTypeID;
            //InitialCategoryParent.ParentID;
            //InitialCategoryParent.TypeID	=Type;
            InitialCategoryParent.ItemDate        = ItemDate;
            InitialCategoryParent.IsAvailable     = IsAvailable;
            InitialCategoryParent.YoutubeCode     = YoutubeCode;
            InitialCategoryParent.GoogleLatitude  = GoogleLatitude;
            InitialCategoryParent.GoogleLongitude = GoogleLongitude;
            #endregion

            #region InitialCategoryArDetails
            InitialCategoryArDetails = new ItemCategoriesDetailsEntity();
            //InitialCategoryArDetails.CategoryID = InitialCategory.CategoryID;
            InitialCategoryArDetails.LangID           = Languages.Ar;
            InitialCategoryArDetails.Title            = ArCategoryTitle;
            InitialCategoryArDetails.ShortDescription = ArItemShortDescrpyion;
            InitialCategoryArDetails.Description      = ArItemDetails;
            InitialCategoryArDetails.KeyWords         = ArItemSeoKeyWords;
            #endregion
            #region InitialCategoryEnDetails

            InitialCategoryEnDetails = new ItemCategoriesDetailsEntity();
            //InitialCategoryEnDetails.CategoryID = InitialCategory.CategoryID;
            InitialCategoryEnDetails.LangID           = Languages.En;
            InitialCategoryEnDetails.Title            = EnCategoryTitle;
            InitialCategoryEnDetails.ShortDescription = EnItemShortDescrpyion;
            InitialCategoryEnDetails.Description      = EnItemDetails;
            InitialCategoryEnDetails.KeyWords         = EnItemSeoKeyWords;
            #endregion

            #region InitialArComment
            InitialArComment = new ItemsCommentsEntity();
            //InitialArComment.CommentID
            //InitialArComment.ItemID
            InitialArComment.LangID = Languages.Ar;
            //InitialArComment.ModuleTypeID
            //InitialArComment.BaseModuleType
            InitialArComment.SenderName = ArSenderName;
            InitialArComment.CountryID  = SenderCountryID;
            //InitialArComment.CtryShort
            InitialArComment.SendingDate  = DateTime.Now;
            InitialArComment.SenderEmail  = SenderEMail;
            InitialArComment.CommentTitle = ArCommentTitle;
            InitialArComment.CommentText  = ArItemDetails;
            InitialArComment.IsActive     = IsAvailable;
            InitialArComment.IsSeen       = IsSeen;
            #endregion
            #region InitialEnComment
            InitialEnComment = new ItemsCommentsEntity();
            //InitialEnComment.CommentID
            //InitialEnComment.ItemID
            InitialEnComment.LangID = Languages.En;
            //InitialEnComment.ModuleTypeID
            //InitialEnComment.BaseModuleType
            InitialEnComment.SenderName = EnSenderName;
            InitialEnComment.CountryID  = SenderCountryID;
            //InitialEnComment.CtryShort
            InitialEnComment.SendingDate  = DateTime.Now;
            InitialEnComment.SenderEmail  = SenderEMail;
            InitialEnComment.CommentTitle = EnCommentTitle;
            InitialEnComment.CommentText  = EnItemDetails;
            InitialArComment.IsActive     = IsAvailable;
            InitialArComment.IsSeen       = IsSeen;
            #endregion

            #region InitialArMessages
            InitialArMessages = new MessagesEntity();
            //InitialArMessages.MessageID=;
            //InitialArMessages.ModuleTypeID
            //InitialArMessages.CategoryID	;
            InitialArMessages.Name             = ArSenderName;
            InitialArMessages.Mobile           = Mobile;
            InitialArMessages.EMail            = Email;
            InitialArMessages.NationalityID    = SiteSettings.Admininstration_SiteDefaultCountryID;
            InitialArMessages.CountryID        = SiteSettings.Admininstration_SiteDefaultCountryID;
            InitialArMessages.Address          = ArItemAddress;
            InitialArMessages.JobTel           = JobTel;
            InitialArMessages.Type             = Type;
            InitialArMessages.Title            = ArMessageTitle;
            InitialArMessages.Details          = ArItemDetails;
            InitialArMessages.ShortDescription = ArItemShortDescrpyion;
            InitialArMessages.Reply            = ArItemDetails;
            InitialArMessages.ReplyDate        = DateTime.Now;
            InitialArMessages.IsAvailable      = IsAvailable;
            InitialArMessages.IsSeen           = IsSeen;
            InitialArMessages.IsReplied        = IsReplied;
            InitialArMessages.LangID           = Languages.Ar;
            InitialArMessages.Gender           = Gender.Male;
            InitialArMessages.BirthDate        = BirthDate;
            InitialArMessages.CityID           = CityID;
            InitialArMessages.UserCityName     = UserCityNameAr;
            InitialArMessages.Tel          = Tels;
            InitialArMessages.Fax          = Fax;
            InitialArMessages.MailBox      = MailBox;
            InitialArMessages.ZipCode      = ZipCode;
            InitialArMessages.JobID        = JobID;
            InitialArMessages.JobText      = JobTextAr;
            InitialArMessages.Company      = CompanyAr;
            InitialArMessages.ActivitiesID = ActivitiesID;
            InitialArMessages.Url          = Url;
            //InitialArMessages.PhotoExtension
            InitialArMessages.SocialStatus    = SocialStatus;
            InitialArMessages.EducationLevel  = EducationLevel;
            InitialArMessages.EmpNo           = EmpNo;
            InitialArMessages.HasSmsService   = HasSmsService;
            InitialArMessages.HasEmailService = HasEmailService;
            //InitialArMessages.Notes1
            //InitialArMessages.Notes2
            InitialArMessages.AgeRang          = AgeRang;
            InitialArMessages.ItemDate         = ItemDate;
            InitialArMessages.YoutubeCode      = YoutubeCode;
            InitialArMessages.GoogleLatitude   = GoogleLatitude.ToString();
            InitialArMessages.GoogleLongitude  = GoogleLongitude.ToString();
            InitialArMessages.Price            = Price;
            InitialArMessages.KeyWords         = ArItemSeoKeyWords;
            InitialArMessages.LastModification = DateTime.Now;
            #endregion

            #region InitialEnMessages
            InitialEnMessages = new MessagesEntity();
            //InitialEnMessages.MessageID=;
            //InitialEnMessages.ModuleTypeID
            //InitialEnMessages.CategoryID	;
            InitialEnMessages.Name             = EnSenderName;
            InitialEnMessages.Mobile           = Mobile;
            InitialEnMessages.EMail            = Email;
            InitialEnMessages.NationalityID    = SiteSettings.Admininstration_SiteDefaultCountryID;
            InitialEnMessages.CountryID        = SiteSettings.Admininstration_SiteDefaultCountryID;
            InitialEnMessages.Address          = EnItemAddress;
            InitialEnMessages.JobTel           = JobTel;
            InitialEnMessages.Type             = Type;
            InitialEnMessages.Title            = EnMessageTitle;
            InitialEnMessages.Details          = EnItemDetails;
            InitialEnMessages.ShortDescription = EnItemShortDescrpyion;
            InitialEnMessages.Reply            = EnItemDetails;
            InitialEnMessages.ReplyDate        = DateTime.Now;
            InitialEnMessages.IsAvailable      = IsAvailable;
            InitialEnMessages.IsSeen           = IsSeen;
            InitialEnMessages.IsReplied        = IsReplied;
            InitialEnMessages.LangID           = Languages.En;
            InitialEnMessages.Gender           = Gender.Male;
            InitialEnMessages.BirthDate        = BirthDate;
            InitialEnMessages.CityID           = CityID;
            InitialEnMessages.UserCityName     = UserCityNameEn;
            InitialEnMessages.Tel          = Tels;
            InitialEnMessages.Fax          = Fax;
            InitialEnMessages.MailBox      = MailBox;
            InitialEnMessages.ZipCode      = ZipCode;
            InitialEnMessages.JobID        = JobID;
            InitialEnMessages.JobText      = JobTextEn;
            InitialEnMessages.Company      = CompanyEn;
            InitialEnMessages.ActivitiesID = ActivitiesID;
            InitialEnMessages.Url          = Url;
            //InitialEnMessages.PhotoExtension
            InitialEnMessages.SocialStatus    = SocialStatus;
            InitialEnMessages.EducationLevel  = EducationLevel;
            InitialEnMessages.EmpNo           = EmpNo;
            InitialEnMessages.HasSmsService   = HasSmsService;
            InitialEnMessages.HasEmailService = HasEmailService;
            //InitialEnMessages.Notes1
            //InitialEnMessages.Notes2
            InitialEnMessages.AgeRang          = AgeRang;
            InitialEnMessages.ItemDate         = ItemDate;
            InitialEnMessages.YoutubeCode      = YoutubeCode;
            InitialEnMessages.GoogleLatitude   = GoogleLatitude.ToString();
            InitialEnMessages.GoogleLongitude  = GoogleLongitude.ToString();
            InitialEnMessages.Price            = Price;
            InitialEnMessages.KeyWords         = EnItemSeoKeyWords;
            InitialEnMessages.LastModification = DateTime.Now;
            #endregion
        }
Esempio n. 13
0
        //------------------------------------------
        #endregion

        #region --------------Create--------------
        /// <summary>
        /// Converts the Messages object properties to SQL paramters and executes the create Messages procedure
        /// and updates the Messages object with the SQL data by reference.
        /// <example>[Example]bool status=MessagesSqlDataPrvider.Instance.Create(msg);.</example>
        /// </summary>
        /// <param name="msg">The Messages object.</param>
        /// <returns>The status of create query.</returns>
        public bool Create(MessagesEntity msg)
        {
            using (SqlConnection myConnection = GetSqlConnection())
            {
                SqlCommand myCommand = new SqlCommand("Messages_Create", myConnection);
                myCommand.CommandType = CommandType.StoredProcedure;
                // Set the parameters
                myCommand.Parameters.Add("@MessageID", SqlDbType.Int, 4).Direction = ParameterDirection.Output;
                myCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 128).Value   = msg.Name;
                myCommand.Parameters.Add("@Mobile", SqlDbType.NVarChar, 32).Value  = msg.Mobile;
                myCommand.Parameters.Add("@EMail", SqlDbType.VarChar, 128).Value   = msg.EMail;

                myCommand.Parameters.Add("@NationalityID", SqlDbType.Int, 4).Value    = msg.NationalityID;
                myCommand.Parameters.Add("@CountryID", SqlDbType.Int, 4).Value        = msg.CountryID;
                myCommand.Parameters.Add("@Address", SqlDbType.NVarChar, 256).Value   = msg.Address;
                myCommand.Parameters.Add("@JobTel", SqlDbType.NVarChar, 32).Value     = msg.JobTel;
                myCommand.Parameters.Add("@Type", SqlDbType.Int, 4).Value             = msg.Type;
                myCommand.Parameters.Add("@Title", SqlDbType.NVarChar, 128).Value     = msg.Title;
                myCommand.Parameters.Add("@Details", SqlDbType.NText).Value           = msg.Details;
                myCommand.Parameters.Add("@UserId", SqlDbType.UniqueIdentifier).Value = msg.UserId;
                myCommand.Parameters.Add("@ToItemID", SqlDbType.Int, 4).Value         = msg.ToItemID;
                myCommand.Parameters.Add("@ModuleTypeID", SqlDbType.Int, 4).Value     = (int)msg.ModuleTypeID;
                //------------------------------------------------------
                myCommand.Parameters.Add("@CategoryID", SqlDbType.Int, 4).Value         = msg.CategoryID;
                myCommand.Parameters.Add("@LangID", SqlDbType.Int, 4).Value             = (int)msg.LangID;
                myCommand.Parameters.Add("@ToUserID", SqlDbType.UniqueIdentifier).Value = msg.ToUserID;
                //------------------------------------------------------
                myCommand.Parameters.Add("@EmpNo", SqlDbType.Int, 4).Value           = msg.EmpNo;
                myCommand.Parameters.Add("@Gender", SqlDbType.Int, 4).Value          = (int)msg.Gender;
                myCommand.Parameters.Add("@BirthDate", SqlDbType.VarChar, 32).Value  = msg.BirthDate;
                myCommand.Parameters.Add("@SocialStatus", SqlDbType.Int, 4).Value    = msg.SocialStatus;
                myCommand.Parameters.Add("@EducationLevel", SqlDbType.Int, 4).Value  = msg.EducationLevel;
                myCommand.Parameters.Add("@CityID", SqlDbType.Int, 4).Value          = msg.CityID;
                myCommand.Parameters.Add("@UserCityName", SqlDbType.NVarChar).Value  = msg.UserCityName;
                myCommand.Parameters.Add("@Tel", SqlDbType.NVarChar, 32).Value       = msg.Tel;
                myCommand.Parameters.Add("@HasSmsService", SqlDbType.Bit, 1).Value   = msg.HasSmsService;
                myCommand.Parameters.Add("@HasEmailService", SqlDbType.Bit, 1).Value = msg.HasEmailService;
                myCommand.Parameters.Add("@AgeRang", SqlDbType.Int, 4).Value         = msg.AgeRang;
                //------------------------------------------------------
                myCommand.Parameters.Add("@Notes1", SqlDbType.NVarChar, 512).Value = msg.Notes1;
                myCommand.Parameters.Add("@Notes2", SqlDbType.NVarChar, 512).Value = msg.Notes2;
                //------------------------------------------------------
                myCommand.Parameters.Add("@Fax", SqlDbType.NVarChar, 32).Value          = msg.Fax;
                myCommand.Parameters.Add("@MailBox", SqlDbType.NVarChar, 32).Value      = msg.MailBox;
                myCommand.Parameters.Add("@ZipCode", SqlDbType.NVarChar, 32).Value      = msg.ZipCode;
                myCommand.Parameters.Add("@JobID", SqlDbType.Int, 4).Value              = msg.JobID;
                myCommand.Parameters.Add("@JobText", SqlDbType.NVarChar, 64).Value      = msg.JobText;
                myCommand.Parameters.Add("@Url", SqlDbType.NVarChar, 128).Value         = msg.Url;
                myCommand.Parameters.Add("@PhotoExtension", SqlDbType.VarChar, 5).Value = msg.PhotoExtension;
                //------------------------------------------------------
                myCommand.Parameters.Add("@Company", SqlDbType.NVarChar, 64).Value = msg.Company;
                myCommand.Parameters.Add("@ActivitiesID", SqlDbType.Int, 4).Value  = msg.ActivitiesID;
                myCommand.Parameters.Add("@ExtraData", SqlDbType.NVarChar).Value   = OurSerializer.Serialize(msg.ExtraData);
                //------------------------------------------------------
                myCommand.Parameters.Add("@FileExtension", SqlDbType.VarChar, 5).Value = msg.FileExtension;
                //------------------------------------------------------
                //New Parameters
                //-----------------
                myCommand.Parameters.Add("@IsMain", SqlDbType.Bit).Value = msg.IsMain;
                myCommand.Parameters.Add("@VideoExtension", SqlDbType.VarChar, 5).Value  = msg.VideoExtension;
                myCommand.Parameters.Add("@AudioExtension", SqlDbType.VarChar, 5).Value  = msg.AudioExtension;
                myCommand.Parameters.Add("@Priority", SqlDbType.Int, 4).Value            = (int)msg.Priority;
                myCommand.Parameters.Add("@Photo2Extension", SqlDbType.VarChar, 5).Value = msg.Photo2Extension;
                myCommand.Parameters.Add("@Height", SqlDbType.Int, 4).Value = msg.Height;
                myCommand.Parameters.Add("@Width", SqlDbType.Int, 4).Value  = msg.Width;
                //----------------------------------------------------------------------------------
                if (msg.ItemDate != DateTime.MinValue)
                {
                    myCommand.Parameters.Add("@ItemDate", SqlDbType.DateTime).Value = (DateTime)msg.ItemDate;
                }
                else
                {
                    myCommand.Parameters.Add("@ItemDate", SqlDbType.DateTime).Value = DBNull.Value;
                }
                //----------------------------------------------------------------------------------
                myCommand.Parameters.Add("@InsertUserName", SqlDbType.NVarChar, 64).Value = (string)msg.InsertUserName;
                myCommand.Parameters.Add("@YoutubeCode", SqlDbType.VarChar, 16).Value     = (string)msg.YoutubeCode;
                //----------------------------------------------------------------------------------
                myCommand.Parameters.Add("@GoogleLatitude", SqlDbType.NVarChar).Value  = msg.GoogleLatitude;
                myCommand.Parameters.Add("@GoogleLongitude", SqlDbType.NVarChar).Value = msg.GoogleLongitude;
                myCommand.Parameters.Add("@Price", SqlDbType.NVarChar, 128).Value      = msg.Price;
                myCommand.Parameters.Add("@OnlyForRegisered", SqlDbType.Bit).Value     = msg.OnlyForRegisered;
                //-------------------------------------
                myCommand.Parameters.Add("@PublishPhoto", SqlDbType.Bit).Value  = msg.PublishPhoto;
                myCommand.Parameters.Add("@PublishPhoto2", SqlDbType.Bit).Value = msg.PublishPhoto2;
                myCommand.Parameters.Add("@PublishFile", SqlDbType.Bit).Value   = msg.PublishFile;
                myCommand.Parameters.Add("@PublishAudio", SqlDbType.Bit).Value  = msg.PublishAudio;
                myCommand.Parameters.Add("@PublishVideo", SqlDbType.Bit).Value  = msg.PublishVideo;
                myCommand.Parameters.Add("@PublishYoutbe", SqlDbType.Bit).Value = msg.PublishYoutbe;
                //----------------------------------------------------------------------------------
                myCommand.Parameters.Add("@ShortDescription", SqlDbType.NText).Value = msg.ShortDescription;
                //----------------------------------------------------------------------------------
                myCommand.Parameters.Add("@OwnerID", SqlDbType.UniqueIdentifier).Value = msg.OwnerID;
                myCommand.Parameters.Add("@OwnerName", SqlDbType.VarChar).Value        = msg.OwnerName;
                //----------------------------------------------------------------------------------
                myCommand.Parameters.Add("@KeyWords", SqlDbType.NVarChar, 256).Value = msg.KeyWords;
                //----------------------------------------------------------------------------------


                // Execute the command
                bool status = false;
                myConnection.Open();
                if (myCommand.ExecuteNonQuery() > 0)
                {
                    status = true;
                    //Get ID value from database and set it in object
                    msg.MessageID = (int)myCommand.Parameters["@MessageID"].Value;
                }
                myConnection.Close();
                return(status);
            }
        }
Esempio n. 14
0
 //---------------------------------------------------------------------------
 public static void UnRegisterInSms(MessagesEntity msg)
 {
     SMSNumbersFactory.Delete(msg.ModuleTypeID, msg.Mobile);
 }
Esempio n. 15
0
 //---------------------------------------------------------------------------
 public static void UnRegisterInMailList(MessagesEntity msg)
 {
     MailListUsersFactory.Delete(msg.ModuleTypeID, msg.EMail);
 }