Esempio n. 1
0
        public int themTrinhDoChuyenMon(TrinhDoChuyenMon_DTO tdcm)
        {
            int check = (from t in db.TRINHDOCHUYENMON6s
                         where t.NGANH == tdcm.Nganh
                         select t).Count();

            if (check != 0)
            {
                return(0);
            }

            TRINHDOCHUYENMON6 td = new TRINHDOCHUYENMON6
            {
                MANV       = tdcm.Manv,
                NGANH      = tdcm.Nganh,
                LOAIHINHDT = tdcm.LoaiHinhDT,
                TRUONGDT   = tdcm.TruongDT,
                TRINHDO    = tdcm.TrinhDo
            };

            db.TRINHDOCHUYENMON6s.InsertOnSubmit(td);
            db.SubmitChanges();

            return(1);
        }
        public int themTrinhDoChuyenMon(GunaLabel ma, GunaComboBox td, GunaComboBox lh, GunaTextBox truong, GunaTextBox ng)
        {
            TrinhDoChuyenMon_DTO tdcm = new TrinhDoChuyenMon_DTO(ma.Text, ng.Text, td.SelectedItem.ToString(), lh.SelectedItem.ToString(), truong.Text);

            return(TrinhDoChuyenMon_DAO.createInstance.themTrinhDoChuyenMon(tdcm));
        }