Exemplo n.º 1
0
 private void ClosingForm(object sender, FormClosingEventArgs e)
 {
     if (ViewModel != null && ViewModel.GetIsModified() && !Msgbox.DontSaveConfirm())
     {
         e.Cancel = true;
     }
 }
Exemplo n.º 2
0
        public ActionResult About(Msgbox obj)
        {
            try
            {
                //Configuring webMail class to send emails
                //gmail smtp server
                WebMail.SmtpServer = "smtp.gmail.com";
                //gmail port to send emails
                WebMail.SmtpPort = 587;
                WebMail.SmtpUseDefaultCredentials = true;
                //sending emails with secure protocol
                WebMail.EnableSsl = true;
                //EmailId used to send emails from application
                WebMail.UserName = "******";
                WebMail.Password = "******";

                //Sender email address.
                WebMail.From = "*****@*****.**";


                //Send email
                WebMail.Send(to: "*****@*****.**", subject: obj.EmailSubject, body: obj.EMailBody, cc: obj.EmailCC, bcc: obj.EmailBCC, isBodyHtml: true);
                ViewBag.Status = "Email Sent Successfully.";
            }
            catch (Exception)
            {
                ViewBag.Status = "Problem while sending email, Please check details.";
            }
            return(View());
        }
Exemplo n.º 3
0
        private void bLogin_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                string   userName = _vm.UserName;
                string   pwdMd5   = _vm.Password.GetMD5();
                UserInfo user     = EntityProvider.Instance.GetEntities(typeof(UserInfo), "userName=@p0 and PasswordMD5=@p1",// and ISNULL(Disabled,0)<>1",
                                                                        new SqlParameter("@p0", userName), new SqlParameter("@p1", pwdMd5)).Cast <UserInfo>().FirstOrDefault();

                if (user == null)
                {
                    lMsg.Visible = true;
                    ResetTimer();
                    return;
                }

                if (user.Disabled.GetValueOrDefault())
                {
                    Msgbox.Error("该用户名已经被停用。");
                    return;
                }

                DialogResult = DialogResult.OK;
                SaveUserHistory();
                ClientInfo.UserID        = user.ID;
                ClientInfo.UserLoginName = user.UserName;
                ClientInfo.UserName      = user.DisplayName;
                Close();
                //Hide();
                //ClientForm mainForm = new ClientForm();
                //ClientForm.LastInstance = mainForm;
                //mainForm.Show();
            }
        }
Exemplo n.º 4
0
        public bool Start(Configuration ConfigFromUI)
        {
            _container.Config = ConfigFromUI;


            try
            {
                _container.Start();

                Msgbox.ShowMsgbox("Manager started", "Manager is Running!", "", "", "OK");

                //for heirarchical stuff
                //				if (Config.Intermediate)
                //				{
                //					//Config.Id = Manager.Id;
                //					//Config.Dedicated = Manager.Dedicated;
                //				}
                return(true);
            }
            catch (Exception ex)
            {
                _container = null;
                string errorMsg = string.Format("Could not start Manager. Reason: {0}{1}", Environment.NewLine, ex.Message);
                if (ex.InnerException != null)
                {
                    errorMsg += string.Format("{0}", ex.InnerException.Message);
                }
                //Log(errorMsg);
                logger.Error(errorMsg, ex);
                return(false);
            }


            //Application should refresh UI controls now
        }
Exemplo n.º 5
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     Msgbox.Show("This is a test to see if the message box work");
     //Content.ToString();
 }
Exemplo n.º 6
0
 private void OnSubmitted()
 {
     Msgbox.Information("密码已经修改成功,请牢记新密码。");
     Close();
 }