protected void btnSubmit_Click(object sender, EventArgs e)
        {
            bool email    = reg.Email_Avaiable(txtEmail.Text);
            bool username = reg.UserName_Avaiable(txtUserName.Text);
            bool mobile   = reg.Mobile_Avaiable(txtMobileCode.Text + txtMobileNumber.Text);

            lblUserNameAvaility.Text = reg.UserNameIcon;
            lblEmailAvaiable.Text    = reg.EmailIcon;
            lblMobileVerify.Text     = reg.MobileIcon;
            lblPassword.Text         = reg.PasswordStrongMessege(txtPassword.Text);
            if (email && username && mobile)
            {
                reg.Input_Email     = txtEmail.Text;
                reg.Input_FirstName = txtFirstName.Text;
                reg.Input_Mobile    = txtMobileCode.Text + txtMobileNumber.Text;
                reg.Input_Packege   = "free";
                reg.Input_Password  = txtPassword.Text;
                reg.Input_SureName  = txtSureName.Text;
                reg.Input_UserName  = txtUserName.Text;
                if (reg.Reg())
                {
                    Cookies cookies = new Cookies();
                    _Cookies = cookies.Add(reg.LoginID, reg.RegID, Request.UserAgent.ToString());

                    foreach (HttpCookie httpCookie in _Cookies)
                    {
                        Response.Cookies.Add(httpCookie);
                    }
                    int i = 0;
                    foreach (string Name in cookies.CookiesName)
                    {
                        Session[Name] = cookies.CookiesValueEncrypt[i]; i++;
                    }
                    //lblResult.Text += "1="+ reg.Message;

                    Notification notification = new Notification();
                    notification.AddNotification("Verify your Email Address.", "../EmailVerify", IconDataFeather.mail, reg.Offset, reg.RegID);

                    //lblResult.Text += "2="+reg.RegID+"/ " + notification.ErrorMessage;

                    EMAIL mAIL = new EMAIL();
                    mAIL.Subject = "Email Confirmation";
                    mAIL.Messege = "please verify your email. please click http://" + Request.Url.AbsoluteUri.ToString().Replace("create_account", "EmailVerify") + "?=" + reg.EmailCode + "&rid=" + reg.RegID;
                    mAIL.Email   = txtEmail.Text;
                    //mAIL.Mail();



                    Response.Redirect("~/CMS/");
                }
                else
                {
                    lblResult.Text = reg.Message;
                }
            }
        }
示例#2
0
        internal bool UseCaseValidator(int dddOrigem, int dddDestino, int duracaoEmMinutos, EPlanoTelefonia planoSelecionado)
        {
            if (dddOrigem == 0)
            {
                _notification.AddNotification(Guid.NewGuid().ToString(), "Informe o DDD de Origem.");
            }

            if (dddDestino == 0)
            {
                _notification.AddNotification(Guid.NewGuid().ToString(), "Informe o DDD de destino.");
            }

            if (duracaoEmMinutos == 0)
            {
                _notification.AddNotification(Guid.NewGuid().ToString(), "Inform e o tempo de duração da ligação.");
            }

            return(_notification.HasNotifications);
        }
示例#3
0
        public async override Task <Auth> Handle(VerifyCode request, CancellationToken cancellationToken)
        {
            var auth = await UserManager.VerifyCodeAsync(request.Hash, request.Code);

            if (auth == null)
            {
                Notification.AddNotification("code", "Code invalid");
            }

            return(auth);
        }
        public async override Task <Auth> Handle(AddTwoFactAuth request, CancellationToken cancellationToken)
        {
            var auth = await UserManager.AddTwoFactorTokenAsync(request.Hash, request.AuthenticatorUri, request.Code);

            if (auth == null)
            {
                Notification.AddNotification("code", "Code invalid");
            }

            return(auth);
        }
        public virtual TEntity GetById(TIdentifier id)
        {
            Notification.Clear();
            TEntity result = Connection.Session.Get <TEntity>(id);

            if (Equals(result, null))
            {
                Notification.AddNotification("Registro não encontrado", nameof(id), (object)id, TypeOfMessage.Error);
            }

            return(result);
        }
        public virtual IEnumerable <TEntity> GetAll()
        {
            Notification.Clear();
            IEnumerable <TEntity> results = Connection.Session.QueryOver <TEntity>().List();

            if (!Equals(results, null) && results.Count().Equals(0))
            {
                Notification.AddNotification("Registro não encontrado", TypeOfMessage.Error);
            }

            return(results);
        }
