Example #1
0
    IEnumerator UploadUserItem(string email)
    {
        inFirst = true;
        WWW       www;
        Hashtable postHeader = new Hashtable();

        postHeader.Add("Content-Type", "application/json");

        UserEmail ue = new UserEmail();

        ue.setEmail(email);
        // convert json string to byte
        string json     = JsonUtility.ToJson(ue);
        var    formData = System.Text.Encoding.UTF8.GetBytes(json);

        Debug.Log("1");
        www = new WWW("http://localhost:8080/api/getItems", formData, postHeader);

        yield return(www);

        Debug.Log("ITEM LIST");
        Debug.Log(www.text);
        items = JsonUtility.FromJson <Items>(www.text);
        foreach (Item item in items.userItemList)
        {
            Debug.Log(item.itemName);
            itemList.Add(item.itemName);
        }
        Debug.Log("END");
        inFirst = false;
    }
 public ApplicationUser(string userName, UserEmail email) : this(userName)
 {
     if (email != null)
     {
         Email = email;
     }
 }
Example #3
0
        //1st method
        // async Task ExecuteLoadCoffeesCommandAsync()
        public async void ExecuteLoadCoffeesCommandAsync()
        {
            azureService = new AzureService();
            string enteredEmail    = email.Text;
            string enteredPassword = pass.Text;

            bool   login = false;
            string Name;

            try
            {
                login = await azureService.GetCoffee(enteredEmail, enteredPassword);

                Name = await azureService.GetUserName(enteredEmail, enteredPassword);

                UserName.Add(Name);
                if (login == true)
                {
                    UserEmail.Add(enteredEmail);
                    await Navigation.PushAsync(new MenuPage(Name));

                    pass.Text = "";
                }
                if (login == false)
                {
                    await DisplayAlert("Alert", "Email and/or Password is incorrect", "ok");
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("OH NO! " + ex);
            }
        }
Example #4
0
    IEnumerator UploadUserHeroes(string email)
    {
        //inFirst = true;
        WWW       www;
        Hashtable postHeader = new Hashtable();

        postHeader.Add("Content-Type", "application/json");

        UserEmail ue = new UserEmail();

        ue.setEmail(email);
        // convert json string to byte
        string json     = JsonUtility.ToJson(ue);
        var    formData = System.Text.Encoding.UTF8.GetBytes(json);

        Debug.Log("8719236");
        www = new WWW("http://localhost:8080/api/getHeroesByUser", formData, postHeader);

        yield return(www);

        userHeroesObject = JsonUtility.FromJson <UserHeroes>(www.text);
        Debug.Log("HERE LIST");
        Debug.Log(www.text);
        foreach (HeroCustom heroCustom in userHeroesObject.userHeroes)
        {
            Debug.Log("ID HEROES");
            Debug.Log(heroCustom.levelPath);
            heroesList.Add(heroCustom.heroId);
        }
        Debug.Log(heroesList[0]);
        Debug.Log(heroesList[1]);
        Debug.Log("END LIST");
        //inFirst = false;
    }
 public ApplicationUser(string userName, string email) : this(userName)
 {
     if (email != null)
     {
         Email = new UserEmail(email);
     }
 }
    /// <summary>
    /// /added by vishal 30-05-2012
    /// </summary>
    protected void btnMapAll_Click(object sender, EventArgs e)
    {
        UserEmail obj1 = new UserEmail();
        DataTable dt   = BindGridMapAll();

        if (dt != null)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["Emailid"].ToString() != "")
                {
                    objuseremail.Userid  = Convert.ToInt32(dt.Rows[i]["Userid"]);
                    objuseremail.Emailid = dt.Rows[i]["Emailid"].ToString();
                    obj1 = obj1.Get_By_id(objuseremail.Userid);
                    if (obj1.Userid != objuseremail.Userid)
                    {
                        objuseremail.Insert();
                    }
                    if (obj1.Active == 0)
                    {
                        obj1.Active  = 1;
                        obj1.Userid  = objuseremail.Userid;
                        obj1.Emailid = objuseremail.Emailid;
                        obj1.Update();
                    }
                }
            }
            BindGrid();
            string myScript;
            myScript = "<script language=javascript>alert('All user mapping successfully !');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void btnsave_Click(object sender, EventArgs e)
    {
        DataTable dtMealTemplate = new DataTable();
        SqlDataProvider db = new SqlDataProvider();
        dtMealTemplate.Columns.Add("Userid", Type.GetType("System.Int32"));
        dtMealTemplate.Columns.Add("Emailid", Type.GetType("System.String"));
        foreach (GridViewRow gvr in grdvwSite.Rows)
        {
            ///DataRow drMT = new DataRow();

            DataRow drMT = dtMealTemplate.NewRow();
            drMT["Userid"] = gvr.Cells[1].Text;
            drMT["Emailid"] = gvr.Cells[4].Text;

            dtMealTemplate.Rows.Add(drMT);
            CheckBox myCheckBox = (CheckBox)gvr.FindControl("CheckAll");
            if (myCheckBox.Checked == true)
            {
                UserEmail obj1 = new UserEmail();

                objuseremail.Userid = Convert.ToInt16(drMT["Userid"]);
                objuseremail.Emailid = drMT["Emailid"].ToString();
                objsentuseremail.SentFeedbackmailToUser(objuseremail.Userid, objuseremail.Emailid);
                objuseremail.InsertFeedbackCustomer();

            }
        }
    }
    protected void btnreject_Click(object sender, EventArgs e)
    {
        DataTable dtMealTemplate = new DataTable();


        dtMealTemplate.Columns.Add("Userid", Type.GetType("System.Int32"));
        dtMealTemplate.Columns.Add("Emailid", Type.GetType("System.String"));
        foreach (GridViewRow gvr in grdvwSite.Rows)
        {
            ///DataRow drMT = new DataRow();

            DataRow drMT = dtMealTemplate.NewRow();
            drMT["Userid"]  = gvr.Cells[1].Text;
            drMT["Emailid"] = gvr.Cells[4].Text;

            dtMealTemplate.Rows.Add(drMT);
            CheckBox myCheckBox = (CheckBox)gvr.FindControl("CheckAll");
            if (myCheckBox.Checked == false)
            {
                UserEmail obj1 = new UserEmail();

                objuseremail.Userid  = Convert.ToInt32(drMT["Userid"]);
                objuseremail.Emailid = drMT["Emailid"].ToString();
                objuseremail.Active  = 0;
                obj1 = obj1.Get_By_id(objuseremail.Userid);
                if (obj1.Userid == objuseremail.Userid)
                {
                    objuseremail.Update();
                }
            }
        }
    }
        private async Task sendEmail(UserEmail userEmail)
        {
            MailMessage mail = new MailMessage
            {
                Subject    = userEmail.Subject,
                Body       = userEmail.Body,
                From       = new MailAddress(_smtpconfigru.SenderAddress, _smtpconfigru.SenderDisplyName),
                IsBodyHtml = _smtpconfigru.IsBodyHTML,
            };

            mail.To.Add(userEmail.ToEmail);
            NetworkCredential networkCredential = new NetworkCredential
            {
                UserName = _smtpconfigru.UserName,
                Password = _smtpconfigru.Password,
            };
            SmtpClient smtpClient = new SmtpClient
            {
                Host                  = _smtpconfigru.Host,
                Port                  = _smtpconfigru.Port,
                EnableSsl             = _smtpconfigru.EnableSSL,
                UseDefaultCredentials = _smtpconfigru.UserDefaultCredentils,
                Credentials           = networkCredential,
            };

            mail.BodyEncoding = Encoding.Default;
            await smtpClient.SendMailAsync(mail);
        }
