예제 #1
0
 public NXB_BUS()
 {
     if (SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #2
0
 public DangKy_BUS()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #3
0
        //lay ma sach lon nhat
        public string GetMaSachMax()
        {
            SQLDataContext.CreateDataContext();
            string masach = "";
            try
            {
                //string masach = ""; 
                int maso;
                SQLDataContext.SQLData.sp_getMaSachMax(ref masach);
                maso = int.Parse(masach.Substring(2)) + 1;
                if (maso.ToString().Length == 1)
                    masach = "MS00" + maso.ToString();
                else if (maso.ToString().Length == 2)
                    masach = "MS0" + maso.ToString();
                else masach = "MS" + maso.ToString();

                
                DAUSACH sach = new DAUSACH();
                sach.MASACH = masach;
                SQLDataContext.SQLData.DAUSACHes.InsertOnSubmit(sach);
                SQLDataContext.SQLData.SubmitChanges();
                return masach;
            }
            catch
            {
                return "demo";
            }
        }
예제 #4
0
 public TraCuu_Bus()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #5
0
 public CaiDat_BUS()
 {
     if (!SQLDataContext.IsLoaded)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #6
0
 public ChuyenMuc_Bus()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #7
0
        //lay ma chuyen muc lon nhat
        public string GetMaNXBMax()
        {
            SQLDataContext.CreateDataContext();
            string chuyenmuc = "";

            try
            {
                //string masach = "";
                int maso;
                SQLDataContext.SQLData.sp_getMaCMMax(ref chuyenmuc);
                maso = int.Parse(chuyenmuc.Substring(2)) + 1;
                if (maso.ToString().Length == 1)
                {
                    chuyenmuc = "CM00" + maso.ToString();
                }
                else if (maso.ToString().Length == 2)
                {
                    chuyenmuc = "CM0" + maso.ToString();
                }
                else
                {
                    chuyenmuc = "CM" + maso.ToString();
                }

                CHUYENMUC cm = new CHUYENMUC();
                cm.MACHUYENMUC = chuyenmuc;
                SQLDataContext.SQLData.CHUYENMUCs.InsertOnSubmit(cm);
                SQLDataContext.SQLData.SubmitChanges();
                return(chuyenmuc);
            }
            catch
            {
                return("demo");
            }
        }
예제 #8
0
        //lay ma phieu muon lon nhat
        public string GetMaPMMax()
        {
            try{
                string mapm = ""; int maso;
                SQLDataContext.SQLData.sp_getMaPMMax(ref mapm);
                maso = int.Parse(mapm.Substring(2)) + 1;
                if (maso.ToString().Length == 1)
                {
                    mapm = "PM000" + maso.ToString();
                }
                else if (maso.ToString().Length == 2)
                {
                    mapm = "PM00" + maso.ToString();
                }
                else if (maso.ToString().Length == 3)
                {
                    mapm = "PM0" + maso.ToString();
                }
                else
                {
                    mapm = "PM" + maso.ToString();
                }

                SQLDataContext.CreateDataContext();
                muonsach             = new MUONSACH();
                muonsach.MAPHIEUMUON = mapm;
                SQLDataContext.SQLData.MUONSACHes.InsertOnSubmit(muonsach);
                SQLDataContext.SQLData.SubmitChanges();
                return(mapm);
            }
            catch {
                return("demo");
            }
        }
예제 #9
0
 public BaoCao_BUS()
 {
     if (!SQLDataContext.IsLoaded)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #10
0
 public PhieuMuon_Bus()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #11
0
 public QuaTrinhMuon_Bus()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #12
0
 public QuiDinh_Bus()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #13
0
 public Login_BUS()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #14
0
        //lay ma sach lon nhat
        public string GetMaNXBMax()
        {
            string manxb = "";

            try
            {
                //string masach = "";
                int maso;
                SQLDataContext.SQLData.sp_getMaNXBMax(ref manxb);
                maso = int.Parse(manxb.Substring(3)) + 1;
                if (maso.ToString().Length == 1)
                {
                    manxb = "NXB00" + maso.ToString();
                }
                else if (maso.ToString().Length == 2)
                {
                    manxb = "NXB0" + maso.ToString();
                }
                else
                {
                    manxb = "NXB" + maso.ToString();
                }

                SQLDataContext.CreateDataContext();
                NXB nxb = new NXB();
                nxb.MANXB = manxb;
                SQLDataContext.SQLData.NXBs.InsertOnSubmit(nxb);
                SQLDataContext.SQLData.SubmitChanges();
                return(manxb);
            }
            catch
            {
                return("demo");
            }
        }
예제 #15
0
 public NgonNgu_BUS()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #16
0
        //lay ma chuyen muc lon nhat
        public string GetMaTLMax()
        {
            SQLDataContext.CreateDataContext();
            string theloai = "";

            try
            {
                //string masach = "";
                int maso;
                SQLDataContext.SQLData.sp_getMaTLMax(ref theloai);
                maso = int.Parse(theloai.Substring(2)) + 1;
                if (maso.ToString().Length == 1)
                {
                    theloai = "TL00" + maso.ToString();
                }
                else if (maso.ToString().Length == 2)
                {
                    theloai = "TL0" + maso.ToString();
                }
                else
                {
                    theloai = "TL" + maso.ToString();
                }

                PHANLOAISACH tl = new PHANLOAISACH();
                tl.MALOAI = theloai;
                SQLDataContext.SQLData.PHANLOAISACHes.InsertOnSubmit(tl);
                SQLDataContext.SQLData.SubmitChanges();
                return(theloai);
            }
            catch
            {
                return("demo");
            }
        }
예제 #17
0
 public BaoCao_ThongKe_Bus()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #18
0
 public TheLoai_BUS()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #19
0
 public HocKy_BUS()
 {
     if (!SQLDataContext.IsLoaded)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #20
0
 public DocGia_BUS()
 {
     if (!SQLDataContext.IsLoad)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #21
0
 public GiaoVien_BUS()
 {
     if (!SQLDataContext.IsLoaded)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #22
0
 public Data_BUS()
 {
     conn = new Connection();
     if (!SQLDataContext.IsLoaded)
     {
         SQLDataContext.CreateDataContext();
     }
 }
예제 #23
0
 public bool Login(string id, string pass, ref NHANVIEN nhanvien)
 {
     try
     {
         SQLDataContext.CreateDataContext();
         nhanvien = SQLDataContext.SQLData.NHANVIENs.Where(nv => nv.MANV == id && nv.PASS == pass).FirstOrDefault();
         if (nhanvien == null)
         {
             return(false);
         }
         return(true);
     }
     catch
     {
         return(true);
     }
 }
예제 #24
0
 public Sach_BUS()
 {
     if (!SQLDataContext.IsLoad)
         SQLDataContext.CreateDataContext();
 }