示例#7
0
 private void Output(string Path, double Size)
 {
     if (design.InsertTemplate(new DesignDetails()
     {
         RegID = ((CMSmaster)this.Master).RegID,
         CategoryID = ddlCategory.SelectedValue.ToString(),
         CategoryName = ddlCategory.SelectedItem.ToString(),
         Title = txtTitle.Text,
         Discription = txtDiscription.Text,
         Offset = ((CMSmaster)this.Master).Offset,
         Price = Convert.ToDouble(txtPrice.Text.Replace("$", "")),
         SEO = chkSEO.Checked ? true : false,
         SpeedOptimization = chkSpeedOptimization.Checked ? true : false,
         Support = chkSupport.Checked ? true : false,
         Tag = txttags.Text,
         Testing = chkTesting.Checked ? true : false,
         Version = chkVersionUpdate.Checked?true:false,
         YoutubeEnable = txtYoutuleLink.Text == "" ? false : true,
         YoutubeLink = txtYoutuleLink.Text,
         imageSize = Size,
         imgaePath = Path,
         PublicMode = chkPublicMode.Checked ? true : false
     }))
     {
         FileUpload1.SaveAs(Server.MapPath("~/" + Path));
         lblResult.Text = "";
         Notification.AddNotification("New Template Create", "../../CMS/Design?g=" + _enc.Encrypt256bits(design.Template_ID, G_Key), IconDataFeather.file, ((CMSmaster)this.Master).Offset, ((CMSmaster)this.Master).RegID);
         HttpCookie AddnewCookies = new HttpCookie("_temp_id", _enc.Encrypt256bits(design.Template_ID));
         Response.Cookies.Add(AddnewCookies);
         Response.Redirect("~/CMS/Template/");
     }
     else
     {
         lblResult.Text = "<div class='alert alert-danger'>" + design.ErrorMessege + "</div>";
     }
 }
        public Category GetByName(string name)
        {
            Category result = null;

            result = Connection.Session.QueryOver <Category>()
                     .WhereRestrictionOn(x => x.Name)
                     .IsInsensitiveLike(name)
                     .SingleOrDefault();

            if (Equals(result, null))
            {
                Notification.AddNotification("Registro não encontrado", nameof(Category.Name), (object)name, TypeOfMessage.Attention);
            }

            return(result);
        }
 public IActionResult CreateNotification([FromBody] NotificationAddModel notification)
 {
     if (notification.condition == null || notification.measurement_type == null || notification.receivers == "" ||
         notification.repeat_after == 0 || notification.tunnel == null || notification.value == 0)
     {
         return(BadRequest());
     }
     else
     {
         if (Notification.AddNotification(notification))
         {
             return(Ok());
         }
     }
     return(BadRequest());
 }
        public Category NameSingle(Category category)
        {
            Notification.Clear();
            Category result = null;

            if (!string.IsNullOrEmpty(category?.Name))
            {
                result = Connection.Session.QueryOver <Category>()
                         .Where(x => x.Name.Equals(category.Name) &&
                                !x.Id.Equals(category.Id)).Take(1).List().FirstOrDefault();

                if (object.Equals(result, null))
                {
                    Notification.AddNotification(string.Format("{0} não é único", nameof(category.Name)), nameof(category.Name), (object)category.Name, TypeOfMessage.Error);
                }
            }

            return(result);
        }