Example #10
0
        public ActionResult <ItemResponse <UserEmail> > GetByEmail(string email)
        {
            int          iCode    = 200;
            BaseResponse response = null;

            try
            {
                UserEmail userEmail = _userService.GetByEmail(email);

                if (userEmail == null)
                {
                    iCode    = 404;
                    response = new ErrorResponse("Application Resource Not Found");
                }
                else
                {
                    Guid recoverToken = Guid.NewGuid();
                    _userService.AddToken((int)TokenType.ResetPassword, userEmail.Id, recoverToken);
                    _emailService.PasswordRecoveryEmail(email, recoverToken);
                    response = new ItemResponse <UserEmail> {
                        Item = userEmail
                    };
                }
            }
            catch (Exception ex)
            {
                iCode    = 500;
                response = new ErrorResponse(ex.Message);
                base.Logger.LogError(ex.ToString());
            }

            return(StatusCode(iCode, response));
        }
Example #11
0
        public void CreateTherapistUserApplication()
        {
            Pages.UsersManagement_Page.GoTo();

            CreateUser.ClickWait();
            softAssert.VerifyElementPresentInsideWindow(UserCancelBtn, UserCancelBtn);
            UserName.EnterClearText(Constant.userName + RandomNumber.smallNumber());
            UserContinueBtn.ClickOn();
            softAssert.VerifyElementPresentInsideWindow(UserEmailVerification, UserCancelBtn);
            UserLastname.EnterClearText(Constant.userLastName);
            UserEmail.EnterClearText("doctor" + RandomNumber.smallNumber() + "@doctorwin.co.il");
            UserMobile.EnterClearText(Constant.userPhone);
            UserContinueBtn.ClickOn();
            softAssert.VerifyElementPresentInsideWindow(UserGoBack, UserCancelBtn);
            TherapistActiveBtn.ClickOn();
            TherapistDropdownPractice.ClickOn();
            List <IWebElement> practiceList = Browser.Driver.FindElements(By.XPath("//*[@id='PractiseID_listbox']/li")).ToList();
            var lastValue = practiceList[practiceList.Count - 1];

            lastValue.ClickOn();
            UserContinueBtn.ClickOn();
            SelectBusinessOnUserCreate.Click();
            var branchID = BranchIdOnUserCreate.GetAttribute("value");

            Browser.Driver.FindElement(By.CssSelector("#branchID" + branchID + " > label")).ClickOn();
            UserContinueBtn.Click();
            softAssert.VerifyElementPresentInsideWindow(Pages.Home_Page.ErrorPopup, UserCancelBtn);
            SelectDepartmentOnUserCreate.Click();
            UserContinueBtn.Click();
            therapistSchedulerSetup();
            UserContinueBtn.ClickOn();
            softAssert.VerifySuccessMsg();
        }
