Beispiel #1
0
 public JsonResult EditComment(vmComment input)
 {
     if (!ModelState.IsValid)
     {
         return(Json("faild"));
     }
     try
     {
         using (var _Context = new ApplicationDbContext())
         {
             var _objEntityComment = new RepositoryPattern <PostComment>(_Context);
             var CurrentItem       = _objEntityComment.GetByPredicate(x => x.ID == input.ID);
             if (CurrentItem != null)
             {
                 CurrentItem.Is_Active = input.Is_Active;
                 CurrentItem.FullName  = input.FullName;
                 CurrentItem.Comment   = input.Comment;
                 _objEntityComment.Update(CurrentItem);
                 _objEntityComment.Save();
                 _objEntityComment.Dispose();
             }
         }
     }
     catch (Exception)
     {
         return(Json("OK"));
     }
     return(Json("OK"));
 }
Beispiel #2
0
 public void SaveLog()
 {
     if (C_LikeViewList.CompareListCreateTimeWithTimeNow())
     {
         var LstLikeView = C_LikeViewList.GetAllLikeView();
         if (LstLikeView.Count()
             != 0)
         {
             using (var _Context = new ApplicationDbContext())
             {
                 var _objEntityActivity = new RepositoryPattern <Activity>(_Context);
                 foreach (var item in LstLikeView)
                 {
                     if (item.ActionTypeID == Convert.ToInt32(EnumMethod.ActionType.View) || item.ActionTypeID == Convert.ToInt32(EnumMethod.ActionType.Like) || item.ActionTypeID == Convert.ToInt32(EnumMethod.ActionType.Downlaod))
                     {
                         var NewItem = new Activity
                         {
                             ActionTime     = item.ActionTime,
                             DateMiladi     = item.DateMiladi,
                             DateShamsi     = item.DateShamsi,
                             ActivityTypeId = item.ActionTypeID,
                             PostId         = item.PostID,
                             Browser        = item.Browser,
                             Device         = item.Device,
                             IP_Address     = item.IP_Address,
                             HostName       = item.HostName,
                             MoreInfo       = ""
                         };
                         _objEntityActivity.Insert(NewItem);
                     }
                     else if (item.ActionTypeID == Convert.ToInt32(EnumMethod.ActionType.DisLike))
                     {
                         var CurrItemDele = _objEntityActivity.GetByPredicate(x =>
                                                                              x.PostId == item.PostID &&
                                                                              x.Browser == item.Browser &&
                                                                              x.Device == item.Device &&
                                                                              x.HostName == item.HostName &&
                                                                              x.IP_Address == item.IP_Address &&
                                                                              x.ActivityTypeId == Convert.ToInt32(EnumMethod.ActionType.Like));
                         if (CurrItemDele != null)
                         {
                             _objEntityActivity.Delete(CurrItemDele.ID);
                         }
                     }
                 }
                 _objEntityActivity.Save();
                 _objEntityActivity.Dispose();
                 C_LikeViewList.ClearLikeViewList();
             }
         }
     }
 }
Beispiel #3
0
        public async Task <ActionResult> Contact_US(string Name, string Phone, string Email, string Message, string CaptchaText)
        {
            if (CaptchaText.ToLower() == HttpContext.Session["captchastring"].ToString().ToLower())
            {
                Session.Remove("captchastring");
                var _objEntityMessage = new RepositoryPattern <Comment>(new ApplicationDbContext());
                var NewItem           = new Comment
                {
                    FullName    = Name,
                    PhoneNumber = Phone,
                    Email       = Email,
                    CommentUser = Message,
                    SendDate    = DateConvertor.DateToNumber(DateConvertor.TodayDate()),
                    SendTime    = DateConvertor.TimeNow(),
                    Is_Read     = "0"
                };
                _objEntityMessage.Insert(NewItem);
                _objEntityMessage.Save();
                _objEntityMessage.Dispose();

                try
                {
                    OpratingClasses.EmailService emailService = new OpratingClasses.EmailService();
                    var strSubject = " نام و نام خانوادگی : " + NewItem.FullName;
                    var strMessage =
                        " ارتباط با مديريت وب سايت" +
                        "  <br />  " + NewItem.CommentUser +
                        "  <br />  " + " ایمیل : " + NewItem.Email +
                        "  <br />  " + " شماره همراه : " + NewItem.PhoneNumber +
                        "  <br />  " + " تاریخ و ساعت ارسال : " + NewItem.SendDate + " - " + NewItem.SendTime;

                    await emailService.SendMail(strSubject, strMessage);
                }
                catch (Exception)
                {
                }

                return(Json("OK"));
            }
            else
            {
                return(Json("CaptchaTextMistake"));
                //ViewBag.Message = "CAPTCHA verification failed!";
            }
        }