示例#11
0
    protected void ButtonAdd_Click(object sender, EventArgs e)
    {
        Notification not      = new Notification();
        int          notid    = not.GetNotificationCount();
        int          newnotid = 0;

        if (notid == 0)
        {
            newnotid = 1;
        }
        else
        {
            newnotid = notid + 1;
        }
        if (not.AddNotification(newnotid.ToString(), TextBoxTitle.Text, TextBoxText.Text, CalendarNotificationDate.SelectedDate.Date.ToString("yyyy-MM-dd"), Session["UserID"].ToString()) > 0)
        {
            LabelMessage.Text = "Notification Added";
        }
        else
        {
            LabelMessage.Text = "Error";
        }
    }
        public IEnumerable <Category> Filter(FilterCmd command)
        {
            IList <Category> results     = new List <Category>();
            StringBuilder    sql         = new StringBuilder();
            StringBuilder    sqlFilter   = new StringBuilder();
            StringBuilder    sqlKeyWord  = new StringBuilder();
            IList <string>   textKeyWord = command.DismemberKeyWord();

            sql.Append("SELECT Cat FROM Category as Cat");

            if (command.Category.Count > 0)
            {
                sqlFilter.Append(" AND Cat.Id IN (:CategoryId) ");
            }

            if (command.Status.Count > 0)
            {
                sqlFilter.Append(" AND Cat.Status IN (:Status) ");
            }

            if (!string.IsNullOrWhiteSpace(command.PerName))
            {
                sqlFilter.Append(" AND Cat.Name = : PerName ");
            }

            if (!Equals(textKeyWord, null) && textKeyWord.Count > 0)
            {
                sqlFilter.Append(" AND ( ");
                for (int i = 0; i < textKeyWord.Count(); i++)
                {
                    sqlKeyWord.Append(string.Format(" OR CollateLatinGeneral(Cat.Name) LIKE :texto{0} ", i));
                }

                sqlFilter.Append(Regex.Replace(sqlKeyWord.ToString(), @"^ OR ", ""));
                sqlFilter.Append(" ) ");
            }

            sql.Append(Regex.Replace(sqlFilter.ToString(), @"^ And ", " WHERE "));

            var query = Connection.Session.CreateQuery(sql.ToString());

            query.SetMaxResults(command.Maximum);
            query.SetFirstResult((command.Page - 1) * command.Maximum);
            query.SetResultTransformer(new DistinctRootEntityResultTransformer());

            if (command.Category.Count > 0)
            {
                query.SetParameterList("CategoryId", command.Category);
            }

            if (command.Status.Count > 0)
            {
                query.SetParameterList("Status", command.Status);
            }

            if (!string.IsNullOrEmpty(command.PerName))
            {
                query.SetString("PerName", command.PerName);
            }

            if (!Equals(textKeyWord, null) && textKeyWord.Count > 0)
            {
                for (int i = 0; i < textKeyWord.Count(); i++)
                {
                    query.SetString(string.Format("texto{0}", i), string.Format("%{0}%", textKeyWord[i]));
                }
            }

            results = query.List <Category>();

            if (Equals(results, null) || results.Count.Equals(0))
            {
                Notification.AddNotification("Registro não encontrado!", TypeOfMessage.Error);
            }

            return(results);
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int _index = 0; bool session = false; bool cookies = false;

            string[] CookiesValue = new string[Cookies.CookiesName.Length];
            string[] SessionValue = new string[Cookies.CookiesName.Length];
            foreach (var Name in Cookies.CookiesName)
            {
                if (Session[Name] != null || Request.Cookies[Name] != null)
                {
                    if (Session[Name] != null)
                    {
                        session = true; SessionValue[_index] = Session[Name].ToString();
                    }
                    if (Request.Cookies[Name] != null)
                    {
                        cookies = true; CookiesValue[_index] = Request.Cookies[Name].Value;
                    }
                }
                else
                {
                    Response.Redirect("~/login"); break;
                }
                _index++;
            }
            if (Session_Cookies_Check(CookiesValue, SessionValue, cookies, session))
            {
                if (Cookies.EmailVerify == "True" || Cookies.EmailVerify == "true")
                {
                    Response.Redirect("~/CMS/");
                }
                else
                {
                    if (Request.QueryString[""] != null && Request.QueryString["rid"] != null)
                    {
                        var         Code  = Request.QueryString[""].ToString();
                        var         RegID = Request.QueryString["rid"].ToString();
                        Registation reg   = new Registation();
                        if (reg.EmailVerification(Code, RegID))
                        {
                            Notification notification = new Notification();
                            notification.AddNotification("Your Email is Verified.", "#", IconDataFeather.mail, Cookies.Offset, Cookies.RegID);
                            Response.Redirect("~/CMS/");
                        }
                        else
                        {
                            lblResult.Text = "Error: " + reg.Message;
                        }
                    }
                    btnResend.Visible = true;
                }
            }
            else
            {
                if (Request.QueryString[""] != null && Request.QueryString["rid"] != null)
                {
                    var         Code  = Request.QueryString[""].ToString();
                    var         RegID = Request.QueryString["rid"].ToString();
                    Registation reg   = new Registation();
                    if (reg.EmailVerification(Code, RegID))
                    {
                        Response.Redirect("~/CMS/");
                    }
                    else
                    {
                        lblResult.Text = "Error: " + reg.Message;
                    }
                }
                else
                {
                    Response.Redirect("~/login");
                }
            }
        }
示例#14
0
 private void AddNotification_OnClick(object sender, RoutedEventArgs e)
 {
     Notification.AddNotification(DateTime.Now.ToLongTimeString());
     //Notifs.Add(new MyNotifDC{Text = DateTime.Now.ToLongTimeString()});
 }