Example #12
0
        //create a create user
        public void CreateUserApplication()
        {
            Pages.UsersManagement_Page.GoTo();
            CreateUser.ClickWait();

            softAssert.VerifyElementPresentInsideWindow(UserCancelBtn, UserCancelBtn);
            UserName.EnterClearText(Constant.userName);
            UserContinueBtn.ClickOn();
            softAssert.VerifyElementPresentInsideWindow(UserEmailVerification, UserCancelBtn);
            UserLastname.EnterClearText(Constant.userLastName);
            UserEmail.EnterClearText(Constant.userEmail);
            UserMobile.EnterClearText(Constant.userPhone);
            UserContinueBtn.ClickOn();
            softAssert.VerifyElementPresentInsideWindow(UserGoBack, UserCancelBtn);
            UserContinueBtn.ClickOn();
            SelectBusinessOnUserCreate.ClickOn();
            var branchID = BranchIdOnUserCreate.GetAttribute("value");

            Browser.Driver.FindElement(By.CssSelector("#branchID" + branchID + " > label")).ClickOn();
            UserContinueBtn.ClickOn();
            softAssert.VerifyElementPresentInsideWindow(Pages.Home_Page.ErrorPopup, UserCancelBtn);
            SelectDepartmentOnUserCreate.ClickOn();
            UserContinueBtn.ClickOn();
            softAssert.VerifySuccessMsg();
        }
    protected void btnreject_Click(object sender, EventArgs e)
    {
        DataTable dtMealTemplate = new DataTable();

        dtMealTemplate.Columns.Add("Userid", Type.GetType("System.Int32"));
        dtMealTemplate.Columns.Add("Emailid", Type.GetType("System.String"));
        foreach (GridViewRow gvr in grdvwSite.Rows)
        {
        ///DataRow drMT = new DataRow();

        DataRow drMT = dtMealTemplate.NewRow();
        drMT["Userid"] = gvr.Cells[1].Text;
        drMT["Emailid"] = gvr.Cells[4].Text;

        dtMealTemplate.Rows.Add(drMT);
        CheckBox myCheckBox = (CheckBox)gvr.FindControl("CheckAll");
        if (myCheckBox.Checked == false)
        {
            UserEmail obj1 = new UserEmail();

            objuseremail.Userid = Convert.ToInt16(drMT["Userid"]);
            objuseremail.Emailid = drMT["Emailid"].ToString();
            objuseremail.Active = 0;
            obj1 = obj1.Get_By_id(objuseremail.Userid);
            if (obj1.Userid == objuseremail.Userid)
            {
                objuseremail.Update();
            }
        }
        }
    }
    protected void grdvwSite_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ////////////////////////////meenakshi
            if ((e.Row.Cells[1].Text) != "&nbsp;")
            {
                /////////////////end
                int userid = Convert.ToInt32(e.Row.Cells[1].Text);


                UserEmail objemail   = new UserEmail();
                CheckBox  myCheckBox = (CheckBox)e.Row.FindControl("CheckAll");
                //CheckBox myCheckBox = new CheckBox();
                objemail = objemail.Get_By_id(userid);
                if (objemail.Userid == userid)
                {
                    if (objemail.Active == 1)
                    {
                        // myCheckBox.Checked = true;
                        myCheckBox.Checked = true;
                    }
                    else
                    {
                        myCheckBox.Checked = false;
                    }
                }
            }
        }
    }
        public UserEmail CreateUserEmail(UserEmail userEmail)
        {
            db.UserEmails.Add(userEmail);
            db.SaveChanges();

            return(userEmail);
        }
