Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            u   = new Utilisateur();
            a   = new Action();
            c   = new Compte();
            con = new Connexion();

            if (u.ID != null)
            {
            }
            else if (Request.Cookies["logIn"] != null)
            {
                u.Email    = Request.Cookies["logIn"]["Email"];
                u.Password = Request.Cookies["logIn"]["Password"];
                u.LogIn();
            }
            else if (u.ID == null)
            {
                Response.Redirect("Login.aspx");
            }

            if (a.EventType == "+")
            {
                cbAjout.Checked = true;
            }

            if (_bMod)
            {
                _dataTable = new DataTable();
                _dataTable = con.showParamDataTable("dbo.Get_Comptes_from_ID_Utili", "@ID");

                dlCompts.DataSource = _dataTable;
                dlCompts.DataBind();
                dlCompts.DataTextField  = "Nom";
                dlCompts.DataValueField = "ID";
                dlCompts.DataBind();
                //_bMod = false;
            }

            if (a.ID != null && tbPrix.Text == String.Empty)
            {
                _dataTable = new DataTable();
                _dataTable = con.showDataTable("select * from dbo.action" + " where ID = '" + a.ID + "'");

                string prix;
                prix = _dataTable.Rows[0][3].ToString().Trim();

                if (prix.Contains("-"))
                {
                    tbPrix.Text = (-float.Parse(prix)).ToString();
                }
                else
                {
                    tbPrix.Text     = prix;
                    cbAjout.Checked = true;
                }

                tbDes.Text = _dataTable.Rows[0][2].ToString().Trim();
                dlCompts.Items.FindByValue(c.ID).Selected = true;
                btnEvent.Text = "Modifier Event";
                _bMod         = false;
            }

            FillCategoryList();
        }
Esempio n. 2
0
 public Source()
 {
     connexion = new Connexion();
 }
Esempio n. 3
0
 public Action()
 {
     c   = new Compte();
     u   = new Utilisateur();
     con = new Connexion();
 }
Esempio n. 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            a        = new Action();
            inMoney  = new In();
            outMoney = new Out();

            c   = new Compte();
            con = new Connexion();

            a.Montant = float.Parse(tbPrix.Text);
            a.Des     = tbDes.Text;
            c.ID      = dlCompts.Text;
            _bMod     = true;

            if (c.ID == dlCompts.Text || a.ID == null)
            {
                if (a.ID == null)
                {
                    if (cbAjout.Checked)
                    {
                        a.Ajouter();
                        a.ID = con.showDataTable("select ID from Action where C_id = '" + c.ID + "' order by TIme desc").Rows[0]["ID"].ToString();

                        inMoney.cValue = tags.Value;
                        inMoney.Add();
                    }
                    else
                    {
                        {
                            a.Montant = float.Parse("-" + a.Montant);
                            a.Ajouter();
                            outMoney.Withdraw();
                        }
                    }
                    Response.Redirect("HomePage.aspx");
                }
                else
                {
                    a.Time = DateTime.Parse(_dataTable.Rows[0][1].ToString());

                    if (cbAjout.Checked)
                    {
                        a.Modifier();
                    }
                    else
                    {
                        a.Montant = float.Parse("-" + a.Montant);
                        a.Modifier();
                    }

                    Response.Redirect("HomePage.aspx");
                }
            }
            else
            {
                a.Time = DateTime.Parse(_dataTable.Rows[0][1].ToString());

                a.Suppretion();
                a.Ajouter();

                Response.Redirect("HomePage.aspx");
            }
        }
Esempio n. 5
0
 public Compte(string nom, float c_montant)
 {
     con            = new Connexion();
     this.nom       = nom;
     this.c_montant = c_montant;
 }
Esempio n. 6
0
 public Compte()
 {
     con = new Connexion();
 }
Esempio n. 7
0
 public In()
 {
     con = new Connexion();
 }
Esempio n. 8
0
 public Out()
 {
     con = new Connexion();
 }
Esempio n. 9
0
 public Utilisateur()
 {
     con = new Connexion();
 }