示例#1
0
文件: ucPhong.cs 项目: nngocit/strix
        public void XoaTruong()
        {
            DataTable numberr;

            dtoTruongHoc = new DTO_TruongHoc()
            {
                ID = Convert.ToInt32(lblidtruong.Text)
            };

            numberr = _th.TruongHocXoa(ref err, dtoTruongHoc);
            if (numberr.Rows.Count > 0)
            {
                ToastNotification.Show(this, numberr.Rows[0]["ErrMsg"].ToString(), null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.BottomCenter);
            }
        }
示例#2
0
        public DataTable TruongHocXoa(ref string err, DTO_TruongHoc th)
        {
            DataTable _dt = new DataTable();

            try
            {
                return(_dt = data.GetDataTable("sp_TruongHocXoa", CommandType.StoredProcedure, ref err

                                               , new SqlParameter("@ID", th.ID)
                                               ));
            }
            catch (Exception ex)
            {
                err = ex.Message;
                return(_dt);
            }
        }
        List <DTO_TruongHoc> loadDL()
        {
            List <DTO_TruongHoc> dsTH = new List <DTO_TruongHoc>();

            foreach (Node n in graph)
            {
                DTO_TruongHoc th = new DTO_TruongHoc();
                th.STT1      = n.Id;
                th.TenTruong = n.name;
                th.ViDo1     = n.x;
                th.KinhDo    = n.y;
                th.SDT1      = n.SDT;
                th.DiaChi    = n.DiaChi;
                th.TenQuan   = n.tenQuan;
                dsTH.Add(th);
            }
            return(dsTH);
        }
示例#4
0
        public DataTable TruongHocInsert(ref string err, DTO_TruongHoc th)
        {
            DataTable _dt = new DataTable();

            try
            {
                return(_dt = data.GetDataTable("sp_TruongHocInsert", CommandType.StoredProcedure, ref err
                                               , new SqlParameter("@NAME", th.NAME)
                                               , new SqlParameter("@ADDRESSs", th.ADDRESS)
                                               , new SqlParameter("@PHONES", th.PHONE)
                                               ));
            }
            catch (Exception ex)
            {
                err = ex.Message;
                return(_dt);
            }
        }
示例#5
0
文件: ucPhong.cs 项目: nngocit/strix
        public void ThemTruong()
        {
            if (txttenphong.Text == "")
            {
                ToastNotification.Show(this, "Vui lòng điền đủ thông tin!", null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.BottomCenter);
                return;
            }

            DataTable numberr;

            dtoTruongHoc = new DTO_TruongHoc()
            {
                NAME    = txttentruong.Text,
                ADDRESS = txtdiachi.Text,
                PHONE   = txtsdt.Text
            };

            numberr = _th.TruongHocInsert(ref err, dtoTruongHoc);
            if (numberr.Rows.Count > 0)
            {
                ToastNotification.Show(this, numberr.Rows[0]["ErrMsg"].ToString(), null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.BottomCenter);
            }
        }