Example #16
0
        protected override void Execute(CodeActivityContext context)
        {
            // Get the connection string
            DBConnection ext = context.GetExtension <DBConnection>();

            if (ext == null)
            {
                throw new InvalidProgramException("No connection string available");
            }

            RequestDataContext dc = new RequestDataContext(ext.ConnectionString);

            // Create and initialize a Request object
            Request r = new Request();

            r.UserName         = UserName.Get(context);
            r.UserEmail        = UserEmail.Get(context);
            r.RequestType      = RequestType.Get(context);
            r.Comment          = Comment.Get(context);
            r.CreateDate       = DateTime.UtcNow;
            r.RequestKey       = RequestKey.Get(context);
            r.QueueInstanceKey = QueueInstanceKey.Get(context);

            // Insert the Request record
            PersistRequest persist = context.GetExtension <PersistRequest>();

            persist.AddRequest(r);
        }
        public void Post([FromBody] UserEmail mail)
        {
            RegisterUsers registerUsers = new RegisterUsers();

            registerUsers.Name                      = mail.Name;
            registerUsers.Surname                   = mail.Surname;
            registerUsers.RegisterUsersEmails       = new RegisterUsersEmails();
            registerUsers.RegisterUsersEmails.Email = mail.Email;

            databaseBTCContext.RegisterUsers.Add(registerUsers);
            databaseBTCContext.SaveChanges();

            ValidationCodes validationCodes = new ValidationCodes();

            validationCodes.IdUser = registerUsers.IdUser;

            databaseBTCContext.ValidationCodes.Add(validationCodes);
            databaseBTCContext.SaveChanges();

            Wallet wallet = new Wallet();

            wallet.AdressName = string.Format("Wallet adress for: {0}", validationCodes.IdCode);
            wallet.IdCode     = validationCodes.IdCode;

            databaseBTCContext.Wallet.Add(wallet);
            databaseBTCContext.SaveChanges();

            sendEmail(registerUsers, validationCodes);
        }
Example #18
0
        public async Task <IActionResult> forgotpassword(forgotpasswordViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = await userManager.FindByEmailAsync(model.Email);

                if (user != null)
                {
                    var token = await userManager.GeneratePasswordResetTokenAsync(user);

                    var passwordresetlink = Url.Action("resetPassword", "Account",
                                                       new { email = model.Email, token = token }, Request.Scheme);

                    UserEmail userEmail = new UserEmail
                    {
                        ToEmail = model.Email,
                    };
                    var arr  = new List <KeyValuePair <string, string> >();
                    var temp = new KeyValuePair <string, string>("{{passwordlink}}", passwordresetlink);

                    //temp.Key = "username";
                    //temp.Value = "*****@*****.**";
                    arr.Add(temp);
                    userEmail.PlaceHolder = arr;
                    await emailService.ForgotpasswordEmail(userEmail);

                    ViewBag.msg = "We send Password reset link To your account";
                    return(View());
                }
                ModelState.AddModelError(string.Empty, "Your Account is not found");
                return(View());
            }
            return(View());
        }
