Esempio n. 1
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (Request.QueryString.Get("TrainTypeID") != null)
            {
                int bookID      = Convert.ToInt32(Request.QueryString.Get("CoursewareID"));
                int trainTypeID = Convert.ToInt32(Request.QueryString.Get("TrainTypeID"));
                CoursewareTrainTypeBLL objBll = new CoursewareTrainTypeBLL();
                CoursewareTrainType    obj    = objBll.GetCoursewareTrainType(bookID, trainTypeID);
                int order = Convert.ToInt32(txtOrderIndex.Text);
                int max   = Convert.ToInt32(Request.QueryString.Get("MaxOrder"));
                if (order > max)
                {
                    obj.OrderIndex = max;
                }
                else
                {
                    obj.OrderIndex = order;
                }
                objBll.UpdateCoursewareTrainType(obj);
            }
            else
            {
                CoursewareBLL             objBll = new CoursewareBLL();
                RailExam.Model.Courseware obj    = objBll.GetCourseware(Convert.ToInt32(Request.QueryString.Get("CoursewareID")));
                int order = Convert.ToInt32(txtOrderIndex.Text);
                int max   = Convert.ToInt32(Request.QueryString.Get("MaxOrder"));
                if (order > max)
                {
                    obj.OrderIndex = max;
                }
                else
                {
                    obj.OrderIndex = order;
                }
                objBll.UpdateCourseware(obj);
            }

            Response.Write("<script>top.returnValue='true';window.close();</script>");
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }

                if (PrjPub.HasEditRight("课件管理") && PrjPub.IsServerCenter)                //&& PrjPub.CurrentLoginUser.SuitRange == 1
                {
                    HfUpdateRight.Value = "True";
                }
                else
                {
                    HfUpdateRight.Value = "False";
                }
                if (PrjPub.HasDeleteRight("课件管理") && PrjPub.IsServerCenter)                //&& PrjPub.CurrentLoginUser.SuitRange == 1
                {
                    HfDeleteRight.Value = "True";
                }
                else
                {
                    HfDeleteRight.Value = "False";
                }

                OrganizationBLL orgBll = new OrganizationBLL();
                int             orgID  = orgBll.GetStationOrgID(PrjPub.CurrentLoginUser.OrgID);
                HfOrgId.Value = orgID.ToString();

                BindGrid();
            }
            else
            {
                string strDeleteID = Request.Form.Get("DeleteID");
                if (!string.IsNullOrEmpty(strDeleteID))
                {
                    DeleteData(int.Parse(strDeleteID));
                    BindGrid();
                }

                if (Request.Form.Get("Refresh") == "true")
                {
                    BindGrid();
                }
            }

            string strUpID = Request.Form.Get("UpID");

            if (strUpID != null && strUpID != "")
            {
                if (Request.QueryString.Get("type") == "Courseware")
                {
                    CoursewareBLL             objBll = new CoursewareBLL();
                    RailExam.Model.Courseware obj    = objBll.GetCourseware(Convert.ToInt32(strUpID));
                    obj.OrderIndex = obj.OrderIndex - 1;
                    objBll.UpdateCourseware(obj);
                }

                if (Request.QueryString.Get("type") == "TrainType")
                {
                    int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id"));
                    CoursewareTrainTypeBLL objTrainTypeBll = new CoursewareTrainTypeBLL();
                    CoursewareTrainType    objTrainType    =
                        objTrainTypeBll.GetCoursewareTrainType(Convert.ToInt32(strUpID), trainTypeID);
                    objTrainType.OrderIndex = objTrainType.OrderIndex - 1;
                    objTrainTypeBll.UpdateCoursewareTrainType(objTrainType);
                }
                BindGrid();
            }

            string strDownID = Request.Form.Get("DownID");

            if (strDownID != null && strDownID != "")
            {
                if (Request.QueryString.Get("type") == "Courseware")
                {
                    CoursewareBLL             objBll = new CoursewareBLL();
                    RailExam.Model.Courseware obj    = objBll.GetCourseware(Convert.ToInt32(strDownID));
                    obj.OrderIndex = obj.OrderIndex + 1;
                    objBll.UpdateCourseware(obj);
                }

                if (Request.QueryString.Get("type") == "TrainType")
                {
                    int trainTypeID = Convert.ToInt32(Request.QueryString.Get("id"));
                    CoursewareTrainTypeBLL objTrainTypeBll = new CoursewareTrainTypeBLL();
                    CoursewareTrainType    objTrainType    =
                        objTrainTypeBll.GetCoursewareTrainType(Convert.ToInt32(strDownID), trainTypeID);
                    objTrainType.OrderIndex = objTrainType.OrderIndex + 1;
                    objTrainTypeBll.UpdateCoursewareTrainType(objTrainType);
                }
                BindGrid();
            }
        }