Exemplo n.º 1
0
        public bool ThemLoaiPhi(ref string err, string Ma, string Ten)
        {
            bool       f  = false;
            CacLoaiPhi hs = new CacLoaiPhi();

            hs.MaPhi  = Ma;
            hs.TenPhi = Ten;
            try
            {
                dbs.CacLoaiPhis.InsertOnSubmit(hs);
                dbs.SubmitChanges();
                f = true;
            }
            catch (Exception ex)
            {
                err = ex.Message;
            }
            return(f);
        }
Exemplo n.º 2
0
        public bool XoaLoaiPhi(ref string err, string Ma)
        {
            bool       f  = false;
            CacLoaiPhi hs = dbs.CacLoaiPhis.Single(p => p.MaPhi == Ma);

            try
            {
                if (hs != null)
                {
                    dbs.CacLoaiPhis.DeleteOnSubmit(hs);
                    dbs.SubmitChanges();
                    f = true;
                }
            }
            catch (Exception ex)
            {
                err = ex.Message;
            }
            return(f);
        }
Exemplo n.º 3
0
        public bool SuaLoaiPhi(ref string err, string Ma1, string Ma2, string Ten)
        {
            bool       f  = false;
            CacLoaiPhi hs = dbs.CacLoaiPhis.Single(p => p.MaPhi == Ma1);

            try
            {
                if (hs != null)
                {
                    hs.MaPhi  = Ma2;
                    hs.TenPhi = Ten;
                    dbs.SubmitChanges();
                    f = true;
                }
            }
            catch (Exception ex)
            {
                err = ex.Message;
            }
            return(f);
        }