Example #19
0
        private void DeleteEmailSql(int emailId, string uid, JObject responseData)
        {
            UserEmail userEmail = NHibernateHelper.userEmailManager.GetEmail(emailId, uid);

            if (userEmail == null)
            {
                MySqlService.log.Warn("该邮件不存在");
                OperatorFail(responseData);
            }
            else
            {
                //已读
                if (userEmail.State == 1)
                {
                    if (NHibernateHelper.userEmailManager.Delete(userEmail))
                    {
                        OperatorSuccess(responseData);
                        MySqlService.log.Info("删除邮件成功:" + uid);
                    }
                    else
                    {
                        MySqlService.log.Warn("删除邮件失败");
                        OperatorFail(responseData);
                    }
                }
                else
                {
                    MySqlService.log.Warn("该邮件未读");
                    OperatorFail(responseData);
                }
            }
        }
 public void PopulatePageAndSubmit()
 {
     FirstName.SendKeys("Miller");
     LastName.SendKeys("John");
     UserEmail.SendKeys("*****@*****.**");
     Gender.Click();
     MobileNumber.SendKeys("0751123456");
     DateOfBirth.Click();
     Month.Click();
     Year.Click();
     Day.Click();
     Subjects.SendKeys("Test subjects");
     Thread.Sleep(2000);
     Hobbies.Click();
     ((IJavaScriptExecutor)_driver).ExecuteScript("arguments[0].scrollIntoView(true);", Picture);
     //Thread.Sleep(5000);
     //Picture.Click();
     CurrentAddress.SendKeys("Str. 13 Dec");
     Thread.Sleep(2000);
     StateDropDown.Click();
     StateOption.Click();
     CityDropDown.Click();
     CityOption.Click();
     Submit.Click();
 }
