Esempio n. 1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ButtonEdit")
            {
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                string AuditStatus   = ((Label)GridView1.Rows[rowIndex].FindControl("LabelAudit")).Text;
                PanelEdit.Visible     = true;
                HiddenFieldEdit.Value = activityId;
                DtCms.BLL.Activity activity = new DtCms.BLL.Activity();
                TextBoxActivityId.Text  = activityId;
                TextBoxApplicant.Text   = activity.QueryActivity(activityId).Applicant;
                test5.Value             = activity.QueryActivity(activityId).ATime.ToString();
                TextBoxBudget.Text      = activity.QueryActivity(activityId).Budget.ToString();
                TextBoxCheckStatus.Text = activity.QueryActivity(activityId).CheckStatus.ToString();
                DropDownAPlace.Text     = activity.QueryActivity(activityId).Place.ToString();
                TextBoxASuggestion.Text = activity.QueryActivity(activityId).ASuggestion.ToString();
                // DropDownListTicketType.Text = activity.QueryActivity(activityId).TicketType.ToString();
                TextBoxTitle.Text    = activity.QueryActivity(activityId).Title;
                TextBoxAcontent.Text = activity.QueryActivity(activityId).AConten.ToString();

                TextBoxTicketIssue.Text = activity.QueryActivity(activityId).TicketStatus.ToString();
            }
        }
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow & (e.Row.RowState == DataControlRowState.Normal | e.Row.RowState == DataControlRowState.Alternate))
            {
                Button             buttonpre  = e.Row.FindControl("ButtonPreCheck") as Button;
                Button             buttonmid  = e.Row.FindControl("ButtonMidCheck") as Button;
                Button             buttoneve  = e.Row.FindControl("ButtonEveCheck") as Button;
                string             activityId = ((DataRowView)e.Row.DataItem).Row.ItemArray[0].ToString();
                DtCms.BLL.Activity activity   = new DtCms.BLL.Activity();
                Label LabelPreStatus          = e.Row.FindControl("LabelPreStatus") as Label;
                if ((activity.QueryActivity(activityId).ATime < DateTime.Now))
                {
                    LabelPreStatus.Text = "已过期";
                    buttonpre.Enabled   = false;
                    buttonmid.Enabled   = false;
                    buttoneve.Enabled   = false;
                }
                else
                {
                    if (activity.QueryActivity(activityId).Preparation.ToString() == "未提交")
                    {
                        LabelPreStatus.Text = "筹备中";
                        buttonpre.Enabled   = false;
                        buttonmid.Enabled   = false;
                        buttoneve.Enabled   = false;
                    }

                    else if ((activity.QueryActivity(activityId).Middle.ToString()) == "未提交")
                    {
                        LabelPreStatus.Text = "前期准备";
                        buttonpre.Enabled   = true;
                        buttonmid.Enabled   = false;
                        buttoneve.Enabled   = false;
                    }
                    else if ((activity.QueryActivity(activityId).LastPre.ToString()) == "未提交")
                    {
                        LabelPreStatus.Text = "准备过半";
                        buttonpre.Enabled   = true;
                        buttonmid.Enabled   = true;
                        buttoneve.Enabled   = false;
                    }
                    else if ((activity.QueryActivity(activityId).LastPre.ToString()) != "未提交")
                    {
                        LabelPreStatus.Text = "准备就绪";
                        buttonpre.Enabled   = true;
                        buttonmid.Enabled   = true;
                        buttoneve.Enabled   = true;
                    }
                }
            }
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ButtonIssue")
            {
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                //  string AuditStatus = ((Label)GridView1.Rows[rowIndex].FindControl("LabelAudit")).Text;
                DateTime Atime = Convert.ToDateTime(GridView1.Rows[rowIndex].Cells[2].Text);
                if (DateTime.Now < Atime && DateTime.Now > Atime.AddDays(-10))
                {
                    DtCms.BLL.Activity activity = new DtCms.BLL.Activity();
                    if (activity.QueryActivity(activityId).Middle != "未提交")
                    {
                        activity.UpdateOneRecordTicketStatus(activityId);
                        Response.Write("<script>alert('发布成功。')</script>");
                    }
                    else if (activity.QueryActivity(activityId).Middle == "未提交")
                    {
                        Response.Write("<script>alert('发布失败,进度未达可发布状态。')</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('发布失败,已过期或者还未到发布时间。')</script>");
                }
                GridView1.DataBind();
            }

            if (e.CommandName == "ButtonIssueCancel")
            {
                int                dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int                papeSize      = GridView1.PageSize;
                int                pageIndex     = GridView1.PageIndex;
                int                rowIndex      = dataItemIndex - papeSize * pageIndex;
                string             activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                DtCms.BLL.Activity activity      = new DtCms.BLL.Activity();

                activity.UpdateOneRecordTicketStatusCancel(activityId);
                Response.Write("<script>alert('取消成功。')</script>");

                GridView1.DataBind();
            }
        }
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow & (e.Row.RowState == DataControlRowState.Normal | e.Row.RowState == DataControlRowState.Alternate))
     {
         Button             buttonpre  = e.Row.FindControl("ButtonPreSub") as Button;
         Button             buttonmid  = e.Row.FindControl("ButtonMidSub") as Button;
         Button             buttoneve  = e.Row.FindControl("ButtonEveSub") as Button;
         string             activityId = ((DataRowView)e.Row.DataItem).Row.ItemArray[0].ToString();
         DtCms.BLL.Activity activity   = new DtCms.BLL.Activity();
         if (DateTime.Now.AddDays(1) < activity.QueryActivity(activityId).ATime)
         {
             buttoneve.Enabled = false;
         }
     }
 }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ButtonPreSub")
            {
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                PanelPre.Visible     = true;
                HiddenFieldSub.Value = activityId;
                DtCms.BLL.Activity activity = new DtCms.BLL.Activity();
                TextBoxPre.Text = activity.QueryActivity(activityId).Preparation.ToString();
            }
            if (e.CommandName == "ButtonMidSub")
            {
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                PanelMiddle.Visible = true;

                HiddenFieldSub.Value = activityId;
                DtCms.BLL.Activity activity = new DtCms.BLL.Activity();
                TextBoxMiddle.Text = activity.QueryActivity(activityId).Middle.ToString();
            }
            if (e.CommandName == "ButtonEveSub")
            {
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                HiddenFieldSub.Value = activityId;
                PanelEve.Visible     = true;

                DtCms.BLL.Activity activity = new DtCms.BLL.Activity();
                TextBoxEve.Text = activity.QueryActivity(activityId).LastPre.ToString();
            }
        }
