Ejemplo n.º 1
0
        public bool DeleteSuCo(SuCo su)
        {
            string query = "Delete_SuCo";

            string[] para;
            para    = new string[1];
            para[0] = "@maSC";


            object[] values;
            values    = new object[1];
            values[0] = su.MaSC;

            try
            {
                connection connect = new connection();
                int        a       = Excute_Sql(query, CommandType.StoredProcedure, para, values);
                if (a != 0)
                {
                    return(true);
                }
                return(false);
            }
            catch (SqlException ex)
            {
                DialogResult d;
                d = MessageBox.Show("Thông tin xóa không hợp lệ!");
                return(false);
            }
            finally
            {
            }
        }
Ejemplo n.º 2
0
        public bool UpdateDem(Dem fdem)
        {
            string query = "Update_FileDem";

            string[] para;
            para    = new string[3];
            para[0] = "@MaFile";
            para[1] = "@DuongDan";
            para[2] = "@TenFile";
            object[] values;
            values    = new object[3];
            values[2] = fdem.TenFile;
            values[1] = fdem.DuongDan;
            values[0] = fdem.MaFile;

            try
            {
                connection connect = new connection();
                int        a       = Excute_Sql(query, CommandType.StoredProcedure, para, values);
                if (a != 0)
                {
                    return(true);
                }
                return(false);
            }
            catch (SqlException ex)
            {
                DialogResult d;
                d = MessageBox.Show("Thông tin sửa không hợp lệ!");
                return(false);
            }
            finally
            {
            }
        }
Ejemplo n.º 3
0
        public DataSet getIconChild()
        {
            string  query   = "SELECT DuongDanAnh, MaDonVi FROM dbo.DonVi";
            DataSet dataSet = new DataSet();

            connect = new connection();
            dataSet = connect.FillDataSet(query, CommandType.Text);
            return(dataSet);
        }
Ejemplo n.º 4
0
        public DataSet getDataParentNode()
        {
            string  query   = "SELECT * FROM dbo.BinhChung";
            DataSet dataSet = new DataSet();

            connect = new connection();
            dataSet = connect.FillDataSet(query, CommandType.Text);
            return(dataSet);
        }
Ejemplo n.º 5
0
        public void XoaBinhChung(string mabinhchung)
        {
            string query = "XoaBinhChung";

            string[]   para       = { "@maBinhChung" };
            string[]   value      = { mabinhchung };
            connection Connection = new connection();

            Connection.Excute_Sql_Node(query, CommandType.StoredProcedure, para, value, showResultDeleteFromSql);
        }
Ejemplo n.º 6
0
        public void ChinhSuaBinhChung(string s1, string s2)
        {
            string query = "ChinhSuaBinhChung";

            string[]   para       = { "@maBinhChung", "@tenBinhChung" };
            string[]   value      = { s1, s2 };
            connection Connection = new connection();

            Connection.Excute_Sql_Node(query, CommandType.StoredProcedure, para, value, showResultChangeBCFromSql);
        }
Ejemplo n.º 7
0
        public void ChinhSuaDonVi(string madonvi, string tendonvi, string duongdananh)
        {
            string query = "ChinhSuaDonVi";

            string[]   para       = { "@maDonVi", "@tenDonVi", "@duongDanAnh" };
            string[]   value      = { madonvi, tendonvi, duongdananh };
            connection Connection = new connection();

            Connection.Excute_Sql_Node(query, CommandType.StoredProcedure, para, value, showResultChangeDVFromSql);
        }
Ejemplo n.º 8
0
        public void getDataTSDV(DataGridView dataGridView, SearchLookUpEdit searchLookUpEdit)
        {
            string  query   = "LayThongTinThamSoDauVao";
            DataSet dataSet = new DataSet();

            connect = new connection();
            dataSet = connect.FillDataSet(query, CommandType.StoredProcedure);
            dataGridView.DataSource = dataSet.Tables[0];
            searchLookUpEdit.Properties.DataSource = dataSet.Tables[0];
        }
Ejemplo n.º 9
0
        public void XoaDonVi(string madonvi)
        {
            string query = "XoaDonVi";

            string[]   para       = { "@maDonVi" };
            string[]   value      = { madonvi };
            connection Connection = new connection();

            Connection.Excute_Sql_Node(query, CommandType.StoredProcedure, para, value, showResultDeleteFromSql);
        }