Example #21
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (UserEmail.Length != 0)
            {
                hash ^= UserEmail.GetHashCode();
            }
            if (deployTime_ != null)
            {
                hash ^= DeployTime.GetHashCode();
            }
            if (undeployTime_ != null)
            {
                hash ^= UndeployTime.GetHashCode();
            }
            if (Config.Length != 0)
            {
                hash ^= Config.GetHashCode();
            }
            if (Address.Length != 0)
            {
                hash ^= Address.GetHashCode();
            }
            hash ^= resourceUri_.GetHashCode();
            if (Platform != global::Grafeas.V1.DeploymentOccurrence.Types.Platform.Unspecified)
            {
                hash ^= Platform.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public IHttpActionResult GetUserType([FromBody] UserEmail useremail)
        {
            // Check if user's email is valid
            if (useremail.Email is null || useremail.Email == "")
            {
                return(NotFound());
            }

            // Get the User
            var RequestedUser = WmData.Users.FirstOrDefault(u => u.UserEmail == useremail.Email);

            // Get the Type GUID
            Guid?UserTypeID = RequestedUser.UserTypeId;

            // Find User Type
            UserType Type = WmData.UserTypes.FirstOrDefault(t => t.UserTypeId == UserTypeID);

            // If we have a type then return it
            if (Type != null)
            {
                return(Ok(Type.UserType_));
            }
            else
            {
                return(NotFound());
            }
        }
Example #23
0
        public HttpResponseMessage ByEmail()
        {
            string    JSONRequest = Request.Content.ReadAsStringAsync().Result;
            UserEmail request     = new UserEmail();

            try
            {
                request = JsonConvert.DeserializeObject <UserEmail>(JSONRequest, ALISSettings.ALISDateFormatJSONSettings);
            }
            catch
            {
                return(ALISErrorFactory.CreateError("G001", Request));
            }


            ReaderInfo reader;

            try
            {
                reader = ReaderInfo.GetReader(request.Email);
            }
            catch (Exception ex)
            {
                return(ALISErrorFactory.CreateError(ex.Message, Request));
            }
            if (reader == null)
            {
                return(ALISErrorFactory.CreateError("R004", Request));
            }
            ReaderSimpleView result = ReaderViewFactory.GetReaderSimpleView(reader);

            return(ALISResponseFactory.CreateResponse(result, Request));
        }
Example #24
0
 public ActionResult ForgotPass(UserEmail userEmail)
 {
     if (ModelState.IsValid)
     {
         UserPasswordData passData;
         try
         {
             passData = dataHelper.GetPasswordData(userEmail.Email);
             if (passData == null)
             {
                 ModelState.AddModelError("Email", "Пользователь с таким E-mail не зарегистрирован!");
                 return(View(userEmail));
             }
         }
         catch (Exception ex)
         {
             logger.ErrorMessage("305", ex);
             return(View("Error", new Error()
             {
                 ExDescription = ex.Message
             }));
         }
         if (emailHelper.SendRegistrationMessage(passData.Login, passData.passwordHash, userEmail.Email, EmailHelper.EmailType.ChangePassword))
         {
             logger.InfoMessage("201", $"Send change password email to {passData.Login} : {userEmail.Email}");
         }
         return(View("ChangePassLink", passData));
     }
     return(View());
 }
        public bool RegisterUser(UserEmail userEmail)
        {
            var registerEmailData = new EventData(
                Guid.NewGuid(),
                "REGISTEREMAIL",
                true,
                Encoding.UTF8.GetBytes(
                    "{emailaddress:" + userEmail.EmailAddress + "," +
                    "username:"******"," +
                    "password:"******"," +
                    "}"),
                new byte[] { }             // metaData... to be determined
                );

            try
            {
                EventStoreClient.Connection.AppendToStreamAsync(
                    _streamName,         // It's probably ok to use same stream for different events
                    ExpectedVersion.Any, // see docs...
                    registerEmailData);  // the event created above
            }
            catch (Exception ex)
            {
                // todo some sensible logging: could not Append to stream async?
                Console.WriteLine(ex);
                return(false); // or no try..catch and just bubble up the exception for console and webapi to handle it
            }
            return(true);
        }
        //CHECKOUT
        public string PutCheckOutIn(int bookToLendID, [FromBody] UserEmail data)
        {
            var db      = new DataContext();
            var Message = "";

            Book bookToLend = db.Books.First(book => book.ID == bookToLendID);

            if (bookToLend.IsCheckedOut == false)
            {
                bookToLend.IsCheckedOut = true;
                bookToLend.DueByDate    = DateTime.Now.AddDays(14);
                var newCheckout = new CheckOutLedger()
                {
                    Timestamp = DateTime.Now,
                    UserEmail = data.Email,
                    BookID    = bookToLend.ID,
                    Book      = bookToLend
                };
                db.CheckOutLedger.Add(newCheckout);
                db.SaveChanges();
                //FROM LECTURE: Use a view model for message (bc scaling)
                Message = $"You have checked out {bookToLend.Title}. It is due by {bookToLend.DueByDate}";
            }
            else
            {
                bookToLend.IsCheckedOut = false;
                bookToLend.DueByDate    = null;
                Message = $"This book is unavailable for checkout.";
            }
            return(Message);
        }
Example #27
0
        // Create documents with class - instances.
        public async Task CreateDocuments()
        {
            Console.Clear();
            Console.WriteLine("Add Email");
            string email = Console.ReadLine();

            Console.WriteLine("Add a photo url");
            string photoUrl = Console.ReadLine();

            if (email.Trim().Length > 0 && photoUrl.Trim().Length > 0)
            {
                if (DataContext.IsValid(email))
                {
                    emailDoc = new UserEmail(email);
                    photoDoc = new UserPhoto(photoUrl, email);
                    InsertUserIfNotExists();
                }
                else
                {
                    Console.WriteLine("That Email is not valid. Try Again!");
                    Thread.Sleep(2000);
                }
            }
            else
            {
                Console.WriteLine("Enter both email & photo url to add user!");
                Thread.Sleep(2000);
            }
            Console.Clear();
        }
Example #28
0
        public async Task Exec(IScenarioContext context)
        {
            var data = await SqModelSelectBuilder
                       .Select(Customer.GetReader())
                       .InnerJoin(
                OrderDateCreated.GetReader(),
                on: t => t.Table.CustomerId == t.JoinedTable1.CustomerId)
                       .LeftJoin(
                UserEmail.GetReader(),
                on: t => t.Table.UserId == t.JoinedTable2.UserId)
                       .LeftJoin(
                CompanyName.GetReader(),
                on: t => t.Table.CompanyId == t.JoinedTable3.CompanyId)
                       .Find(0,
                             10,
                             null,
                             t => SqQueryBuilder.Desc(SqQueryBuilder.IsNull(t.JoinedTable2.FirstName, t.JoinedTable3.CompanyName)).ThenBy(t.JoinedTable1.DateCreated),
                             d =>
                             new
            {
                Client = d.JoinedModel2?.Email ?? d.JoinedModel3?.Name ?? "Unknown",
                Date   = d.JoinedModel1.DateCreated.ToString("s")
            })
                       .QueryPage(context.Database);

            if (data.Total != 8397 && data.Total != 8438 /*MySQL*/)
            {
                throw new Exception($"8397 is expected but was {data.Total}");
            }
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (UserEmail.Length != 0)
            {
                hash ^= UserEmail.GetHashCode();
            }
            if (deployTime_ != null)
            {
                hash ^= DeployTime.GetHashCode();
            }
            if (undeployTime_ != null)
            {
                hash ^= UndeployTime.GetHashCode();
            }
            if (Config.Length != 0)
            {
                hash ^= Config.GetHashCode();
            }
            if (Address.Length != 0)
            {
                hash ^= Address.GetHashCode();
            }
            hash ^= resourceUri_.GetHashCode();
            if (Platform != 0)
            {
                hash ^= Platform.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #30
0
        public async Task <IActionResult> AppRegister(AppRegisterAddressModel model)
        {
            bool exists = _dbContext.UserEmails.Exists(t => t.EmailAddress == model.Email.ToLower());

            if (exists)
            {
                return(this.Protocal(ErrorType.NotEnoughResources, $"A user with email '{model.Email}' already exists!"));
            }
            var user = new APIUser
            {
                UserName         = model.Email,
                Email            = model.Email,
                NickName         = model.Email.Split('@')[0],
                PreferedLanguage = "en",
                HeadImgUrl       = $"{ _serviceLocation.CDN}/images/userdefaulticon.png"
            };
            var result = await _userManager.CreateAsync(user, model.Password);

            if (result.Succeeded)
            {
                var primaryMail = new UserEmail
                {
                    EmailAddress = model.Email.ToLower(),
                    OwnerId      = user.Id
                };
                _dbContext.UserEmails.Add(primaryMail);
                await _dbContext.SaveChangesAsync();

                return(this.Protocal(ErrorType.Success, "Successfully created your account."));
            }
            return(this.Protocal(ErrorType.NotEnoughResources, result.Errors.First().Description));
        }
Example #31
0
        public async Task ForgotPassword(UserEmail model)
        {
            string tempPassword = _passwordService. //protected
                                  string salt = BCrypt.BCryptHelper.GenerateSalt();
            string hashedPassword = BCrypt.BCryptHelper.HashPassword(tempPassword, salt);

            _passwordService.Update(model.EmailAddress, hashedPassword);

            ForgotPassword email = new ForgotPassword();
            var            msg   = new SendGridMessage()
            {
                From        = new EmailAddress(_config.Email, _config.Sender),
                Subject     = email.Subject,
                HtmlContent = email.HtmlContent
            };
            Dictionary <string, string> subs = new Dictionary <string, string>
            {
                { "-subject-", "Forgot Password" },
                { "-tempPassword-", tempPassword },
                { "-siteUrl-", _siteConfig.SiteUrl }
            };

            msg.AddSubstitutions(subs);
            msg.AddTo(new EmailAddress(model.EmailAddress, email.Recipient));
            await Send(msg);
        }
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="UserEmailDTO"/> converted from <see cref="UserEmail"/>.</param>
 static partial void OnDTO(this UserEmail entity, UserEmailDTO dto)
 {
     if (entity != null && entity.Email != null)
     {
         dto.Email = EmailAssembler.ToDTO(entity.Email);
     }
 }
    protected void grdvwSite_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            int userid = Convert.ToInt32(e.Row.Cells[1].Text);
            UserEmail objemail = new UserEmail();
            CheckBox myCheckBox = (CheckBox)e.Row.FindControl("CheckAll");
            //CheckBox myCheckBox = new CheckBox();
            objemail = objemail.Get_By_id(userid);
            if (objemail.Userid == userid)
            {
                if (objemail.Active == 1)
                {

                    // myCheckBox.Checked = true;
                    myCheckBox.Checked = true;

                }
                else
                {

                    myCheckBox.Checked = false;
                }
            }
        }
    }
 /// <summary>
 /// /added by vishal 30-05-2012
 /// </summary>
 protected void btnMapAll_Click(object sender, EventArgs e)
 {
     UserEmail obj1 = new UserEmail();
     DataTable dt = BindGridMapAll();
     if (dt != null)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             if (dt.Rows[i]["Emailid"].ToString() != "")
             {
                 objuseremail.Userid = Convert.ToInt32(dt.Rows[i]["Userid"]);
                 objuseremail.Emailid = dt.Rows[i]["Emailid"].ToString();
                 obj1 = obj1.Get_By_id(objuseremail.Userid);
                 if (obj1.Userid != objuseremail.Userid)
                 {
                     objuseremail.Insert();
                 }
                 if (obj1.Active == 0)
                 {
                     obj1.Active = 1;
                     obj1.Userid = objuseremail.Userid;
                     obj1.Emailid = objuseremail.Emailid;
                     obj1.Update();
                 }
             }
         }
         BindGrid();
         string myScript;
         myScript = "<script language=javascript>alert('All user mapping successfully !');</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         return;
     }
 }
		protected internal void RemoveEmail(UserEmail item) => this.EmailCollection.Remove(item);
 public int Insert_UserToEmail_mst(UserEmail objuseremail)
 {
     return (int)ExecuteNonQuery(Sp_UserToEmail_Insert, new object[] { objuseremail.Userid, objuseremail.Emailid });
 }
		protected internal void AddEmail(UserEmail item) => this.EmailCollection.Add(item);
    public object GenerateUserEmail_mstObject(ref IDataReader returnData)
    {
        UserEmail obj = new UserEmail();
        while (returnData.Read())
        {
            obj.Userid = (int)returnData["userid"];
            obj.Emailid = (string)returnData["emailid"];
            obj.Active = (int)returnData["Active"];

        }
        returnData.Close();
        returnData.Dispose();
        return obj;
    }
 public int Update_UserEmail_mst_By_id(UserEmail objUserEmail)
 {
     return (int)ExecuteNonQuery(Sp_UserEmail_Update, new object[] { objUserEmail.Emailid, objUserEmail.Active, objUserEmail.Userid });
 }
