Exemple #1
0
    protected void Sector_SelectedIndexChanged(object sender, EventArgs e)
    {
        // Fill Reports Data according to selected section

        if (Sector.SelectedValue != "")
        {
            if (DropYear.SelectedValue != "0")
            {
                ListItem aa = new ListItem();
                aa.Text  = "اختر الادارة";
                aa.Value = "0";
                Mang.Items.Clear();
                Mang.Items.Insert(0, aa);

                Mang.DataSource = Obj.GetPlansAdmins(Convert.ToInt32(DropYear.SelectedValue), Convert.ToInt32(Sector.SelectedValue));

                Mang.DataTextField  = "AdmName";
                Mang.DataValueField = "AdmID";
                Mang.DataBind();
            }
        }

        else
        {
            BindAllData();
        }
    }
Exemple #2
0
    protected void Save_Click(object sender, EventArgs e)
    {
        Suc.Visible = false; SucDel.Visible = false;
        Rett.Text   = "";
        string imgPath = ""; // Define the Employee Photo file

        if (FileUpload1.HasFiles)
        {
            string ext = System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName);
            if (ext != ".exe" || ext != ".php")
            {
                //sets the image path
                var r = new Random();
                // print random integer >= 0 and  < 100


                imgPath = "Uploads/" + r.Next(100) + FileUpload1.FileName;

                //get the size in bytes that
                FileUpload1.SaveAs(Server.MapPath(imgPath));

                var Res = Obj.NewMainReports(Convert.ToInt32(DropYear.SelectedValue), Convert.ToInt32(Sector.SelectedValue), Convert.ToInt32(Mang.SelectedValue), imgPath, FileName.Value);
                if (Res == 0)
                {
                    Rett.Text = "البيانات مسجلة سابقا لنفس الخطة والإدارة العليا والادارة";
                }
                else
                {
                    CloseAll();
                    DropYear.ClearSelection();
                    Sector.ClearSelection();
                    Mang.ClearSelection();
                    FileName.Value = "";
                    FileUpload1.Attributes.Clear();
                    Main.Attributes.Remove("Style");
                    Main.Style.Add("display", "block");
                    Suc.Visible = true; SucDel.Visible = false;
                }
            }
        }
    }