Beispiel #1
0
        protected void SignInButton_Click(object sender, EventArgs e)
        {
            FormLayout.FindItemOrGroupByName("GeneralError").Visible = false;
            if (ASPxEdit.ValidateEditorsInContainer(this))
            {
                // Your Authentication logic

                string user = UserNameTextBox.Value.ToString().Trim();
                string pass = PasswordButtonEdit.Value.ToString().Trim();

                string val1 = ConfigurationManager.AppSettings["Debug:User.Login"].ToString();
                string val2 = ConfigurationManager.AppSettings["Debug:User.Login"].ToString();

                if (user.Equals(val1) && pass.Equals(val2))
                {
                    //TODO: rol system
                    Global.Sessions.SetDeveloperUserSessionVariables();
                    Response.Redirect("~/Views/Main.aspx");
                }
                else
                {
                    GeneralErrorDiv.InnerText = "Invalid login attempt.";
                    FormLayout.FindItemOrGroupByName("GeneralError").Visible = true;
                }
            }
        }
Beispiel #2
0
 protected void SignInButton_Click(object sender, EventArgs e)
 {
     FormLayout.FindItemOrGroupByName("GeneralError").Visible = false;
     if (ASPxEdit.ValidateEditorsInContainer(this, "login"))
     {
         // DXCOMMENT: You Authentication logic
         if (AuthHelper.SignIn(UserNameTextBox.Text, PasswordButtonEdit.Text) == null)
         {
             GeneralErrorDiv.InnerText = "Đăng nhập không thành công: Sai tên đăng nhập hoặc mật khẩu.";
             FormLayout.FindItemOrGroupByName("GeneralError").Visible = true;
         }
         else
         {
             Response.Redirect("~/Map.aspx");
         }
     }
 }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         if (!UserService.SignIn(UserAccountName, null))
         {
             LogonContainer.Attributes["class"] += " LogonError";
             FormLayout.FindItemOrGroupByName("Error").Visible = true;
             ErrorLabel.Text = string.Format(
                 "Login failed for '{0}'. Make sure your account name is correct and retype the password in the correct case.", UserAccountName);
         }
     }
     else
     {
         UserAccountName = UserService.DefaultUserAccountName;
     }
 }
Beispiel #4
0
 protected void SignInButton_Click(object sender, EventArgs e)
 {
     FormLayout.FindItemOrGroupByName("GeneralError").Visible = false;
     if (ASPxEdit.ValidateEditorsInContainer(this))
     {
         // DXCOMMENT: You Authentication logic
         if (!AuthHelper.SignIn(UserNameTextBox.Text, PasswordButtonEdit.Text))
         {
             GeneralErrorDiv.InnerText = "Invalid login attempt.";
             FormLayout.FindItemOrGroupByName("GeneralError").Visible = true;
         }
         else
         {
             Response.Redirect("~/");
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        //HtmlTable tblBody = (HtmlTable)Master.FindControl("tblBody");
        //if(tblBody != null) tblBody.Visible = false;
        //Menu oMenu = (Menu)Master.FindControl("oMenu");
        //if (oMenu != null) oMenu.Visible = false;
        Master.HideHeaderAndFooter();

        if (!IsPostBack)
        {
            SubmissionID = UploadControlHelper.GenerateUploadedFilesStorageKey();
            UploadControlHelper.AddUploadedFilesStorage(SubmissionID);
        }

        FormLayout.FindItemOrGroupByName("ResultGroup").Visible = false;
        //TOFIX DemoHelper.Instance.ControlAreaMaxWidth = Unit.Pixel(800);
    }
Beispiel #6
0
 protected void SignInButton_Click(object sender, EventArgs e)
 {
     FormLayout.FindItemOrGroupByName("GeneralError").Visible = false;
     if (ASPxEdit.ValidateEditorsInContainer(this))
     {
         // DXCOMMENT: You Authentication logic
         if (!AuthHelper.SignIn(UserNameTextBox.Text, PasswordButtonEdit.Text, RememberMeCheckBox.Checked))
         {
             GeneralErrorDiv.InnerText = "Tên đăng nhập hoặc mật khẩu không đúng.";
             FormLayout.FindItemOrGroupByName("GeneralError").Visible = true;
         }
         else
         {
             loadLicense();
         }
     }
 }
    protected void ProcessSubmit(string description, List <UploadedFileInfo> fileInfos)
    {
        DescriptionLabel.Value = Server.HtmlEncode(description);

        SQL_utils sql = new SQL_utils("backend");

        foreach (UploadedFileInfo fileInfo in fileInfos)
        {
            // process uploaded files here

            DateTime?filename_date = GetFirstDateFromString(fileInfo.OriginalFileName);


            //Check to see if the filename has already been uploaded
            int exists = sql.IntScalar_from_SQLstring(
                String.Format("select coalesce(count(*),0) result from vwDocVers where doctype != 'SleepSensorBox' and origfilename = '{0}'", fileInfo.OriginalFileName));

            int doctypeID = Convert.ToInt32(cboDataUploadType.Value);

            if (exists == 0)
            {
                UploadSettings uploadSettings;
                //int max_datauploadpk = sql.IntScalar_from_SQLstring("select coalesce(max(datauploadpk),0) from def.DataUpload");

                //Save to DB
                uploadSettings = LogTheUpload(fileInfo, fileInfo.OriginalFileName, doctypeID);

                fileInfo.SummaryInfo = uploadSettings.results;
            }
            else
            {
                fileInfo.SummaryInfo = "NOT PROCESSED: The file already exists.";
            }
        }
        sql.Close();

        gvResults.DataSource = fileInfos;
        gvResults.DataBind();
        SubmittedFilesListBox.DataSource = fileInfos;
        SubmittedFilesListBox.DataBind();

        FormLayout.FindItemOrGroupByName("ResultGroup").Visible = true;
    }
Beispiel #8
0
        protected void SignInButton_Click(object sender, EventArgs e)
        {
            FormLayout.FindItemOrGroupByName("GeneralError").Visible = false;
            if (ASPxEdit.ValidateEditorsInContainer(this))
            {
                // DXCOMMENT: You Authentication logic
                if (AuthHelper.SignIn(UserNameTextBox.Text, PasswordButtonEdit.Text) == 0)
                {
                    ApplicationUser user = HttpContext.Current.Session["User"] as ApplicationUser;
                    Session["GlobalConnectionString"] = cmbSite.Value;
                    int site_id = 0;
                    if (!string.IsNullOrEmpty(user.SiteID))
                    {
                        site_id = Convert.ToInt32(user.SiteID);
                    }
                    // "1" = site_id.ToString();
                    //"1" = user.Exercice;

                    GestionConnexion(user.Rolename, 1, site_id);
                    Response.Redirect("~/");
                }
                else if (AuthHelper.SignIn(UserNameTextBox.Text, PasswordButtonEdit.Text) == 2)
                {
                    GeneralErrorDiv.InnerText = "Merci de vous rapprocher vous de votre administrateur pour acceder à la plateforme.";
                    FormLayout.FindItemOrGroupByName("GeneralError").Visible = true;

                    GestionConnexion("", 0, 0);
                }
                else
                {
                    GeneralErrorDiv.InnerText = "Erreur d'authentification";
                    FormLayout.FindItemOrGroupByName("GeneralError").Visible = true;

                    GestionConnexion("", 0, 0);
                }
            }
        }