Exemple #1
0
        /// <summary>
        /// Open specific transfer transaction to edit.
        /// </summary>
        /// <param name="transaction">Transaction to edit.</param>
        public void Edit(TransactionDTO transaction)
        {
            transactionId = transaction.Id;

            // Todo: refactor this method!
            var accountsSource1 = accounts1CollectionViewSource.Source as BindableCollection <AccountDTO>;

            if (accountsSource1 != null)
            {
                var selectedAccount1 = accountsSource1.Where(a => a.Id == transaction.Postings[1].Account.Id).Single();
                Accounts1.MoveCurrentTo(selectedAccount1);
            }

            var accountsSource2 = accounts2CollectionViewSource.Source as BindableCollection <AccountDTO>;

            if (accountsSource2 != null)
            {
                var selectedAccount2 = accountsSource2.Where(a => a.Id == transaction.Postings[0].Account.Id).Single();
                Accounts2.MoveCurrentTo(selectedAccount2);
            }

            OperationDate = transaction.Postings[0].Date.ToLocalTime();
            Amount        = transaction.Postings[0].Amount.ToString();
            Comment       = transaction.Comment;

            IsEditMode = true;
        }
Exemple #2
0
    protected void btnDangKy_Click(object sender, ImageClickEventArgs e)
    {
        Accounts1 sc = db.Accounts1s.SingleOrDefault(s => s.AcountName == Session["TaiKhoan"].ToString());



        if (matkhau.Text == xacnhanmk.Text)
        {
            sc.Pass = xacnhanmk.Text;
        }
        else
        {
            Response.Write("<script language='JavaScript'> alert('Mật khẩu không trùng khớp!'); </script>");
        }


        if (rdMale.Checked == true)
        {
            sc.Gender = "Nam";
        }
        if (rdFemale.Checked == true)
        {
            sc.Gender = "Nữ";
        }

        sc.HomeTown = diachi.Text;

        sc.Email = email.Text;

        db.SubmitChanges();
        Response.Redirect(@"/ThongTinTaiKhoan.aspx");
    }
Exemple #3
0
 public void Clear()
 {
     transactionId = null;
     IsEditMode    = false;
     Accounts1.MoveCurrentToFirst();
     Accounts2.MoveCurrentToFirst();
     OperationDate = DateTime.SpecifyKind(DateTime.Today, DateTimeKind.Unspecified);
     Amount        = string.Empty;
     Comment       = string.Empty;
 }
 public static DataAccess.Entities.Accounts Map(Accounts1 AX)
 {
     return(new DataAccess.Entities.Accounts()
     {
         FNAME = AX.FNAME,
         LNAME = AX.LNAME,
         PASSWORD = AX.PASSWORD,
         ACCESS_LEVEL = AX.ACCESS_LEVEL,
         EMAIL = AX.EMAIL,
         PHONE = AX.PHONE,
         USERNAME = AX.USERNAME,
         DEPT_ID = AX.DEPT_ID
     });
 }
    protected void btnDangKy_Click(object sender, ImageClickEventArgs e)
    {
        if (txtTaiKhoan.Text == "" || txtNhapLaiMatKhau.Text == "" || txtMatKhau.Text == "" || txtEmail.Text == "" || txtDiaChi.Text == "")
        {
            lbthongbao.InnerText = "Thông tin tài khoản không bỏ trống!";
        }
        if (txtMatKhau.Text != txtNhapLaiMatKhau.Text)
        {
            lbthongbao.InnerText = "Mật khẩu không khớp!";
        }
        else
        {
            try
            {
                //chưa kiem tra tai khoan da ton tai

                Accounts1 ac = new Accounts1();
                ac.AcountName = txtTaiKhoan.Text;
                ac.Pass       = txtMatKhau.Text;
                if (rdoGioiTinh.Items[0].Selected == true)
                {
                    ac.Gender = "Nam";
                }
                else
                {
                    ac.Gender = "Nữ";
                }
                ac.BirthDay = DateTime.Parse(droNgay.Text + "/" + droThang.Text + "/" + DropNam.Text);
                ac.HomeTown = txtDiaChi.Text;
                ac.Email    = txtEmail.Text + groEmail.Text;
                db.Accounts1s.InsertOnSubmit(ac);
                db.SubmitChanges();
                Response.Redirect("/ThanhCong.aspx");
            }
            catch (Exception)
            {
                lbthongbao.InnerText = "Vui lòng kiểm tra lại thông tin!";
                //lbthongbao.Text = "Tài khoản đã tồn tại!";
            }
        }
    }
Exemple #6
0
        public void Post(
            string FNAME,
            string LNAME,
            string PASSWORD,
            int ACCESS_LEVEL,
            string EMAIL,
            string PHONE,
            string USERNAME,
            int DEPT_ID)
        {
            Accounts1 a = new Accounts1();

            a.FNAME        = FNAME;
            a.LNAME        = LNAME;
            a.PASSWORD     = PASSWORD;
            a.ACCESS_LEVEL = ACCESS_LEVEL;
            a.EMAIL        = EMAIL;
            a.PHONE        = PHONE;
            a.USERNAME     = USERNAME;
            a.DEPT_ID      = DEPT_ID;
            ACC.CreateAccount(a);
        }
Exemple #7
0
        public void Put(int id,
                        string fname,
                        string lname,
                        string password,
                        int access_level,
                        string email,
                        string phone,
                        string username,
                        int dept_id
                        )
        {
            Accounts1 acc = new Accounts1();

            acc.ID           = id;
            acc.FNAME        = fname;
            acc.LNAME        = lname;
            acc.PASSWORD     = password;
            acc.ACCESS_LEVEL = access_level;
            acc.EMAIL        = email;
            acc.PHONE        = phone;
            acc.USERNAME     = username;
            acc.DEPT_ID      = dept_id;
            ACC.UpdateAccount(acc);
        }