Exemple #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 buttonissue       = e.Row.FindControl("ButtonIssue") as Button;
                Button buttonissuecancel = e.Row.FindControl("ButtonIssueCancel") as Button;
                string activityid        = ((DataRowView)e.Row.DataItem).Row.ItemArray[0].ToString();
                string ticketstatus      = ((DataRowView)e.Row.DataItem).Row.ItemArray[9].ToString();

                DateTime atime = Convert.ToDateTime(((DataRowView)e.Row.DataItem).Row.ItemArray[2]);


                if (ticketstatus == "发布中")
                {
                    if (DateTime.Now < atime)
                    {
                        buttonissue.Enabled       = false;
                        buttonissuecancel.Enabled = true;
                    }
                    else
                    {
                        DtCms.BLL.Activity activity = new DtCms.BLL.Activity();
                        activity.UpdateOneRecordTicketStatusCancel(activityid);
                    }
                }
                else if (ticketstatus == "未发布")
                {
                    buttonissue.Enabled       = true;
                    buttonissuecancel.Enabled = false;
                }
            }
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            DtCms.BLL.Activity activityBLL = new DtCms.BLL.Activity();
            string             activityid  = HiddenFieldSub.Value;
            string             Middle      = TextBoxMiddle.Text.Trim();

            activityBLL.UpdateFieldMid(activityid, Middle);
            Response.Write("<script>alert('提交成功。')</script>");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DtCms.BLL.Activity activityBLL = new DtCms.BLL.Activity();
            string             activityid  = HiddenFieldSub.Value;


            activityBLL.UpdateFieldPreparation(activityid, TextBoxPre.Text.Trim());
            Response.Write("<script>alert('提交成功。')</script>");
        }
        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_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;
         }
     }
 }
Exemple #7
0
 protected void ButtonEditSub_Click(object sender, EventArgs e)
 {
     DtCms.BLL.Activity   activityBLL = new DtCms.BLL.Activity();
     DtCms.Model.Activity activity    = new DtCms.Model.Activity();
     activity.ActivityId  = TextBoxActivityId.Text.Trim();
     activity.Applicant   = TextBoxApplicant.Text.Trim();
     activity.Title       = TextBoxTitle.Text.Trim();
     activity.Budget      = Convert.ToInt32(TextBoxBudget.Text.Trim());
     activity.ATime       = Convert.ToDateTime(TextBoxATime.Text);
     activity.Place       = TextBoxPlace.Text.Trim();
     activity.AConten     = TextBoxAcontent.Text.Trim();
     activity.CheckStatus = TextBoxCheckStatus.Text.Trim();
     activityBLL.Update(activity);
     Response.Write("<script>alert('提交成功。')</script>");
 }
Exemple #8
0
        protected void ButtonBack_Click(object sender, EventArgs e)
        {
            string activityId = HiddenFieldBack.Value.ToString();

            DtCms.Model.Activity activity    = new DtCms.Model.Activity();
            DtCms.BLL.Activity   activityBLL = new DtCms.BLL.Activity();
            activity.ActivityId  = activityId;
            activity.ASuggestion = TextBoxSuggestion.Text.Trim();
            activity.CheckStatus = "退回修改";
            if (activity.ATime == null || activity.ATime == DateTime.MinValue)
            {
                activity.ATime = new DateTime(1900, 1, 1);
            }
            activityBLL.UpdateOneRecordAuditStatusBack(activityId);
            activityBLL.UpdateFieldSu(activityId, TextBoxSuggestion.Text.Trim());
            Response.Write("<script>alert('提交成功。')</script>");
        }
        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();
            }
        }
Exemple #10
0
 protected void ButtonEditSub_Click(object sender, EventArgs e)
 {
     DtCms.BLL.Activity   activityBLL = new DtCms.BLL.Activity();
     DtCms.Model.Activity activity    = new DtCms.Model.Activity();
     activity.ActivityId  = TextBoxActivityId.Text.Trim();
     activity.Applicant   = TextBoxApplicant.Text.Trim();
     activity.Title       = TextBoxTitle.Text.Trim();
     activity.Budget      = Convert.ToInt32(TextBoxBudget.Text.Trim());
     activity.ATime       = Convert.ToDateTime(Request.Form["test5"]);
     activity.Place       = DropDownAPlace.SelectedValue.Trim();
     activity.AConten     = TextBoxAcontent.Text.Trim();
     activity.CheckStatus = TextBoxCheckStatus.Text.Trim();
     activity.ASuggestion = "无建议";
     activityBLL.Update(activity);
     Response.Write("<script>alert('提交成功。')</script>");
     activityBLL.ReupdateOneRecordAuditStatus(TextBoxActivityId.Text.Trim());
     GridView1.DataBind();
 }
