public string GetDetailsofBusinessOwner(string GroupId)
        {
            BusinessSettingRepository busnrepo = new BusinessSettingRepository();

            Domain.Myfashion.Domain.BusinessSetting ObjBsnsstng = busnrepo.GetDetailsofBusinessOwner(Guid.Parse(GroupId));
            try
            {
                if (ObjBsnsstng != null)
                {
                    return new JavaScriptSerializer().Serialize(ObjBsnsstng);
                }
                else
                {
                    return new JavaScriptSerializer().Serialize(ObjBsnsstng);
                }


            }
            catch (Exception ex)
            {

                throw;
                return null;
            }

        }
 //IsNotificationTaskEnable
 public string IsNotificationTaskEnable(Guid groupsId)
 {
     Domain.Myfashion.Domain.BusinessSetting objbsnssetting = new Domain.Myfashion.Domain.BusinessSetting();
     BusinessSettingRepository busnrepo = new BusinessSettingRepository();
     objbsnssetting = busnrepo.IsNotificationTaskEnable(groupsId);
     return new JavaScriptSerializer().Serialize(objbsnssetting);
 }
        //IsNotificationTaskEnable
        public string IsNotificationTaskEnable(Guid groupsId)
        {
            Domain.Myfashion.Domain.BusinessSetting objbsnssetting = new Domain.Myfashion.Domain.BusinessSetting();
            BusinessSettingRepository busnrepo = new BusinessSettingRepository();

            objbsnssetting = busnrepo.IsNotificationTaskEnable(groupsId);
            return(new JavaScriptSerializer().Serialize(objbsnssetting));
        }
        public string AddBusinessByUser(string ObjBusinessSetting)
        {
            Domain.Myfashion.Domain.BusinessSetting objbsnssetting = (Domain.Myfashion.Domain.BusinessSetting)(new JavaScriptSerializer().Deserialize(ObjBusinessSetting, typeof(Domain.Myfashion.Domain.BusinessSetting)));
            BusinessSettingRepository busnrepo = new BusinessSettingRepository();


            busnrepo.AddBusinessSetting(objbsnssetting);

            return(new JavaScriptSerializer().Serialize(objbsnssetting));
        }
        public string AddBusinessByUser(string ObjBusinessSetting)
        {
            Domain.Myfashion.Domain.BusinessSetting objbsnssetting = (Domain.Myfashion.Domain.BusinessSetting)(new JavaScriptSerializer().Deserialize(ObjBusinessSetting, typeof(Domain.Myfashion.Domain.BusinessSetting)));
            BusinessSettingRepository busnrepo = new BusinessSettingRepository();


            busnrepo.AddBusinessSetting(objbsnssetting);

            return new JavaScriptSerializer().Serialize(objbsnssetting);

        }
        public string GetDetailsofBusinessOwner(string GroupId)
        {
            BusinessSettingRepository busnrepo = new BusinessSettingRepository();

            Domain.Myfashion.Domain.BusinessSetting ObjBsnsstng = busnrepo.GetDetailsofBusinessOwner(Guid.Parse(GroupId));
            try
            {
                if (ObjBsnsstng != null)
                {
                    return(new JavaScriptSerializer().Serialize(ObjBsnsstng));
                }
                else
                {
                    return(new JavaScriptSerializer().Serialize(ObjBsnsstng));
                }
            }
            catch (Exception ex)
            {
                throw;
                return(null);
            }
        }
        public static string AddBusinessSetting(Guid userId, Guid groupsId, string groupsGroupName)
        {
            Domain.Myfashion.Domain.BusinessSetting objbsnssetting = new Domain.Myfashion.Domain.BusinessSetting();
            BusinessSettingRepository busnrepo = new BusinessSettingRepository();

            if (!busnrepo.checkBusinessExists(userId, groupsGroupName))
            {
                objbsnssetting.Id               = Guid.NewGuid();
                objbsnssetting.BusinessName     = groupsGroupName;
                objbsnssetting.GroupId          = groupsId;
                objbsnssetting.AssigningTasks   = false;
                objbsnssetting.AssigningTasks   = false;
                objbsnssetting.TaskNotification = false;
                objbsnssetting.TaskNotification = false;
                objbsnssetting.FbPhotoUpload    = 0;
                objbsnssetting.UserId           = userId;
                objbsnssetting.EntryDate        = DateTime.Now;
                busnrepo.AddBusinessSetting(objbsnssetting);

                return(new JavaScriptSerializer().Serialize(objbsnssetting));
            }
            return(null);
        }
        public static string AddBusinessSetting(Guid userId, Guid groupsId, string groupsGroupName)
        {
            Domain.Myfashion.Domain.BusinessSetting objbsnssetting = new Domain.Myfashion.Domain.BusinessSetting();
            BusinessSettingRepository busnrepo = new BusinessSettingRepository();

            if (!busnrepo.checkBusinessExists(userId, groupsGroupName))
            {
                objbsnssetting.Id = Guid.NewGuid();
                objbsnssetting.BusinessName = groupsGroupName;
                objbsnssetting.GroupId = groupsId;
                objbsnssetting.AssigningTasks = false;
                objbsnssetting.AssigningTasks = false;
                objbsnssetting.TaskNotification = false;
                objbsnssetting.TaskNotification = false;
                objbsnssetting.FbPhotoUpload = 0;
                objbsnssetting.UserId = userId;
                objbsnssetting.EntryDate = DateTime.Now;
                busnrepo.AddBusinessSetting(objbsnssetting);

                return new JavaScriptSerializer().Serialize(objbsnssetting);
            }
            return null;
        }
