Пример #1
0
        public string GetAllTaskByUserIdAndGroupId(string userid, string username, string profileurl, string days, string groupid)
        {
            UserRepository userrepo = new UserRepository();
            Guid           UserId   = Guid.Parse(userid);
            List <Domain.Myfashion.Domain.Tasks>      taskdata   = new List <Domain.Myfashion.Domain.Tasks>();
            List <Domain.Myfashion.Domain.TaskByUser> taskbyuser = new List <Domain.Myfashion.Domain.TaskByUser>();
            TaskByUser     _TaskByUser = new TaskByUser();
            TaskRepository taskrepo    = new TaskRepository();

            taskdata = taskrepo.getAllTasksOfUserBYDays(Guid.Parse(userid), Guid.Parse(groupid), Convert.ToInt32(days));
            foreach (var item in taskdata)
            {
                _TaskByUser.TaskMessage    = item.TaskMessage;
                _TaskByUser.TaskStatus     = item.TaskStatus;
                _TaskByUser.AssignDate     = item.AssignDate;
                _TaskByUser.CompletionDate = item.CompletionDate;
                try
                {
                    if (UserId == item.AssignTaskTo)
                    {
                        _TaskByUser.AssignToUserName = username;
                    }
                    else
                    {
                        Domain.Myfashion.Domain.User User = userrepo.getUsersById(item.AssignTaskTo);
                        _TaskByUser.AssignToUserName = User.UserName;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    if (UserId == item.UserId)
                    {
                        _TaskByUser.AssignByUserName = username;
                    }
                    else
                    {
                        Domain.Myfashion.Domain.User User = userrepo.getUsersById(item.UserId);
                        _TaskByUser.AssignByUserName = User.UserName;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }

                _TaskByUser.days       = Convert.ToInt32(days);
                _TaskByUser.UserName   = username;
                _TaskByUser.ProfileUrl = profileurl;
                taskbyuser.Add(_TaskByUser);
            }
            return(new JavaScriptSerializer().Serialize(taskbyuser));
        }
Пример #2
0
 public string AddRequestToWithdraw(string WithdrawAmount, string PaymentMethod, string PaypalEmail, string IbanCode, string SwiftCode, string Other, string UserID)
 {
     Domain.Myfashion.Domain.User _User;
     try
     {
         //_User = _UserRepository.getUsersById(Guid.Parse(UserID));
         //Domain.Myfashion.Domain.EwalletWithdrawRequest _EwalletWithdrawRequest = new Domain.Myfashion.Domain.EwalletWithdrawRequest();
         //_EwalletWithdrawRequest.Id = Guid.NewGuid();
         //_EwalletWithdrawRequest.UserName = _User.UserName;
         //_EwalletWithdrawRequest.UserEmail = _User.EmailId;
         //_EwalletWithdrawRequest.PaypalEmail = PaypalEmail;
         //_EwalletWithdrawRequest.PaymentMethod = PaymentMethod;
         //_EwalletWithdrawRequest.IbanCode = IbanCode;
         //_EwalletWithdrawRequest.SwiftCode = SwiftCode;
         //_EwalletWithdrawRequest.Other = Other;
         //_EwalletWithdrawRequest.Status = 0;
         //_EwalletWithdrawRequest.WithdrawAmount = WithdrawAmount;
         //_EwalletWithdrawRequest.UserId = Guid.Parse(UserID);
         //_EwalletWithdrawRequest.RequestDate = DateTime.Now;
         //_EwalletWithdrawRequestRepository.Add(_EwalletWithdrawRequest);
         //_UserRepository.UpdateEwalletAmount(Guid.Parse(UserID),(Double.Parse(_User.Ewallet)-Double.Parse(WithdrawAmount)).ToString());
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
     }
     _User = _UserRepository.getUsersById(Guid.Parse(UserID));
     return(new JavaScriptSerializer().Serialize(_User));
 }
 public string GetUserById(string Id)
 {
     try
     {
         Domain.Myfashion.Domain.User user = new Domain.Myfashion.Domain.User();
         user = objUserRepo.getUsersById(Guid.Parse(Id));
         return(new JavaScriptSerializer().Serialize(user));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(null);
     }
 }
 public void AddRequestToWithdraw(string WithdrawAmount, string PaymentMethod, string PaypalEmail, int Status, string UserID)
 {
     Domain.Myfashion.Domain.User _User = _UserRepository.getUsersById(Guid.Parse(UserID));
     Domain.Myfashion.Domain.EwalletWithdrawRequest _EwalletWithdrawRequest = new Domain.Myfashion.Domain.EwalletWithdrawRequest();
     _EwalletWithdrawRequest.Id             = Guid.NewGuid();
     _EwalletWithdrawRequest.UserName       = _User.UserName;
     _EwalletWithdrawRequest.UserEmail      = _User.EmailId;
     _EwalletWithdrawRequest.PaypalEmail    = PaypalEmail;
     _EwalletWithdrawRequest.PaymentMethod  = PaymentMethod;
     _EwalletWithdrawRequest.Status         = Status;
     _EwalletWithdrawRequest.WithdrawAmount = WithdrawAmount;
     _EwalletWithdrawRequest.UserId         = Guid.Parse(UserID);
     _EwalletWithdrawRequestRepository.Add(_EwalletWithdrawRequest);
 }
Пример #5
0
        //[WebMethod]
        //[ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
        public string SendNewsLetter(string body, string Subject, string userid, string NewsLetterId)
        {
            UserRepository objUserRepository = new UserRepository();

            Domain.Myfashion.Domain.User objUser = new Domain.Myfashion.Domain.User();
            string res = string.Empty;
            string ret = string.Empty;

            try
            {
                string from     = ConfigurationManager.AppSettings["fromemail"];
                string tomail   = ConfigurationManager.AppSettings["tomail"];
                string username = ConfigurationManager.AppSettings["Mandrillusername"];
                string host     = ConfigurationManager.AppSettings["Mandrillhost"];
                string port     = ConfigurationManager.AppSettings["Mandrillport"];
                string pass     = ConfigurationManager.AppSettings["Mandrillpassword"];


                //string sss = ConfigurationSettings.AppSettings["host"];
                objUser = objUserRepository.getUsersById(Guid.Parse(userid));

                GlobusMailLib.MailHelper objMailHelper = new GlobusMailLib.MailHelper();

                ret = objMailHelper.SendMailByMandrill(host, Convert.ToInt32(port), from, "", objUser.EmailId, string.Empty, string.Empty, Subject, body, username, pass);
                //NewsLetterRepository objNewsLetterRepository = new NewsLetterRepository();

                if (ret.Contains("Success"))
                {
                    ObjNewsLetter.Id         = Guid.Parse(NewsLetterId);
                    ObjNewsLetter.SendStatus = true;
                    ObjNewsLetterRepository.UpdateNewsLetter(ObjNewsLetter);
                    //lstbox.Items.Add("Mail send to : " + objUser.UserName);
                }
                //return ret;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return(ret);
        }
        public string GetTicketsofGroup(string GroupId, string UserId)
        {
            string AssignedUser = string.Empty;

            try
            {
                GroupProfileRepository objGroupProfileRepository = new GroupProfileRepository();
                FacebookFeedRepository objFacebookFeedRepository = new FacebookFeedRepository();
                TwitterFeedRepository  objTwitterFeedRepository  = new TwitterFeedRepository();
                List <Domain.Myfashion.Domain.FeedSentimentalAnalysis> lstNegativeFeedsOfUser = new List <Domain.Myfashion.Domain.FeedSentimentalAnalysis>();
                List <Domain.Myfashion.Domain.GroupProfile>            objGroupProfile        = new List <Domain.Myfashion.Domain.GroupProfile>();
                List <FBTwitterFeeds> objListFBTwitterFeeds = new List <FBTwitterFeeds>();

                objGroupProfile = objGroupProfileRepository.getAllGroupProfiles(Guid.Parse(UserId), Guid.Parse(GroupId));

                if (objGroupProfile.Count > 0)
                {
                    lstNegativeFeedsOfUser = _FeedSentimentalAnalysisRepository.getAllNegativeFeedsOfUser(Guid.Parse(UserId));
                }
                else
                {
                    lstNegativeFeedsOfUser = _FeedSentimentalAnalysisRepository.getNegativeFeedsOfUser(Guid.Parse(UserId));
                }
                if (lstNegativeFeedsOfUser != null)
                {
                    foreach (var item in lstNegativeFeedsOfUser)
                    {
                        FBTwitterFeeds objFBTwitterFeeds  = new FBTwitterFeeds();
                        UserRepository objUserRepository  = new UserRepository();
                        Domain.Myfashion.Domain.User user = objUserRepository.getUsersById(item.AssigneUserId);
                        if (objGroupProfileRepository.checkProfileExistsingroup(Guid.Parse(GroupId), item.ProfileId))
                        {
                            string Network = item.Network;
                            if (Network == "facebook")
                            {
                                Domain.Myfashion.Domain.FacebookFeed facebookfeed = objFacebookFeedRepository.getFacebookFeedByProfileId(item.ProfileId, item.FeedId);
                                if (facebookfeed != null)
                                {
                                    objFBTwitterFeeds.FacebookFeed = facebookfeed;
                                }
                            }
                            if (Network == "twitter")
                            {
                                Domain.Myfashion.Domain.TwitterFeed twtfeed = objTwitterFeedRepository.getTwitterFeedByProfileId(item.ProfileId, item.FeedId);
                                if (twtfeed != null)
                                {
                                    objFBTwitterFeeds.TwitterFeed = twtfeed;
                                }
                            }
                            if (objFBTwitterFeeds.TwitterFeed != null)
                            {
                                try
                                {
                                    objFBTwitterFeeds.TicketNo = item.TicketNo;
                                    if (user != null)
                                    {
                                        objFBTwitterFeeds.AssignedUser = user.UserName;
                                    }
                                    else
                                    {
                                        objFBTwitterFeeds.AssignedUser = "";
                                    }
                                    objListFBTwitterFeeds.Add(objFBTwitterFeeds);
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }
                            }
                            if (objFBTwitterFeeds.FacebookFeed != null)
                            {
                                try
                                {
                                    objFBTwitterFeeds.TicketNo = item.TicketNo;
                                    if (user != null)
                                    {
                                        objFBTwitterFeeds.AssignedUser = user.UserName;
                                    }
                                    else
                                    {
                                        objFBTwitterFeeds.AssignedUser = "";
                                    }
                                    objListFBTwitterFeeds.Add(objFBTwitterFeeds);
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }
                            }
                        }
                    }
                }

                return(new JavaScriptSerializer().Serialize(objListFBTwitterFeeds));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return("SomethingWentWrong");
            }
        }
        public string getUsersById(string UserId)
        {
            UserRepository userrepo = new UserRepository();
            if (!User.Identity.IsAuthenticated)
            {
                return "Unauthorized access";
            }
            Domain.Myfashion.Domain.User objUser = new Domain.Myfashion.Domain.User();
            objUser = userrepo.getUsersById(Guid.Parse(UserId));

            return new JavaScriptSerializer().Serialize(objUser);
        }