Example #40
0
 public NotificationRule(int DeptID, int NotificationRuleID)
 {
     DataRow _row = TicketCriterias.SelectOneForNotificationRule(DeptID, NotificationRuleID);
     if (_row != null) m_TicketCriteria = new TicketCriterias.TicketCriteria(DeptID, (int)_row["Id"]);
     else m_TicketCriteria = new TicketCriterias.TicketCriteria(DeptID);
     m_TicketCriteria.NotificationRuleID = NotificationRuleID;
     _row = SelectOne(DeptID, NotificationRuleID);
     if (_row == null) return;
     m_Name = _row["RuleName"].ToString();
     m_Inactive = (bool)_row["btInactive"];
     if (!_row.IsNull("UserId")) m_UserId = (int)_row["UserId"];
     m_BuiltIn = (bool)_row["btBuiltIn"];
     m_ForTech = (bool)_row["btForTech"];
     this.ReadOnly = (bool)_row["ReadOnly"];
     m_ReceiveTriggerEvents = (bool)_row["btReceiveTriggerEvents"];
     DataTable _dt = SelectEvents(DeptID, NotificationRuleID);
     foreach (DataRow _r in _dt.Rows) m_TicketEvents[(byte)_r["EventType"]] = true;
     _dt = SelectUsers(DeptID, NotificationRuleID);
     if (_dt.Rows.Count > 0) m_UserEmail = (UserEmail)(byte)_dt.Rows[0]["NotificationEmail"];
 }
 public int Insert_FeedbackCustomer_mst(UserEmail objuseremail)
 {
     return (int)ExecuteNonQuery(Sp_FeedbackCustomer_Insert, new object[] { objuseremail.Userid, objuseremail.Emailid });
 }
