示例#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);
        }
示例#2
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);
        }
示例#3
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);
        }
        //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);
        }