Ejemplo n.º 10
0
        public void ThemDonVi(string madonvi, string tendonvi, string duongdananh, string mabinhchung)
        {
            string query = "ThemDonVi";

            string[]   para       = { "@maDonVi", "@tenDonVi", "@duongDanAnh", "@maBinhChung" };
            string[]   value      = { madonvi, tendonvi, duongdananh, mabinhchung };
            connection Connection = new connection();

            Connection.Excute_Sql_Node(query, CommandType.StoredProcedure, para, value, showResultFromSql);
        }
Ejemplo n.º 11
0
        public void SelectAllSuCo(DataGridView dataGridView, SearchLookUpEdit searchLookUpEdit)
        {
            connection connect;
            string     query   = "SelectAllSuCo";
            DataSet    dataSet = new DataSet();

            connect = new connection();
            dataSet = connect.FillDataSet(query, CommandType.StoredProcedure);
            dataGridView.DataSource = dataSet.Tables[0];
            searchLookUpEdit.Properties.DataSource = dataSet.Tables[0];
        }
Ejemplo n.º 12
0
        public void SelectSuCoWithKeHoach(DataGridView dataGridView, SearchLookUpEdit searchLookUpEdit, int maKeHoach)
        {
            connection connect;
            string     query   = "SelectSuCoWithIDKeHoach ";
            DataSet    dataSet = new DataSet();

            connect = new connection();
            dataSet = connect.FillDataSet(query, CommandType.StoredProcedure, new [] { "maKeHoach" }, new object[] { maKeHoach });
            dataGridView.DataSource = dataSet.Tables[0];
            searchLookUpEdit.Properties.DataSource = dataSet.Tables[0];
        }
Ejemplo n.º 13
0
        public DataSet getDataChildNode(string mabinhchung)
        {
            string query = "LayTTDonViTheoBinhChung";

            string[]   para    = { "@mabinhchung" };
            string[]   value   = { mabinhchung };
            DataSet    dataSet = new DataSet();
            connection connect = new connection();

            dataSet = connect.FillDataSet(query, CommandType.StoredProcedure, para, value);
            return(dataSet);
        }
Ejemplo n.º 14
0
        public void XoaChucVu(string tenChucVu)
        {
            string query = "XoaChucVu";

            string[]   para    = { "@tenChucVu" };
            string[]   value   = { tenChucVu };
            connection connect = new connection();
            int        result  = Excute_Sql(query, CommandType.StoredProcedure, para, value);

            if (result > 0)
            {
                DialogResult dialogResult = MessageBox.Show("Xoá chức vụ thành công", "Information message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (dialogResult == DialogResult.OK)
                {
                    Program.phanquyen.AddChucVuVaoCombobox();
                }
            }
        }
Ejemplo n.º 15
0
        public void XoaNhanVien(string madangnhap)
        {
            string query = "XoaNhanVien";

            string[] para  = { "@maDangNhap" };
            string[] value = { madangnhap };
            connect = new connection();
            int result = connection.Excute_Sql(query, CommandType.StoredProcedure, para, value);

            if (result > 0)
            {
                DialogResult dialogResult = MessageBox.Show("Xoa nhan vien thanh cong", "Information message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (dialogResult == DialogResult.OK)
                {
                    Program.quanLyNhanVien.QuanLyNhanVien_Load(null, null);
                }
            }
        }
Ejemplo n.º 16
0
        public void XoaThamSo(int mathamso)
        {
            string query = "XoaThamSo";

            string[] para  = { "@mathamso" };
            int[]    value = new int[] { mathamso };
            object[] obj   = (from i in value select i).Cast <object>().ToArray();
            connect = new connection();
            int result = Excute_Sql(query, CommandType.StoredProcedure, para, obj);

            if (result > 0)
            {
                DialogResult dialogResult = MessageBox.Show("Xoa tham so thanh cong", "Information message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (dialogResult == DialogResult.OK)
                {
                    Program.thamSoDauVao.ThamSoDauVao_Load(null, null);
                }
            }
        }
Ejemplo n.º 17
0
        public List <Dem> SelectAllFileDem()
        {
            connection connect;

            string  query   = "SelectAllFile";
            DataSet dataSet = new DataSet();

            connect = new connection();
            dataSet = connect.FillDataSet(query, CommandType.StoredProcedure);
            List <Dem> list = new List <Dem>();

            foreach (DataRow row in dataSet.Tables[0].Rows)
            {
                list.Add(new Dem()
                {
                    MaFile   = row.Field <int>((int)FileDemField.MaFile),
                    TenFile  = row.Field <string>((int)FileDemField.TenFile),
                    DuongDan = row.Field <string>((int)FileDemField.DuongDan)
                });
            }
            return(list);
        }