Example #1
0
 private void addData(Song.Entities.TrPlan theme, List <Song.Entities.ExamGroup> groups)
 {
     Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
     if (org != null)
     {
         theme.Org_ID   = org.Org_ID;
         theme.Org_Name = org.Org_Name;
     }
     using (DbTrans tran = Gateway.Default.BeginTrans())
     {
         try
         {
             tran.Save <TrPlan>(theme);
             if (groups != null)
             {
                 foreach (Song.Entities.ExamGroup g in groups)
                 {
                     tran.Save <ExamGroup>(g);
                 }
             }
             tran.Commit();
         }
         catch (Exception ex)
         {
             tran.Rollback();
             throw ex;
         }
         finally
         {
             tran.Close();
         }
     }
 }
Example #2
0
 public void TrpSave(Song.Entities.TrPlan theme, int yuanType, int newType, List <Song.Entities.ExamGroup> groups)
 {
     //不管怎么变,先删除分组表中的数据。
     if (yuanType != 1)
     {
         Gateway.Default.Delete <ExamGroup>(ExamGroup._.Exam_UID == theme.TrP_UID);
     }
     if (newType == 1)
     {
         Gateway.Default.Save <TrPlan>(theme);
     }
     else
     {
         addData(theme, groups);
     }
 }
Example #3
0
 public void TrpAdd(Song.Entities.TrPlan theme, List <Song.Entities.ExamGroup> groups)
 {
     Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
     if (org != null)
     {
         theme.Org_ID   = org.Org_ID;
         theme.Org_Name = org.Org_Name;
     }
     if (groups == null)
     {
         Gateway.Default.Save <TrPlan>(theme);
     }
     else
     {
         addData(theme, groups);
     }
 }