Пример #1
0
 public bool changeName(string id, string name)
 {
     try
     {
         Account acname = db.Accounts.Where(ac => ac.id == id).SingleOrDefault();
         acname.name = name;
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #2
0
 public bool Updatelecturer(string id, string content)
 {
     try
     {
         Program lec = db.Programs.Where(st => st.id == id).Single();
         lec.ProgramLecturer = content;
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #3
0
 public bool AddObj(string ids, string content)
 {
     try
     {
         SyllabusObjective addobj = new SyllabusObjective();
         addobj.id          = createID();
         addobj.idSyllabus  = ids;
         addobj.ObjSContent = content;
         db.SyllabusObjectives.InsertOnSubmit(addobj);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #4
0
 public bool UpdateDocument(string id, string content)
 {
     try
     {
         Syllabus sysdocument = db.Syllabus.Where(info => info.id == id).Single();
         sysdocument.CourseDocument = content;
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #5
0
 public bool AddProOut(string idp, string no, int type, string content)
 {
     try
     {
         ProgramOutcome poc = new ProgramOutcome();
         poc.id             = createID();
         poc.idProgram      = idp;
         poc.OutcomeNo      = no;
         poc.OutcomeType    = type;
         poc.OutcomeContent = content;
         db.ProgramOutcomes.InsertOnSubmit(poc);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #6
0
 public bool AddOut(string ids, string no, string content)
 {
     try
     {
         SyllabusOutcome outadd = new SyllabusOutcome();
         currentID             = createID();
         outadd.id             = currentID;
         outadd.idSyllabus     = ids;
         outadd.OutcomeNo      = no;
         outadd.OutcomeContent = content;
         mapz.AddMap(ids, currentID, "");
         db.SyllabusOutcomes.InsertOnSubmit(outadd);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #7
0
        //add Account
        public bool AddAccount(string user, string name, bool isadmin, bool active)
        {
            try
            {
                Account accAdd = new Account();
                accAdd.id       = createID();
                accAdd.email    = user;
                accAdd.password = en.EncodeSHA1(dic.defaultPass());
                accAdd.name     = name;
                accAdd.isAdmin  = isadmin;
                accAdd.Active   = active;

                db.Accounts.InsertOnSubmit(accAdd);
                db.SubmitChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Пример #8
0
 public bool UpdateMethod(string idmap, string method, string p1, string p2, string p3, int per1, int per2, int per3, int des)
 {
     try
     {
         Mapping manup = db.Mappings.Where(ma => ma.id == idmap).Single();
         manup.Methods       = method;
         manup.FirstPart     = p1;
         manup.SecondPart    = p2;
         manup.ThirdPart     = p3;
         manup.FirstPercent  = per1;
         manup.SecondPercent = per2;
         manup.ThirdPercent  = per3;
         manup.desity        = des;
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #9
0
 private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (MessageBox.Show("Bạn chắc chắn muốn hoàn thành việc xây dựng chương trình đào tạo chứ?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK)
     {
         foreach (Syllabus item in db.Syllabus.Where(s => s.idProgram == idpath).ToList())
         {
             item.isLockEdit = true;
             db.SubmitChanges();
         }
         MessageBox.Show("Cập nhập thành công, bạn không thể xóa môn học.");
     }
 }
Пример #10
0
 public bool AddSche(string idS, DateTime date, int number, string content, string acitve, string doc, bool mid)
 {
     try
     {
         SyllabusSchedule addsche = new SyllabusSchedule();
         addsche.id             = createScheID();
         addsche.idSyllabus     = idS;
         addsche.Day            = date;
         addsche.NumberPeriods  = number;
         addsche.LectureContent = content;
         addsche.Activites      = acitve;
         addsche.Doc            = doc;
         addsche.mid            = mid;
         db.SyllabusSchedules.InsertOnSubmit(addsche);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #11
0
 public bool successUpdate(string user, string pass)
 {
     try
     {
         Account acc = db.Accounts.Where(ac => ac.email == user).SingleOrDefault();
         acc.password = pass;
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Пример #12
0
 public bool CreateProgram(string idAcc, string namepro)
 {
     try
     {
         Program pr = new Program();
         pr.id        = createID();
         pr.name      = namepro;
         pr.idAccount = idAcc;
         db.Programs.InsertOnSubmit(pr);
         db.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }