示例#1
0
 public FormAuthorization()
 {
     InitializeComponent();
     TimerLanguage.Start();
     PasswordShow.Hide();
     PanelWarning.Hide();
 }
示例#2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        ListDictionary insertParameters = new ListDictionary();

        TextBox      name   = FormView1.FindControl("nameBox") as TextBox;
        TextBox      author = FormView1.FindControl("authorBox") as TextBox;
        DropDownList type   = FormView1.FindControl("DropDownMovieList") as DropDownList;

        //check if data exists already

        bool exists = false;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            String valueName = GridView1.Rows[i].Cells[1].Text.ToString();
            if ((valueName.Equals(name.Text)))
            {
                //record exists
                exists = true;
                //ShowPopUpMsg("Name already exists in the database. Please check details in 'name' field");

                break;
            }
            else
            {
                exists = false;
                //record not exists
            }
        }
        //insert if valid
        if (exists == false)
        {
            insertParameters.Add("Name", name.Text);
            insertParameters.Add("AuthorName", author.Text);
            insertParameters.Add("Type", type.SelectedItem.Text);
            insertParameters.Add("DateAdded", DateTime.Now.ToShortDateString());

            LinqDataSource1.Insert(insertParameters);

            GridView1.DataBind();
            insertParameters.Clear();
            messagePanel.Visible = true;
            messagePanel.Dispose();
        }
        else if (exists == true)
        {
            PanelWarning.Visible = true;
            PanelWarning.Dispose();
        }
    }
示例#3
0
 private void WarningPanelOff()
 {
     PanelWarning.Hide();
     Size = new Size(360, 424);
     PanelNavig.Location = new Point(9, 240);
 }
示例#4
0
 private void WarningPanelOn()
 {
     PanelWarning.Show();
     Size = new Size(360, 483);
     PanelNavig.Location = new Point(9, 299);
 }