Esempio n. 6
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ButtonAudit")
            {
                PanelBack.Visible = false;
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                string AuditStatus   = ((Label)GridView1.Rows[rowIndex].FindControl("LabelAudit")).Text;
                if (AuditStatus == "未审核")
                {
                    DtCms.BLL.Activity activity = new DtCms.BLL.Activity();

                    activity.UpdateOneRecordAuditStatus(activityId);
                }
                if (AuditStatus == "再次提交")
                {
                    DtCms.BLL.Activity activity = new DtCms.BLL.Activity();

                    activity.UpdateOneRecordAuditStatus(activityId);
                }
                else if (AuditStatus == "退回修改")
                {
                    DtCms.BLL.Activity activity = new DtCms.BLL.Activity();

                    activity.UpdateOneRecordAuditStatus(activityId);
                }

                GridView1.DataBind();
            }
            if (e.CommandName == "ButtonBack")
            {
                PanelBack.Visible = false;
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                string AuditStatus   = ((Label)GridView1.Rows[rowIndex].FindControl("LabelAudit")).Text;
                if (AuditStatus == "未审核")
                {
                    PanelBack.Visible     = true;
                    HiddenFieldBack.Value = activityId;
                }

                else if (AuditStatus == "再次提交")
                {
                    PanelBack.Visible     = true;
                    HiddenFieldBack.Value = activityId;
                }
                GridView1.DataBind();
            }

            if (e.CommandName == "ButtonUncheck")
            {
                PanelBack.Visible = false;
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                string AuditStatus   = ((Label)GridView1.Rows[rowIndex].FindControl("LabelAudit")).Text;
                if (AuditStatus == "未审核")
                {
                    DtCms.BLL.Activity activity = new DtCms.BLL.Activity();

                    activity.UpdateOneRecordAuditStatusUncheck(activityId);
                }
                else if (AuditStatus == "再次提交")
                {
                    DtCms.BLL.Activity activity = new DtCms.BLL.Activity();

                    activity.UpdateOneRecordAuditStatusUncheck(activityId);
                }
                else if (AuditStatus == "退回修改")
                {
                    DtCms.BLL.Activity activity = new DtCms.BLL.Activity();

                    activity.UpdateOneRecordAuditStatus(activityId);
                }

                GridView1.DataBind();
            }
            if (e.CommandName == "ButtonEdit")
            {
                PanelBack.Visible = false;
                int    dataItemIndex = Convert.ToInt32(e.CommandArgument);
                int    papeSize      = GridView1.PageSize;
                int    pageIndex     = GridView1.PageIndex;
                int    rowIndex      = dataItemIndex - papeSize * pageIndex;
                string activityId    = GridView1.Rows[rowIndex].Cells[0].Text;
                string AuditStatus   = ((Label)GridView1.Rows[rowIndex].FindControl("LabelAudit")).Text;
                PanelEdit.Visible     = true;
                HiddenFieldEdit.Value = activityId;
                DtCms.BLL.Activity activity = new DtCms.BLL.Activity();
                TextBoxActivityId.Text  = activityId;
                TextBoxApplicant.Text   = activity.QueryActivity(activityId).Applicant;
                TextBoxATime.Text       = activity.QueryActivity(activityId).ATime.ToString();
                TextBoxBudget.Text      = activity.QueryActivity(activityId).Budget.ToString();
                TextBoxCheckStatus.Text = activity.QueryActivity(activityId).CheckStatus.ToString();
                TextBoxPlace.Text       = activity.QueryActivity(activityId).Place.ToString();

                // DropDownListTicketType.Text = activity.QueryActivity(activityId).TicketType.ToString();
                TextBoxTitle.Text    = activity.QueryActivity(activityId).Title;
                TextBoxAcontent.Text = activity.QueryActivity(activityId).AConten.ToString();

                TextBoxTicketIssue.Text = activity.QueryActivity(activityId).TicketStatus.ToString();
            }
        }