Exemplo n.º 1
0
        public void InitData()
        {
            try
            {
                if (Session["ID"].ToString() != "")
                {
                    DFurtherStudy dfu = df.FindByID(Convert.ToInt32(Session["ID"]));

                    tUser.Text                  = user.FindByUserID(dfu.UserInfoID.Value);
                    tStudyPlace.Text            = dfu.StudyPlace;
                    tStudySchool.Text           = dfu.StudySchool;
                    dSecrecyLevel.SelectedValue = (dfu.SecrecyLevel - 1).ToString();
                    tContent.Text               = dfu.StudyContent;
                    tDBegainTime.SelectedDate   = dfu.DBegainTime;
                    if (dfu.DEndTime != null)
                    {
                        tDEndTime.SelectedDate = dfu.DEndTime;
                    }
                    else
                    {
                        tDEndTime.SelectedDate = null;
                    }
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
Exemplo n.º 2
0
 //录入进修学习(接受)信息
 public void Insert(DFurtherStudy futherStudy)
 {
     try
     {
         dbcontext.DFurtherStudyContext.Add(futherStudy);
         dbcontext.SaveChanges();
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 3
0
        //判断是否存在该UserID
        public bool ExitUserID(int UserID)
        {
            DFurtherStudy df = dbcontext.DFurtherStudyContext.Where(d => d.UserInfoID == UserID && d.IsPass == true).FirstOrDefault();

            if (df != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
 //将改变表中的审核
 public bool ChangePass(int df, bool ispass)
 {
     try
     {
         DFurtherStudy newdf = dbcontext.DFurtherStudyContext.Find(df);
         newdf.IsPass = ispass;
         dbcontext.SaveChanges();
         return(true);
     }
     catch (System.Data.SqlClient.SqlException e)
     {
         throw e;
     }
 }
Exemplo n.º 5
0
 //根据FutherStudyID删除信息
 public bool Delete(int DfutherStudyID)
 {
     try
     {
         DFurtherStudy futherStudy = dbcontext.DFurtherStudyContext.Where(u => u.DFurtherStudyID == DfutherStudyID).FirstOrDefault();
         dbcontext.DFurtherStudyContext.Attach(futherStudy);
         dbcontext.DFurtherStudyContext.Remove(futherStudy);
         dbcontext.SaveChanges();
         return(true);
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 6
0
 //更新IsPass状态
 public void UpdateIsPass(int ID, bool isPass)
 {
     try
     {
         DFurtherStudy NewDFurtherStudy = dbcontext.DFurtherStudyContext.Find(ID);
         if (NewDFurtherStudy == null)
         {
             return;
         }
         NewDFurtherStudy.IsPass = isPass;
         dbcontext.SaveChanges();
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 7
0
 //更新
 public bool Update(DFurtherStudy df)
 {
     try
     {
         DFurtherStudy newdf = dbcontext.DFurtherStudyContext.Find(df.DFurtherStudyID);
         newdf.UserInfoID   = df.UserInfoID;
         newdf.SecrecyLevel = df.SecrecyLevel;
         newdf.StudyContent = df.StudyContent;
         newdf.StudyPlace   = df.StudyPlace;
         newdf.StudySchool  = df.StudySchool;
         newdf.DEndTime     = df.DEndTime;
         newdf.DBegainTime  = df.DBegainTime;
         newdf.EntryPerson  = df.EntryPerson;
         newdf.IsPass       = df.IsPass;
         dbcontext.SaveChanges();
         return(true);
     }
     catch (System.Data.SqlClient.SqlException e)
     {
         throw e;
     }
 }