Ejemplo n.º 9
0
        public string Register(string EmailId, string Password, string AccountType, string Username,string Business_name, string ActivationStatus = "0")
        {
            UserRepository userrepo = new UserRepository();
            try
            {
                
                logger.Error("Register");

                if (!userrepo.IsUserExist(EmailId))
                {


                    Domain.Myfashion.Domain.User user = new Domain.Myfashion.Domain.User();
                    user.AccountType = AccountType;
                    user.EmailId = EmailId;
                    user.CreateDate = DateTime.Now;
                    user.ExpiryDate = DateTime.Now.AddDays(30);
                    user.Password = Utility.MD5Hash(Password);
                    user.PaymentStatus = "unpaid";
                    user.ProfileUrl = string.Empty;
                    user.TimeZone = string.Empty;
                    user.UserName = Username;
                    user.UserStatus = 1;
                    user.ActivationStatus = ActivationStatus;
                    user.Company = Business_name;
                    user.Id = Guid.NewGuid();
                    Guid PId =Guid.NewGuid();
                    user.PuId = PId.ToString()+Password;
                    user.Company_id = Guid.NewGuid();
                    UserRepository.Add(user);

                    try
                    {
                        Domain.Myfashion.Domain.Groups groups = AddGroupByUserId(user.Id);


                        BusinessSettingRepository busnrepo = new BusinessSettingRepository();
                        BusinessSetting.AddBusinessSetting(user.Id, groups.Id, groups.GroupName);
                        Team.AddTeamByGroupIdUserId(user.Id, user.EmailId, groups.Id);
                        Account.AddAccountByUserId(user.Id, user.Company, user.Company_id, user.EmailId);
                        UpdateTeam(EmailId, user.Id.ToString(), user.UserName);
                        try
                        {
                            Domain.Myfashion.Domain.Customers objcust = new Customers();
                            objcust.Activekeywordcount = 200;
                            objcust.Activeserpcampaignscount = 400;
                            objcust.Firstname = Username;
                            objcust.Allowedcampaignscount=200;
                            objcust.Allowedkeywordcount = 2000;
                            Customersrepository objcustrepo = new Customersrepository();
                            objcustrepo.Add(objcust);
                            int id= objcustrepo.lastRecord();
                            Domain.Myfashion.Domain.Users objusers = new Users();
                            objcust.Customerid = id;
                            objusers.Customers = objcust;
                            objusers.Loginid = EmailId;
                            objusers.Password = Password;
                            objusers.Active = 1;
                            objusers.Usertype = 0;
                            objusers.Token = "bcd213199780916aa7525d3972fa7bb15c1d1d31e955cfca5f7524b35ee5ee27_a373c25b036ac7ff";
                            
                            objusers.Addeddate = DateTime.Now;
                            UsersRepository.addUsers(objusers);

                        }
                        catch (Exception ex) {
                            Console.WriteLine(ex.Message);
                            logger.Error("Error : " + ex.Message);
                            logger.Error("Error : " + ex.StackTrace);
                        }

                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                        logger.Error("Error : " + ex.Message);
                        logger.Error("Error : " + ex.StackTrace);
                    }


                    return new JavaScriptSerializer().Serialize(user);
                }
                else
                {
                    return "Email Already Exists";
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }



        }
Ejemplo n.º 10
0
        public string Register(string EmailId, string Password, string AccountType, string Username, string Business_name, string ActivationStatus = "0")
        {
            UserRepository userrepo = new UserRepository();

            try
            {
                logger.Error("Register");

                if (!userrepo.IsUserExist(EmailId))
                {
                    Domain.Myfashion.Domain.User user = new Domain.Myfashion.Domain.User();
                    user.AccountType      = AccountType;
                    user.EmailId          = EmailId;
                    user.CreateDate       = DateTime.Now;
                    user.ExpiryDate       = DateTime.Now.AddDays(30);
                    user.Password         = Utility.MD5Hash(Password);
                    user.PaymentStatus    = "unpaid";
                    user.ProfileUrl       = string.Empty;
                    user.TimeZone         = string.Empty;
                    user.UserName         = Username;
                    user.UserStatus       = 1;
                    user.ActivationStatus = ActivationStatus;
                    user.Company          = Business_name;
                    user.Id = Guid.NewGuid();
                    Guid PId = Guid.NewGuid();
                    user.PuId       = PId.ToString() + Password;
                    user.Company_id = Guid.NewGuid();
                    UserRepository.Add(user);

                    try
                    {
                        Domain.Myfashion.Domain.Groups groups = AddGroupByUserId(user.Id);


                        BusinessSettingRepository busnrepo = new BusinessSettingRepository();
                        BusinessSetting.AddBusinessSetting(user.Id, groups.Id, groups.GroupName);
                        Team.AddTeamByGroupIdUserId(user.Id, user.EmailId, groups.Id);
                        Account.AddAccountByUserId(user.Id, user.Company, user.Company_id, user.EmailId);
                        UpdateTeam(EmailId, user.Id.ToString(), user.UserName);
                        try
                        {
                            Domain.Myfashion.Domain.Customers objcust = new Customers();
                            objcust.Activekeywordcount       = 200;
                            objcust.Activeserpcampaignscount = 400;
                            objcust.Firstname             = Username;
                            objcust.Allowedcampaignscount = 200;
                            objcust.Allowedkeywordcount   = 2000;
                            Customersrepository objcustrepo = new Customersrepository();
                            objcustrepo.Add(objcust);
                            int id = objcustrepo.lastRecord();
                            Domain.Myfashion.Domain.Users objusers = new Users();
                            objcust.Customerid = id;
                            objusers.Customers = objcust;
                            objusers.Loginid   = EmailId;
                            objusers.Password  = Password;
                            objusers.Active    = 1;
                            objusers.Usertype  = 0;
                            objusers.Token     = "bcd213199780916aa7525d3972fa7bb15c1d1d31e955cfca5f7524b35ee5ee27_a373c25b036ac7ff";

                            objusers.Addeddate = DateTime.Now;
                            UsersRepository.addUsers(objusers);
                        }
                        catch (Exception ex) {
                            Console.WriteLine(ex.Message);
                            logger.Error("Error : " + ex.Message);
                            logger.Error("Error : " + ex.StackTrace);
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                        logger.Error("Error : " + ex.Message);
                        logger.Error("Error : " + ex.StackTrace);
                    }


                    return(new JavaScriptSerializer().Serialize(user));
                }
                else
                {
                    return("Email Already Exists");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return("Something Went Wrong");
            }
        }