Beispiel #4
0
 public string DeleteDatabaseConnection(int id)
 {
     try
     {
         if (id == default(int))
         {
             // retirn exception
         }
         using (var dataBaseRepo = new RepositoryPattern <DatabaseConnection>())
         {
             dataBaseRepo.Delete(id);
             dataBaseRepo.Save();
         }
         return("Database Connection Deleted successfully");
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Beispiel #5
0
 public string CreateDataBaseConnection(DataBaseConnectionServiceModel dataBaseConnection)
 {
     try
     {
         if (dataBaseConnection == null)
         {
         }
         using (var dataBaseRepo = new RepositoryPattern <DatabaseConnection>())
         {
             var data = Mapper.Map <DatabaseConnection>(dataBaseConnection);
             dataBaseRepo.Insert(data);
             dataBaseRepo.Save();
         }
         return("");
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Beispiel #6
0
 public JsonResult ReadComment(int id)
 {
     try
     {
         using (var _Context = new ApplicationDbContext())
         {
             var _objEntityComment = new RepositoryPattern <PostComment>(_Context);
             var CurrentItem       = _objEntityComment.GetByPredicate(x => x.ID == id);
             if (CurrentItem != null)
             {
                 CurrentItem.Is_Read = "1";
                 _objEntityComment.Update(CurrentItem);
                 _objEntityComment.Save();
                 _objEntityComment.Dispose();
             }
         }
     }
     catch (Exception)
     {
         return(Json("OK"));
     }
     return(Json("OK"));
 }
Beispiel #7
0
 /// <summary>
 /// پاک کردن تصویر یک پست - وبلاگ
 /// </summary>
 /// <param name="PostID"></param>
 /// <returns></returns>
 public bool DeleteImageOfPost(string MediaID)
 {
     if (MediaID == null || MediaID == "")
     {
         return(false);
     }
     using (var _Context = new ApplicationDbContext())
     {
         var _objEntityImage = new RepositoryPattern <Image>(_Context);
         var itemMedia       = _objEntityImage.GetByPredicate(x => x.ID == MediaID);
         if (HelpOperation.RemoveMediaFromServer(itemMedia.FilePathOnServer))
         {
             _objEntityImage.Delete(itemMedia.ID);
             _objEntityImage.Save();
             _objEntityImage.Dispose();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Beispiel #8
0
        //public ContentResult UploadFile(HttpPostedFileBase hpf,List<vm_FileUploadInfo> vm_Info)
        public JsonResult PublishPost(vmPublishPost input) //string Title, int CategoryID, string Content, string IsActive, bool FlagHaveFile,string Tagsinput)
        {                                                  //, string Labels
            try
            {
                string NewImageID;
                //InfoUser AppUser = new InfoUser();
                var TodayDateShamsi = DateConvertor.DateToNumber(DateConvertor.TodayDate());
                //var NewNewsCode = HelpOperation.NewsCode(Convert.ToInt32(TodayDateShamsi));
                if (input.FlagHaveFile == true)
                {
                    HelpOperation.CreateArchiveFolderOnTheServer();
                    HttpPostedFileBase hpf = Request.Files[0] as HttpPostedFileBase;
                    var FileSize           = HelpOperation.ToFileSize(hpf.ContentLength);
                    var GuidID             = HelpOperation.NewGuidID();
                    var FileNameOnServer   = GuidID + Path.GetExtension(hpf.FileName);
                    var FilePath           = @"~\MediaFiles\Image\" + FileNameOnServer;
                    var FilePathOnServer   = Server.MapPath(FilePath);
                    var FileUrl            = HelpOperation.MapToUrl(FilePath);
                    Request.Files[0].SaveAs(FilePathOnServer);
                    using (var _ContextImage = new ApplicationDbContext())
                    {
                        var _objEntityImage = new RepositoryPattern <Image>(_ContextImage);
                        var NewItemImage    = new Image
                        {
                            ID               = GuidID,
                            TitleUrl         = input.Title,
                            FileName         = FileNameOnServer,
                            FileSize         = FileSize,
                            FileUrl          = FileUrl,
                            FilePathOnServer = FilePath
                        };
                        NewImageID = GuidID;
                        _objEntityImage.Insert(NewItemImage);
                        _objEntityImage.Save();
                        _objEntityImage.Dispose();
                    }

                    using (var _ContextPost = new ApplicationDbContext())
                    {
                        var objEntityPost = new RepositoryPattern <Post>(_ContextPost);
                        var newItemPost   = new Post
                        {
                            Title      = input.Title.Trim(),
                            ImageID    = NewImageID,
                            CategoryID = input.CategoryID,
                            //Categories = new List<Category>() {  new Category() {ID = CategoryID, } },
                            Content            = input.Content,
                            IsActive           = input.IsActive == "true" ? "0" : "1",
                            Labels             = input.Tagsinput.Trim(),
                            SeoMetaDescription = input.SeoMetaDescription.Trim(),
                            PostDate           = DateConvertor.DateToNumber(DateConvertor.TodayDate()),
                            PostTime           = DateConvertor.TimeNowShort()
                        };
                        objEntityPost.Insert(newItemPost);
                        objEntityPost.Save();

                        objEntityPost.Dispose();
                    }
                }
                return(Json("OK"));
            }
            catch (Exception)
            {
                return(Json("Faild"));
            }
        }
Beispiel #9
0
        public JsonResult EditPost(vmPublishPost input)
        {
            try
            {
                //delete image of Post To Insert New Image For Post (Update)
                if (input.FlagHaveFile == true)
                {
                    DatabaseOperation objDatabaseOperation = new DatabaseOperation();
                    using (var _Context1 = new ApplicationDbContext())
                    {
                        var objEntityPost = new RepositoryPattern <Post>(_Context1);
                        var CurrentItem   = objEntityPost.GetByPredicate(x => x.ID == input.PostID);
                        if (objDatabaseOperation.DeleteImageOfPost(CurrentItem.ImageID))
                        {
                            //InfoUser AppUser = new InfoUser();
                            var TodayDateShamsi = DateConvertor.DateToNumber(DateConvertor.TodayDate());
                            //var NewNewsCode = HelpOperation.NewsCode(Convert.ToInt32(TodayDateShamsi));
                            HelpOperation.CreateArchiveFolderOnTheServer();
                            HttpPostedFileBase hpf = Request.Files[0] as HttpPostedFileBase;
                            var FileSize           = HelpOperation.ToFileSize(hpf.ContentLength);
                            var GuidID             = CurrentItem.ImageID;
                            var FileNameOnServer   = GuidID + Path.GetExtension(hpf.FileName);
                            var FilePath           = @"~\MediaFiles\Image\" + FileNameOnServer;
                            var FilePathOnServer   = Server.MapPath(FilePath);
                            var FileUrl            = HelpOperation.MapToUrl(FilePath);
                            Request.Files[0].SaveAs(FilePathOnServer);
                            using (var _ContextImage = new ApplicationDbContext())
                            {
                                var _objEntityImage = new RepositoryPattern <Image>(_ContextImage);
                                var NewItemImage    = new Image
                                {
                                    ID               = GuidID,
                                    TitleUrl         = input.Title,
                                    FileName         = FileNameOnServer,
                                    FileSize         = FileSize,
                                    FileUrl          = FileUrl,
                                    FilePathOnServer = FilePath
                                };
                                _objEntityImage.Insert(NewItemImage);
                                _objEntityImage.Save();
                                _objEntityImage.Dispose();
                            }
                        }
                    }
                }

                using (var _context = new ApplicationDbContext())
                {
                    var objEntityPost = new RepositoryPattern <Post>(_context);
                    var CurrentItem   = objEntityPost.GetByPredicate(x => x.ID == input.PostID);

                    CurrentItem.Title      = input.Title.Trim();
                    CurrentItem.CategoryID = input.CategoryID;
                    //Categories = new List<Category>() {  new Category() {ID = CategoryID, } },
                    CurrentItem.Content            = input.Content;
                    CurrentItem.IsActive           = input.IsActive == "true" ? "0" : "1";
                    CurrentItem.Labels             = input.Tagsinput.Trim();
                    CurrentItem.SeoMetaDescription = input.SeoMetaDescription.Trim();
                    //CurrentItem.PostDate = DateConvertor.DateToNumber(DateConvertor.TodayDate());
                    //CurrentItem.PostTime = DateConvertor.TimeNowShort();

                    objEntityPost.Update(CurrentItem);
                    objEntityPost.Save();

                    objEntityPost.Dispose();
                }
                return(Json("OK"));
            }
            catch (Exception)
            {
                return(Json("Faild"));
            }
        }
        public string UpdateTableAndfieldconfiguration(TableAndFieldConfigurationServiceModel tableAndFieldConfiguration)
        {
            try
            {
                if (tableAndFieldConfiguration == null)
                {
                    //return Exception;
                }
                var dataToInsert            = new List <FieldConfiguration>();
                var dataToUpdate            = new List <FieldConfiguration>();
                var idsToDeleteFieldMapping = new List <FieldMappingConfiguration>();

                using (var repo = new RepositoryPattern <TableConfiguration>())
                {
                    var detailsToUpdate = Mapper.Map <TableConfiguration>(tableAndFieldConfiguration.tableConfiguration);
                    repo.Update(detailsToUpdate);
                    repo.Save();
                }
                tableAndFieldConfiguration.fieldConfiguration.ForEach(f =>
                                                                      { f.TableConfigId = tableAndFieldConfiguration.tableConfiguration.Id; f.IsDisplay = true; });

                dataToInsert = Mapper.Map <List <FieldConfiguration> >(tableAndFieldConfiguration.fieldConfiguration.Where(f => f.Id == default(int)).ToList());
                dataToUpdate = Mapper.Map <List <FieldConfiguration> >(tableAndFieldConfiguration.fieldConfiguration.Where(u => u.Id != default(int)).ToList());

                var configurationIds = dataToUpdate.Select(i => i.Id).ToList();

                using (var repo = new RepositoryPattern <FieldConfiguration>())
                {
                    //Update existing records which will not display in future
                    var records = repo.SelectAll().Where(f => f.TableConfigId == tableAndFieldConfiguration.tableConfiguration.Id &&
                                                         !configurationIds.Any(c => c == f.Id)).Select(c => { c.IsDisplay = false; return(c); }).ToList();

                    if (records.Any())
                    {
                        dataToUpdate.AddRange(records);
                    }

                    if (dataToUpdate.Any())
                    {
                        repo.BulkUpdate(dataToUpdate);
                    }
                    if (dataToInsert.Any())
                    {
                        repo.BulkInsert(dataToInsert);
                    }

                    idsToDeleteFieldMapping.AddRange(repo.SelectAll().Where(h => h.TableConfigId == tableAndFieldConfiguration.tableConfiguration.Id && h.FieldMappingConfigurations.Any())
                                                     .SelectMany(g => g.FieldMappingConfigurations).ToList());
                }
                tableAndFieldConfiguration.fieldConfiguration.ForEach(field =>
                {
                    if (field.Id == default(int))
                    {
                        var dataWithIds = dataToInsert.FirstOrDefault(a => a.SourceColumnName == field.SourceColumnName &&
                                                                      a.TableConfigId == field.TableConfigId && a.ReferenceTableName == field.ReferenceTableName &&
                                                                      a.ReferenceColumnName == field.ReferenceColumnName && field.IsDisplay).Id;
                        field.Id = dataWithIds;
                    }
                });

                List <FieldMappingConfiguration> fieldMappingConfigurations = new List <FieldMappingConfiguration>();
                tableAndFieldConfiguration.fieldConfiguration.ForEach(fields =>
                {
                    if (fields.MappedCoumns.Any())
                    {
                        fields.MappedCoumns.ForEach(m =>
                        {
                            var mappingDetails = new FieldMappingConfiguration()
                            {
                                FieldConfigurationId = fields.Id,
                                MapColumnName        = m,
                                MapTableName         = fields.ReferenceTableName,
                            };
                            fieldMappingConfigurations.Add(mappingDetails);
                        });
                    }
                });

                using (var repo = new RepositoryPattern <FieldMappingConfiguration>())
                {
                    if (idsToDeleteFieldMapping.Any())
                    {
                        repo.BulkDelete(idsToDeleteFieldMapping);
                    }
                    if (fieldMappingConfigurations.Any())
                    {
                        repo.BulkInsert(fieldMappingConfigurations);
                    }
                }

                return("Table and field mapping Save succesfully");
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public string SaveTableConfiguraionDetails(TableAndFieldConfigurationServiceModel tableAndFieldConfiguration)
        {
            try
            {
                if (tableAndFieldConfiguration == null)
                {
                    //return exce
                }
                if (!tableAndFieldConfiguration.fieldConfiguration.Any())
                {
                    //return
                }
                var tableConfigData = Mapper.Map <TableConfiguration>(tableAndFieldConfiguration.tableConfiguration);
                using (var tableConfigRepo = new RepositoryPattern <TableConfiguration>())
                {
                    tableConfigRepo.Insert(tableConfigData);
                    tableConfigRepo.Save();
                }

                //for entry in table
                tableAndFieldConfiguration.fieldConfiguration.ForEach(v => { v.TableConfigId = tableConfigData.Id; v.IsDisplay = true; });
                List <FieldConfiguration> fieldDetails = Mapper.Map <List <FieldConfiguration> >(tableAndFieldConfiguration.fieldConfiguration);
                using (var fieldConfigRepo = new RepositoryPattern <FieldConfiguration>())
                {
                    fieldConfigRepo.BulkInsert(fieldDetails);
                }
                List <FieldMappingConfiguration> fieldMappingConfigurations = new List <FieldMappingConfiguration>();
                tableAndFieldConfiguration.fieldConfiguration.ForEach(field =>
                {
                    var dataWithId = fieldDetails.FirstOrDefault(a => a.SourceColumnName == field.SourceColumnName &&
                                                                 a.TableConfigId == field.TableConfigId && a.ReferenceTableName == field.ReferenceTableName &&
                                                                 a.ReferenceColumnName == field.ReferenceColumnName).Id;
                    field.Id = dataWithId;
                });
                tableAndFieldConfiguration.fieldConfiguration.ForEach(field =>
                {
                    if (!string.IsNullOrWhiteSpace(field.ReferenceTableName) && !string.IsNullOrWhiteSpace(field.ReferenceColumnName))
                    {
                        if (field.MappedCoumns.Any())
                        {
                            field.MappedCoumns.ForEach(m =>
                            {
                                var mappingDetails = new FieldMappingConfiguration()
                                {
                                    FieldConfigurationId = field.Id,
                                    MapColumnName        = m,
                                    MapTableName         = field.ReferenceTableName,
                                };
                                fieldMappingConfigurations.Add(mappingDetails);
                            });
                        }
                    }
                });

                if (fieldMappingConfigurations.Any())
                {
                    using (var fieldMappingConfigRepo = new RepositoryPattern <FieldMappingConfiguration>())
                    {
                        fieldMappingConfigRepo.BulkInsert(fieldMappingConfigurations);
                    }
                }
                return("Table Configuration Saved Succefully");
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Beispiel #12
0
        public void StartOperation(string CurrentClientIP)
        {
            NetworkOperation objNetworkOperation = new NetworkOperation();
            //string CurrentClientIP = ClientIPaddress();
            IpInformation IpInfo = GetLocationIPINFO(CurrentClientIP);

            var _objEntityWebsiteVisit = new RepositoryPattern <WebsiteVisit>(new ApplicationDbContext());

            var newItem = new WebsiteVisit
            {
                VisitTime  = TimeNow(),
                DateShamsi = DateConvertor.DateToNumber(DateConvertor.TodayDate()),
                DateMiladi = DateConvertor.DateToNumber(DateConvertor.TodayDateMiladi()),
                Browser    = objNetworkOperation.ClientBrowser(),
                DeviceInfo = objNetworkOperation.ClientDeviceType(),
                IP_Address = CurrentClientIP,
                HostName   = objNetworkOperation.ClientHostName(),
                country    = IpInfo.country,
                //asn = IpInfo.@as,
                city        = IpInfo.city,
                countryCode = IpInfo.countryCode,
                isp         = IpInfo.isp,
                lat         = IpInfo.lat,
                lon         = (IpInfo.lon),
                org         = IpInfo.org,
                query       = IpInfo.query,
                region      = IpInfo.region,
                regionName  = IpInfo.regionName,
                status      = IpInfo.status,
                timezone    = IpInfo.timezone,
                zip         = IpInfo.zip,
                district    = IpInfo.district,
                mobile      = IpInfo.mobile, // == true? "1" : "0",
                proxy       = IpInfo.proxy,  // == true ? "1" : "0"
                reverse     = IpInfo.reverse
            };


            _objEntityWebsiteVisit.Insert(newItem);
            _objEntityWebsiteVisit.Save();

            try
            {
                var strSubject = " بازديد از وبسايت " + newItem.DateShamsi + " " + newItem.VisitTime;
                var strMessage =
                    " بازديد وب سايت" +
                    "  <br />  " + " IP Address : " + newItem.IP_Address +
                    "  <br />  " + " مشخصات دستگاه : " + newItem.DeviceInfo +
                    "  <br />  " + " كشور : " + newItem.country +
                    "  <br />  " + " شهر و منطقه : " + newItem.regionName + " - " + newItem.city;

                OpratingClasses.EmailService emailService = new OpratingClasses.EmailService();
                Task.Factory.StartNew(() => emailService.SendMail(strSubject, strMessage));
            }
            catch (Exception)
            {
            }
            var cou = newItem.ID;

            _objEntityWebsiteVisit.Dispose();
        }
Beispiel #13
0
        public async Task <ActionResult> AddComment(vmComment input)
        {
            if (!ModelState.IsValid)
            {
                foreach (var item in ModelState)
                {
                    var errors = item.Value.Errors.ToList();
                }
                return(Json("null"));
            }

            if (input.CaptchaText.ToLower() == HttpContext.Session["captchastring"].ToString().ToLower())
            {
                Session.Remove("captchastring");
                NetworkOperation objNetworkOperation = new NetworkOperation();
                VisitWebsiteLog  visitWebsiteLog     = new VisitWebsiteLog();
                string           CurrentClientIP     = null;
                CurrentClientIP = objNetworkOperation.ClientIPaddress();
                IpInformation IpInfo            = visitWebsiteLog.GetLocationIPINFO(CurrentClientIP);
                var           _objEntityMessage = new RepositoryPattern <PostComment>(new ApplicationDbContext());
                var           NewItem           = new PostComment
                {
                    PostID      = input.PostID,
                    FullName    = input.FullName,
                    Comment     = input.Comment,
                    Email       = input.Email,
                    SendDate    = DateConvertor.DateToNumber(DateConvertor.TodayDate()),
                    SendTime    = DateConvertor.TimeNow(),
                    Browser     = objNetworkOperation.ClientBrowser(),
                    DeviceInfo  = objNetworkOperation.ClientDeviceType(),
                    IP_Address  = CurrentClientIP,
                    HostName    = objNetworkOperation.ClientHostName(),
                    country     = IpInfo.country,
                    city        = IpInfo.city,
                    countryCode = IpInfo.countryCode,
                    org         = IpInfo.org,
                    region      = IpInfo.region,
                    regionName  = IpInfo.regionName,
                    status      = IpInfo.status,
                    timezone    = IpInfo.timezone,
                    mobile      = IpInfo.mobile == true ? true :false,
                    Is_Active   = "1"
                };
                _objEntityMessage.Insert(NewItem);
                _objEntityMessage.Save();
                _objEntityMessage.Dispose();
                try
                {
                    var _objEntityPost = new RepositoryPattern <Post>(new ApplicationDbContext());
                    OpratingClasses.EmailService emailService = new OpratingClasses.EmailService();
                    var strSubject = " نام و نام خانوادگی : " + NewItem.FullName;
                    var strMessage =
                        " ديدگاه كاربر راجع به پست : " + _objEntityPost.GetByPredicate(X => X.ID == NewItem.PostID).Title.Trim() +
                        " <br /> " + NewItem.Comment +
                        " <br /> " + " ایمیل : " + NewItem.Email +
                        " <br /> " + " ساير اطلاعات : " + NewItem.DeviceInfo + " - " + NewItem.country + NewItem.city +
                        " <br /> " + " تاریخ و ساعت ارسال : " + NewItem.SendDate + " - " + NewItem.SendTime;

                    //" <br /> <p styel=\"font-family:\"Tahoma;\"\">" + NewItem.Comment +

                    await emailService.SendMail(strSubject, strMessage);
                }
                catch (Exception)
                {
                }
                return(PartialView("_PartialPageComment", NewItem));
            }
            else
            {
                return(Json("CaptchaTextMistake"));
                //ViewBag.Message = "CAPTCHA verification failed!";
            }
        }