Exemplo n.º 1
0
        private string Execute(ref string records, string StoreProcedureName)
        {
            try
            {
                clsDatabase cls = new clsDatabase();
                cls.OpenConnect();
                string[] Values = new string[] { PK_Maloaihinh, Tenloaihinh, Gia, Ngaythem, Ngayhuy, Danghoatdong };
                if (Paras.Length != Values.Length)
                {
                    return("Tham bien va tham tri khong tuong thich");
                }
                else
                {
                    cls.ExecuteSP(StoreProcedureName, Paras, Values, ref records);
                }

                cls.CloseConnect();
            }
            catch (Exception ex)
            {
                error = ex.ToString();
                MessageBox.Show("Có lỗi \n " + ex.Message);
            }
            return(error);
        }
Exemplo n.º 2
0
        //DataTable dt;

        private string Execute(ref string records, string StoreProcedureName)
        {
            try
            {
                clsDatabase cls = new clsDatabase();
                cls.OpenConnect();
                string[] Values = new string[] { PK_Bacsi, TenBS, Trinhdo, Chuyenkhoa, Ngaybatdau, Namkinhnghiem };
                if (Paras.Length != Values.Length)
                {
                    return("Tham bien va tham tri khong tuong thich");
                }
                else
                {
                    cls.ExecuteSP(StoreProcedureName, Paras, Values, ref records);
                }

                cls.CloseConnect();
            }
            catch (Exception ex)
            {
                error = ex.ToString();
                MessageBox.Show("Co loi " + ex.Message);
            }
            return(error);
        }
Exemplo n.º 3
0
        public string GetData(ref DataTable tbl)
        {
            try
            {
                clsDatabase cls = new clsDatabase();
                cls.OpenConnect();
                string[] Values = new string[] { PK_Maloaihinh, Tenloaihinh, Gia, Ngaythem, Ngayhuy, Danghoatdong };
                if (Paras.Length != Values.Length)
                {
                    return("Tham bien va tham tri khong tuong thich");
                }
                else
                {
                    cls.getValue(ref tbl, "SPSelectBangGia", Paras, Values);
                }

                cls.CloseConnect();
            }
            catch (Exception ex)
            {
                error = ex.ToString();
                MessageBox.Show("Có lỗi\n" + ex.Message);
            }
            return(error);
        }
Exemplo n.º 4
0
        public string GetData(ref DataTable tbl)
        {
            try
            {
                clsDatabase cls = new clsDatabase();
                cls.OpenConnect();
                string[] Values = new string[] { PK_Bacsi, TenBS, Trinhdo, Chuyenkhoa, Ngaybatdau, Namkinhnghiem };
                if (Paras.Length != Values.Length)
                {
                    return("Tham bien va tham tri khong tuong thich");
                }
                else
                {
                    cls.getValue(ref tbl, "SPSelectBacsi", Paras, Values);
                }

                cls.CloseConnect();
            }
            catch (Exception ex)
            {
                error = ex.ToString();
                MessageBox.Show("Co loi " + ex.Message);
            }
            return(error);
        }
Exemplo n.º 5
0
        //DataTable dt;

        private string Execute(ref string records, string StoreProcedureName)
        {
            try
            {
                clsDatabase cls = new clsDatabase();
                cls.OpenConnect();
                string[] Values = new string[] { PK_MaBN, Hoten, CMND, Ngaysinh, Gioitinh, Diachi, Sodienthoai };
                if (Paras.Length != Values.Length)
                {
                    return("Tham bien va tham tri khong tuong thich");
                }
                else
                {
                    cls.ExecuteSP(StoreProcedureName, Paras, Values, ref records);
                }

                cls.CloseConnect();
            }
            catch (Exception ex)
            {
                error = ex.ToString();
                MessageBox.Show("Co loi " + ex.Message);
            }
            return(error);
        }
Exemplo n.º 6
0
        public string GetData(ref DataTable tbl)
        {
            try
            {
                clsDatabase cls = new clsDatabase();
                cls.OpenConnect();
                string[] Values = new string[] { PK_MaBN, Hoten, CMND, Ngaysinh, Gioitinh, Diachi, Sodienthoai };
                if (Paras.Length != Values.Length)
                {
                    return("Tham bien va tham tri khong tuong thich");
                }
                else
                {
                    cls.getValue(ref tbl, "SPSelectBenhNhan", Paras, Values);
                }

                cls.CloseConnect();
            }
            catch (Exception ex)
            {
                error = ex.ToString();
                MessageBox.Show("Co loi " + ex.Message);
            }
            return(error);
        }
Exemplo n.º 7
0
        public string GetData_TimKiem(ref DataTable tbl)
        {
            try
            {
                clsDatabase cls = new clsDatabase();
                cls.OpenConnect();
                string[] Values = new string[] { PK_MaPhieu, TenBN, TenBS, Dontiep, Dientim, Noi, Noinhi, Noi4, Ngoai, San, Xquang, Sieuam, Sinhhoa, Huyethoc, Taimuihong, Ranghammat, Ngaykham, Tongtien };
                if (Paras_TimKiem.Length != Values.Length)
                {
                    return("Tham bien va tham tri khong tuong thich");
                }
                else
                {
                    cls.getValue(ref tbl, "SPSelectPhieuKham_TimKiem", Paras_TimKiem, Values);
                }

                cls.CloseConnect();
            }
            catch (Exception ex)
            {
                error = ex.ToString();
                MessageBox.Show("Co loi " + ex.Message);
            }
            return(error);
        }
Exemplo n.º 8
0
        //DataTable dt;

        private string Execute(ref string records, string StoreProcedureName)
        {
            try
            {
                clsDatabase cls = new clsDatabase();
                cls.OpenConnect();
                string[] Values = new string[] { PK_MaPhieu, FK_MaBN, FK_MaBacsi, Dontiep, Dientim, Noi, Noinhi, Noi4, Ngoai, San, Xquang, Sieuam, Sinhhoa, Huyethoc, Taimuihong, Ranghammat, Ngaykham, Tongtien };
                if (Paras.Length != Values.Length)
                {
                    return("Tham bien va tham tri khong tuong thich");
                }
                else
                {
                    cls.ExecuteSP(StoreProcedureName, Paras, Values, ref records);
                }

                cls.CloseConnect();
            }
            catch (Exception ex)
            {
                error = ex.ToString();
                MessageBox.Show("Co loi " + ex.Message);
            }
            return(error);
        }