Exemple #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Chart1.BackColor            = Color.Moccasin;
            Chart1.BackGradientStyle    = GradientStyle.DiagonalRight;
            Chart1.BorderlineDashStyle  = ChartDashStyle.Solid;
            Chart1.BorderlineColor      = Color.Gray;
            Chart1.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
            DateTime dt = Convert.ToDateTime(DropDownList1.SelectedValue);

            // forma the chart area
            Chart1.ChartAreas[0].BackColor = Color.Wheat;
            // add and format the title
            Chart1.Titles.Add("年度审核情况表");
            // Chart1.Titles[0].Font = new Font("Utopia", 14, FontStyle.Bold);

            Chart1.Series.Add(new Series("Pie")
            {
                ChartType    = SeriesChartType.Pie,
                ShadowOffset = 2
            });
            DtCms.BLL.Activity activity = new DtCms.BLL.Activity();

            Chart1.Series[0].Label      = "#VALX \n\n #PERCENT{P}";//显示百分比和说明
            Chart1.Series[0].LegendText = "#VALX";
            int a = activity.GetCountMode("审核通过", dt);
            int b = activity.GetCountMode("不批准", dt);
            int c = activity.GetCountMode("退回修改", dt);
            int d = activity.GetCountMode("未审核", dt);
            int f = activity.GetCountMode("再次提交", dt);

            double[] yValues = { a, b, c, d, f };
            string[] xValues = { "审核通过", "不批准", "退回修改", "未审核", "再次提交" };
            //饼状图的标签方位
            Chart1.Series[0]["PieLabelStyle"] = "Outside";
            Chart1.Series[0]["PieLineColor"]  = "Black";
            Chart1.Series[0].Points.DataBindXY(xValues, yValues);

            //每个部分开花
            foreach (DataPoint point in Chart1.Series[0].Points)
            {
                point["Exploded"] = "true";
            }
        }
        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();
            }
        }
Exemple #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DtCms.BLL.Activity activity = new DtCms.BLL.Activity();



            int[]    icount = new int[4];
            string[] irange = new string[4];

            icount[0] = activity.GetCountMode("审核通过");
            icount[1] = activity.GetCountMode("不批准");
            icount[2] = activity.GetCountMode("退回修改");
            icount[3] = activity.GetCountMode("未审核");



            Bitmap bm = new Bitmap(700, 300);

            Graphics g;

            g = Graphics.FromImage(bm);
            //由此Bitmap实例创建Graphic实例
            g.Clear(Color.White);

            g.DrawString("活动审核情况", new Font("微软雅黑", 16), Brushes.Black, new Point(150, 5));

            irange[0] = "审核通过";
            irange[1] = "不批准";
            irange[2] = "退回修改";
            irange[3] = "未审核";



            Point myRec = new Point(515, 34);
            Point myDec = new Point(540, 30);
            Point myTxt = new Point(628, 30);

            g.DrawString("单位:个", new Font("微软雅黑", 9), Brushes.Black, new Point(555, 12));

            for (int i = 0; i < 4; i++)
            {
                g.FillRectangle(new SolidBrush(GetColor(i)), myRec.X, myRec.Y, 20, 10);
                //填充小方块
                g.DrawRectangle(Pens.Black, myRec.X, myRec.Y, 20, 10);
                //绘制小方块
                g.DrawString(irange[i].ToString() + "", new Font("微软雅黑", 9), Brushes.Black, myDec);
                //绘制小方块右边的文字
                g.DrawString(icount[i].ToString(), new Font("微软雅黑", 9), Brushes.Black, myTxt);
                myRec.Y += 15;
                myDec.Y += 15;
                myTxt.Y += 15;
            }
            //从数据库中得到的数值大小,绘制扇型,并以相应色彩填充扇型
            int   iTatal        = 0;
            float fCurrentAngle = 0;
            float fStartAngle   = 0;

            for (int i = 0; i < icount.Length; i++)
            {
                iTatal = iTatal + icount[i];
            }
            for (int i = 0; i < icount.Length; i++)
            {
                //以下代码是获得要绘制扇型的开始角度
                if (i == icount.Length - 1)
                {
                    fCurrentAngle = 360 - fStartAngle;
                }
                else
                {
                    int iTemp = icount[i];
                    fCurrentAngle = (iTemp * 360) / iTatal;
                }


                g.FillPie(new SolidBrush(GetColor(i)), 100, 40, 250, 250, fStartAngle, fCurrentAngle);
                fStartAngle += fCurrentAngle;
            }

            Pen p = new Pen(Color.Black, 2);

            g.DrawRectangle(p, 1, 1, 698, 298);
            // filestream fs = new filestream(Pie.jpg, filemode.create);
            // System.Drawing.Image originalImage = System.Drawing.Bitmap.FromStream(file.InputStream);
            // pbphoto.image.save(fs, imageformat.jpeg);
            bm.Save(@"D:\gradution_file\Dtcms.Web\Admin\Images\Pie.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

            // bm.Save(Response.OutputStream, ImageFormat.Jpeg);
            g.Dispose();
        }
Exemple #14
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();
            }
        }