当前位置: 首页>>代码示例>>C#>>正文


C# CollegeERPDBEntities.SaveChanges方法代码示例

本文整理汇总了C#中CollegeERPDBEntities.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# CollegeERPDBEntities.SaveChanges方法的具体用法?C# CollegeERPDBEntities.SaveChanges怎么用?C# CollegeERPDBEntities.SaveChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CollegeERPDBEntities的用法示例。


在下文中一共展示了CollegeERPDBEntities.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: addQuestion

       public void addQuestion(string Question,string[] answers)
       {
           using (db = new CollegeERPDBEntities())
           {
               Questionaire_tbl qstn = new Questionaire_tbl { Question = Question };
               db.Questionaire_tbl.Add(qstn);
               db.SaveChanges();
               foreach (string ans in answers)
               {
                   Answers_tbl anss = new Answers_tbl { Q_ID = qstn.Q_ID, Answer = ans };
                   db.Answers_tbl.Add(anss);
                   db.SaveChanges();
               }
           }

       }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:16,代码来源:DBFunctions.cs

示例2: AddQuestionare

 public void AddQuestionare(int UserID)
 {
     db = new CollegeERPDBEntities();
     
     AdminMails_tbl obj = new AdminMails_tbl {SenderID=UserID,Message="<a href=DownloadReport.aspx?senderid='"+UserID+"'>Download Questionair</a>",Subject="SuggestionRequest",Status=0,Date=DateTime.Now.Date};
     db.AdminMails_tbl.Add(obj);
     db.SaveChanges();
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:8,代码来源:DBFunctions.cs

示例3: AddRegistrationNotice

       public void AddRegistrationNotice(Mails_tbl t)
       {
           db = new CollegeERPDBEntities();

           db.Mails_tbl.Add(t);
           db.SaveChanges();


       }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:9,代码来源:DBFunctions.cs

示例4: AddCandidate

 public int AddCandidate(Candidate_tbl candidate)
 {
     db = new CollegeERPDBEntities();
     
         db.Candidate_tbl.Add(candidate);
         db.SaveChanges();
         return candidate.ID;
     
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:9,代码来源:DBFunctions.cs

示例5: addNotice

 public void addNotice(Notices_tbl nttable)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.Notices_tbl.Add(nttable);
         db.SaveChanges();
     }
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:8,代码来源:DBFunctions.cs

示例6: adddiscussion

 public Discussions_tbl adddiscussion(Discussions_tbl dis)
 {
     db = new CollegeERPDBEntities();
     db.Discussions_tbl.Add(dis);
     db.SaveChanges();
     
     var topic= db.DiscussionTopics_tbl.Where(x=>x.ID==dis.TopicID).FirstOrDefault();
     topic.DateCreated = DateTime.Now;
     db.SaveChanges();
     return dis;
     
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:12,代码来源:DBFunctions.cs

示例7: Enrollcourse

 public void Enrollcourse(Enroll_Course enroll)
 {
     db = new CollegeERPDBEntities();
     var ec = db.Enroll_Course.Where(x => x.Uid == enroll.Uid && x.CourseID == enroll.CourseID).FirstOrDefault();
     if (ec==null)
     {
         db.Enroll_Course.Add(enroll);
         db.SaveChanges();
        
     }
     else if(ec.Status==3)
     {
         ec.Status = 0; //Reenroll Course Request
         db.SaveChanges();
     }
    
    
   
     var candidate = db.Candidate_tbl.Where(x=>x.ID==enroll.Uid).FirstOrDefault();
     var course = db.Courses_tbl.Where(x=>x.ID==enroll.CourseID).FirstOrDefault();
     AdminMails_tbl mail = new AdminMails_tbl {Date=DateTime.Now.Date, Subject = "Course Enrollment Application", SenderID = enroll.Uid, Status = 0, Message =candidate.Name + " Wants to enroll in  " + course.Course + "<br/><br> <a href='EnrollmentAppications.aspx' class='btn btn-primary'>View Enrollment Application</a>" };
     addadminmail(mail);
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:23,代码来源:DBFunctions.cs

示例8: addbook

 public void addbook(Book book)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.Books.Add(book);
         db.SaveChanges();
     }
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:8,代码来源:DBFunctions.cs

示例9: assigncouresefee

 public void assigncouresefee(int sid,int cid)
 {
     db = new CollegeERPDBEntities();
     db.CourseFee_tbl.Add(new CourseFee_tbl {StudentID=sid,CourseID=cid,Status=0});
     db.SaveChanges();
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:6,代码来源:DBFunctions.cs

示例10: addadmssion

    public void addadmssion(List<Candidate_tbl> candidatelist)
    {
        db = new CollegeERPDBEntities();
        int prgid=-1;
foreach(var cand in candidatelist)
{
    
    string matricno=DateTime.Now.Year+"-"+cand.Program_tbl.ProgramName+"-"+cand.ID;
    var std = db.AddmissionList_tbl.Where(x=>x.UserID==cand.ID).FirstOrDefault();
    var info = db.StudentInfo_tbl.Where(x => x.UserId == cand.ID).FirstOrDefault();
    
    if(std==null&&info==null){
       StudentInfo_tbl student = new StudentInfo_tbl { ProgramID = cand.ProgrammeID, StudentLevel = "ND1", UserId = cand.ID, Semester = 0, DeptID = cand.Program_tbl.DeptID, FeeDiscount = "0", AcadamicYear = DateTime.Now.Year.ToString() };
    StudentAcceptanceFee_tbl accfee = new StudentAcceptanceFee_tbl { ProgramID = cand.ProgrammeID, Userid = cand.ID, Status = 0 };
    Mails_tbl mail = new Mails_tbl { RecieverID = cand.ID, Message ="Acceptence Fee Of "+ cand.Program_tbl.AcceptenceFee + " Has Been Assigned to You <br> Please Submit This Fees with in One Week", Subject = "Acceptence Fee", Date = DateTime.Now,Status=0 };
    addmail(mail);
        db.StudentInfo_tbl.Add(student);
        int Year = Convert.ToInt16(student.AcadamicYear);
        Batches_table temp = db.Batches_table.Where(x => x.BatchYear == Year).FirstOrDefault();
        AddmissionList_tbl admission = new AddmissionList_tbl { ProgrameID = cand.ProgrammeID, Status = 0, route = "Merit", UserID = cand.ID, MetricNo = matricno, Password = cand.Password,BatchID=temp.ID };

    db.AddmissionList_tbl.Add(admission);
    db.StudentAcceptanceFee_tbl.Add(accfee);
       

    prgid = cand.ProgrammeID.Value;
}
    var candidates = db.Candidate_tbl.Where(x => x.ProgrammeID == prgid).OrderByDescending(x => x.CuttoffPoints).Skip(100).ToList();
       foreach(var c in candidates)
       {
           c.Status = -1;
       }
       var addmittedcandidates = db.Candidate_tbl.Where(x => x.ProgrammeID == prgid).OrderByDescending(x => x.CuttoffPoints).Take(100).ToList();
       foreach (var c in addmittedcandidates)
       {
           c.Status = 1;
       }
}
        
db.SaveChanges();
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:41,代码来源:DBFunctions.cs

示例11: adddiscussiontopic

 public int adddiscussiontopic(DiscussionTopics_tbl topic)
 {
     db = new CollegeERPDBEntities();
     db.DiscussionTopics_tbl.Add(topic);
     db.SaveChanges();
     return topic.ID;
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:7,代码来源:DBFunctions.cs

示例12: addDateSheet

 public void addDateSheet(DateSheet_tbl DStable)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.DateSheet_tbl.Add(DStable);
         db.SaveChanges();
     }
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:8,代码来源:DBFunctions.cs

示例13: addTimeTable

 public void addTimeTable(TimeTable_tbl ttable)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.TimeTable_tbl.Add(ttable);
         db.SaveChanges();
     }
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:8,代码来源:DBFunctions.cs

示例14: addcourse

 public int addcourse(Courses_tbl course)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.Courses_tbl.Add(course);
         db.SaveChanges();
     }
     return course.ID;
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:9,代码来源:DBFunctions.cs

示例15: UpdateCreditHours

   public void UpdateCreditHours(StudentSelectedCredit t)
   {

       db = new CollegeERPDBEntities();
       db.StudentSelectedCredits.Attach(t);
       db.Entry(t).State = EntityState.Modified;
      
       db.SaveChanges();
   }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:9,代码来源:DBFunctions.cs


注:本文中的CollegeERPDBEntities.SaveChanges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。