using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ABC.File;
using ABC.KetNoi;
using DevExpress.XtraEditors;


namespace ABC.DanhMuc.HeThong
{
    public partial class T_Thongtinphieu :XtraUserControl
    {
        public T_Thongtinphieu()
        {
            InitializeComponent();
            dt_user = Get_CauHinh.Dt_Login;
        }
       // Class_NguoiDung ex = new Class_NguoiDung();
  
        DataTable dt_user;
        Guid ID_active;
        public void progess_new()
        {           
          
        }
        public void progess_edit()
        {
        }
        public void progess_del()
        {
            DialogResult dia = msgbox.dialog_yes_no("Xóa dòng chọn");
            if (dia == DialogResult.Yes)
            {
            }
        }
        public void progess_save()
        {
        }
        public void progess_print()
        {
        }
        public void progess_search(string key)
        {
        }
        public void load_init()
        {
        }
        public void save()
        {
        }
        public void Excel()
        {
        }
        public string contro_dislay = "Thông Tin Đại Lý";
        Class_KetNoi db = new Class_KetNoi();
        private void Frm1_Load(object sender, EventArgs e)
        {
            DataTable dt = db.T_opendataset("sp_Re").Tables[0];
            gc.DataSource = dt;

        }
       

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //this.Close();
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {

        }

        private void gv_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            DataRow dtr = gv.GetDataRow(gv.FocusedRowHandle);
            string col = gv.FocusedColumn.FieldName;
            switch (col)
            {
                case "TIEUDE":
                    {
                        db.T_exc("UPDATE RE SET TIEUDE = N'" + e.Value.ToString() + "' WHERE STT = "+dtr["STT"].ToString()+"");
                        break;
                    }
                case "DC":
                    {
                        db.T_exc("UPDATE RE SET DC = N'" + e.Value.ToString() + "' WHERE STT = " + dtr["STT"].ToString() + "");
                        break;
                    }
                case "DT":
                    {
                        db.T_exc("UPDATE RE SET DT = N'" + e.Value.ToString() + "' WHERE STT = " + dtr["STT"].ToString() + "");
                        break;
                    }
            }
        }

      


    }
}