Example #42
0
 public NotificationRule(int DeptID, bool IsForTech)
     : this(DeptID)
 {
     m_ForTech = IsForTech;
     m_BuiltIn = true;
     DataRow _row = SelectOne(DeptID, IsForTech);
     int _id = 0;
     if (_row != null)
     {
         _id = (int)_row["Id"];
         m_ReceiveTriggerEvents = (bool)_row["btReceiveTriggerEvents"];
     }
     DataTable _dt = SelectEvents(DeptID, IsForTech);
     if (_dt.Rows.Count > 0)
     {
         foreach (DataRow _r in _dt.Rows) m_TicketEvents[(byte)_r["EventType"]] = true;
     }
     else
     {
         for (int i = 0; i < m_TicketEvents.Length; i++) m_TicketEvents[i] = true;
     }
     _dt = SelectUsers(DeptID, _id);
     if (_dt.Rows.Count > 0) m_UserEmail = (UserEmail)(byte)_dt.Rows[0]["NotificationEmail"];
 }
    public CollectionBase Generateuseremail_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<UserEmail> col = new BLLCollection<UserEmail>();
        while (returnData.Read())
        {

            UserEmail obj = new UserEmail();
            obj.Userid = (int)returnData["userid"];
            obj.Emailid = (string)returnData["emailid"];

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }