コード例 #1
0
 public List <CourseRegistrationEntity> Search(CourseRegistrationEntity data)
 {
     try
     {
         return(Connection.Db.Query <CourseRegistrationEntity>("spCourseRegistrationSearch",
                                                               new
         {
             ID = data.Id,
             CourseId = data.CourseId,
             StudentId = data.StudentId,
             DateTime = "%" + data.DateTime + "%",
         }, commandType: CommandType.StoredProcedure).ToList());
     }
     catch (Exception ex)
     {
         SaveLog.Save(ex);
         return(new List <CourseRegistrationEntity>());
     }
 }
コード例 #2
0
 public int Save(CourseRegistrationEntity data)
 {
     try
     {
         return(Connection.Db.Query <int>("spCourseRegistrationSet",
                                          new
         {
             ID = data.Id,
             CourseId = data.CourseId,
             StudentId = data.StudentId,
             DateTime = data.DateTime,
         }, commandType: CommandType.StoredProcedure).SingleOrDefault());
     }
     catch (Exception ex)
     {
         SaveLog.Save(ex);
         return(-1);
     }
 }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Home.PrevPage = HttpContext.Current.Request.Url.AbsoluteUri; //"Registration.aspx";
            }
            catch (Exception) { }

            try
            {
                if (!IsLogin())
                {
                    return;
                }

                var crEntity = new CourseRegistrationEntity
                {
                    CourseId  = Convert.ToInt32(Request.QueryString["Course"]),
                    StudentId = Student.Id,
                    DateTime  = TafsirLib.Tools.Shamsi.DateShamsiBaformat
                };

                var cr = new TafsirLib.CourseRegistration().Save(crEntity);
            }
            catch (Exception ex)
            {
                var t = ex.Message;
            }

            try
            {
                if (!IsLogin())
                {
                    return;
                }

                var typeid = Request.QueryString["id"];

                switch (typeid)
                {
                case "1":
                    titledore.InnerText = "ثبت نام دوره های حضوری";
                    break;

                case "2":
                    titledore.InnerText = "ثبت نام دوره های مجازی";
                    break;

                default:
                    typeid = "1";
                    titledore.InnerText = "ثبت نام دوره های حضوری";
                    break;
                }

                ListView1.DataSource = new TafsirLib.Course().Load(typeid, Student.Id.ToString());
                ListView1.DataBind();
            }
            catch (Exception ex)
            {
                var t = ex.Message;
            }
        }