コード例 #1
0
        protected void Lnk_Click(object sender, GridViewCommandEventArgs e)
        {
            int Id = DataConverter.CLng(e.CommandArgument);

            if (e.CommandName == "Edit")
            {
                Response.Redirect("SurveyItem.aspx?SID=" + Sid + "&QID=" + Id);
            }
            if (e.CommandName == "MovePre")
            {
                M_Question info = B_Survey.GetQuestion(Id);
                if (info.OrderID != B_Survey.GetMinOrderID(info.SurveyID))
                {
                    M_Question Pre       = B_Survey.GetQuestion(B_Survey.PreQusID(info.SurveyID, info.OrderID));
                    int        CurrOrder = info.OrderID;
                    info.OrderID = Pre.OrderID;
                    Pre.OrderID  = CurrOrder;
                    B_Survey.UpdateQuestion(info);
                    B_Survey.UpdateQuestion(Pre);
                }
            }
            if (e.CommandName == "MoveNext")
            {
                M_Question info = B_Survey.GetQuestion(Id);
                if (info.OrderID != B_Survey.GetMaxOrderID(info.SurveyID))
                {
                    M_Question Pre       = B_Survey.GetQuestion(B_Survey.NexQusID(info.SurveyID, info.OrderID));
                    int        CurrOrder = info.OrderID;
                    info.OrderID = Pre.OrderID;
                    Pre.OrderID  = CurrOrder;
                    B_Survey.UpdateQuestion(info);
                    B_Survey.UpdateQuestion(Pre);
                }
            }
            MyBind();
        }