protected void Page_Load(object sender, EventArgs e)
        {
            SRDel.SRSql srSql = new SRDel.SRSql();

            srSql.conn.Open();

            srSql.cmd.CommandText = "select * from tpTB where tpEndTime > @nowDate and tpStartTime < @nowDate order by tpStartTime desc";

            string nowDate = DateTime.Now.ToString();
            srSql.cmd.Parameters.AddWithValue("@nowDate", nowDate);
            srSql.cmd.Parameters.AddWithValue("@nowDate", nowDate);

            srSql.da.Fill(srSql.ds, "tb_tp");
            foreach (DataRow dr in srSql.ds.Tables["tb_tp"].Rows)
            {
                HyperLink hl = new HyperLink();
                hl.Text = dr["tpName"].ToString();
                hl.NavigateUrl =  "/slip/tpNotice.aspx?tpid="+dr["tpID"];
                hl.CssClass = "logo_tips";
                Panel1.Controls.Add(hl);
            }
               // this.HyperLinkTp.Text = srSql.ds.Tables["tb_tp"].Rows[0]["tpName"].ToString();
            //this.HyperLinkTp.NavigateUrl = srSql.ds.Tables["tb_tp"].Rows[0]["tpNotice"].ToString();

            srSql.conn.Close();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                SRDel.SRSql srDql = new SRDel.SRSql();
                srDql.conn.Open();
                srDql.cmd.CommandText = "update supportTB set supportContent=@supporContent where supportID=@supportID";
                srDql.cmd.Parameters.AddWithValue("@supporContent", Request.Form[TextBoxSupportContent.UniqueID]);
                srDql.cmd.Parameters.AddWithValue("@supportID", Convert.ToInt32(Request.Form[HiddenFieldSupportID.UniqueID]));
                srDql.cmd.ExecuteNonQuery();
                srDql.conn.Close();
                Response.Redirect("Supports.aspx");
            }

            string supportID = Request.QueryString["sid"];
            if (supportID == null || supportID == "")
            {
                Response.Redirect("/slip/404.aspx");
            }
            else
            {
                SRDel.SRSql srDql = new SRDel.SRSql();
                srDql.conn.Open();
                srDql.cmd.CommandText = "select * from supportTB where supportID= @supportID ";
                srDql.cmd.Parameters.AddWithValue("@supportID",Convert.ToInt32(supportID));

                srDql.da.Fill(srDql.ds,"tb_support");
                srDql.conn.Close();
                HiddenFieldSupportID.Value = supportID;
                LabelSupportTitle1.Text = srDql.ds.Tables["tb_support"].Rows[0]["supportTitle"].ToString();
                TextBoxSupportContent.Text = srDql.ds.Tables["tb_support"].Rows[0]["supportContent"].ToString();
            }
        }
Beispiel #3
0
        public void ProcessRequest(HttpContext context)
        {
            int status = 0;
            string msg = "";
            if (context.Session["userID"] != null)
            {
                //
                if (context.Request.Params["mid"] == "" || context.Request.Params["mid"] == null)
                {
                    msg = "未提交删除数据!";
                }
                else
                {
                    int effict=0;
                    SRDel.SRSql srSql = new SRDel.SRSql();
                    srSql.conn.Open();
                    srSql.cmd.CommandText = "delete from msgs_tb where msgID in (0 , " + context.Request.Params["mid"] + ")";
                    try
                    {
                        status = 1;
                        effict = srSql.cmd.ExecuteNonQuery();
                        msg = "成功删除" + effict + "条记录!";
                    }
                    catch (Exception ex)
                    {
                        msg = ex.Message;
                    }
                    finally
                    {
                        srSql.conn.Close();
                    }

                }
            }
            else
            {
                msg = "您还没有登录或者登录超时!请重新登陆!";
            }

            JsonData jd = new JsonData();
            jd["status"] = status;
            jd["msg"] = msg;
            string echoStr = jd.ToJson();
            context.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            context.Response.Write(echoStr);
            context.Response.End();
        }
Beispiel #4
0
        public void ProcessRequest(HttpContext context)
        {
            int status = 0;
            string msg = "";

            string _mbID = context.Request["mbID"];
            if (_mbID == "" || _mbID == null)
            {
                status = 1;
                msg = "未提交项";
            }
            else
            {

                SRDel.SRSql srSql = new SRDel.SRSql();
                try
                {
                    if (context.Session["userID"] == null)
                    {
                        status = 1;
                        msg = "您未登录或登录超时!";
                    }
                    else
                    {
                        srSql.conn.Open();
                        srSql.cmd.CommandText = "delete from topicMbTb where topicMbID= @topicMbID";
                        srSql.cmd.Parameters.AddWithValue("@topicMbID", Convert.ToInt32(_mbID));
                        srSql.cmd.ExecuteNonQuery();
                        srSql.conn.Close();
                    }
                }
                catch (Exception ex)
                {
                    srSql.conn.Close();
                    status = 1;
                    msg = ex.ToString();
                }
                finally
                {
                    srSql.conn.Close();

                    context.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
                    context.Response.Write("{\"status\":\"" + status.ToString() + "\",\"msg\":\"" + msg + "\"}");
                    context.Response.End();
                }
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                SRDel.SRCom srCom = new SRDel.SRCom();
                string adminAccount = Request.Form[TextBoxAdminAccount.UniqueID];
                string adminPWD=Request.Form[TextBoxAdminPWD.UniqueID];
                adminPWD = srCom.HashPassword(adminPWD);
                SRDel.SRSql srSql = new SRDel.SRSql();
                srSql.conn.Open();
                srSql.cmd.CommandText = "select * from adminTB where adminAccount=@adminAccount";
                srSql.cmd.Parameters.AddWithValue("@adminAccount",adminAccount);
                srSql.dr = srSql.cmd.ExecuteReader();

                if (srSql.dr.Read())
                {
                    if (adminPWD == srSql.dr["adminPWD"].ToString())
                    {
                        Response.Cookies["SlipAdmin"]["adminName"] = srSql.dr["adminName"].ToString();
                        Response.Cookies["SlipAdmin"]["adminID"] = srSql.dr["ID"].ToString();
                        Response.Cookies["SlipAdmin"].Expires = DateTime.Now.AddHours(2);
                        Response.Cookies["SlipAdmin"]["adminIdentity"] = srSql.dr["adminIdentity"].ToString();
                        Response.Redirect("/slip/Manager/");
                    }
                    else
                    {
                        Label1.Text = "密码错误!//"+adminPWD;
                    }
                }
                else
                {
                    Label1.Text = "帐号不存在!";
                }
                srSql.conn.Close();

            }
            RequiredFieldValidator1.Display = ValidatorDisplay.Dynamic;

            RequiredFieldValidator2.Display = ValidatorDisplay.Dynamic;
        }
Beispiel #6
0
        public void ProcessRequest(HttpContext context)
        {
            this.context = context;

            if (context.Request.Params["tpid"] == null || context.Request.Params["tpid"] == "")
            {
                showError("您没有提交要删除的新闻!");
            }
            else
            {
                SRDel.SRSql srSql = new SRDel.SRSql();
                srSql.conn.Open();
                srSql.cmd.CommandText = "delete from tpTB where tpID in (@tpIDs)";
                srSql.cmd.Parameters.AddWithValue("@newsIDs", context.Request.Params["tpid"]);
                string effects = srSql.cmd.ExecuteNonQuery().ToString();
                srSql.conn.Close();
                Hashtable hash = new Hashtable();
                hash["error"] = 0;
                hash["message"] = "成功删除" + effects + "条记录!";
                context.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
                context.Response.Write(JsonMapper.ToJson(hash));
                context.Response.End();
            }
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 提交表单
            if (IsPostBack)
            {

                string _cpID = Request.Form[HiddenFieldCpID.UniqueID].ToString();
                string cpYear = Request.Form[TextBoxCpYear.UniqueID].ToString();
                string cpName = Request.Form[TextBoxCpName.UniqueID].ToString();
                string cpStartTime = Request.Form[TextBoxCpStartTime.UniqueID].ToString();
                string cpEndTime = Request.Form[TextBoxCpEndTime.UniqueID].ToString();
                string cpNotice = Request.Form[TextBoxCpNotice.UniqueID].ToString();

                string cpPostTime = DateTime.Now.ToString();

                SRDel.SRSql srSql = new SRDel.SRSql();
                srSql.conn.Open();
                if (_cpID == null || _cpID == "")
                {
                    //新插入
                    srSql.cmd.CommandText = "insert into cpTB (cpName,cpYear,cpStartTime,cpEndTime,cpNotice,cpPostTime)values(@cpName,@cpYear,@cpStartTime,@cpEndTime,@cpNotice,@cpPostTime)";
                    srSql.cmd.Parameters.AddWithValue("@cpName", cpName);
                    srSql.cmd.Parameters.AddWithValue("@cpYear", cpYear);
                    srSql.cmd.Parameters.AddWithValue("@cpStartTime", cpStartTime);
                    srSql.cmd.Parameters.AddWithValue("@cpEndTime", cpEndTime);
                    srSql.cmd.Parameters.AddWithValue("@cpNotice", cpNotice);
                    srSql.cmd.Parameters.AddWithValue("@cpPostTime", cpPostTime);

                    srSql.cmd.ExecuteNonQuery();

                }
                else
                {
                    //更新

                    srSql.cmd.CommandText = "update cpTB set cpName=@cpName,cpYear=@cpYear,cpStartTime=@cpStartTime,cpEndTime=@cpEndTime,cpNotice=@cpNotice,cpPostTime=@cpPostTime where cpID=@cpID";
                    int cpID = Convert.ToInt32(_cpID);
                    srSql.cmd.Parameters.AddWithValue("@cpName", cpName);
                    srSql.cmd.Parameters.AddWithValue("@cpYear", cpYear);
                    srSql.cmd.Parameters.AddWithValue("@cpStartTime", cpStartTime);
                    srSql.cmd.Parameters.AddWithValue("@cpEndTime", cpEndTime);
                    srSql.cmd.Parameters.AddWithValue("@cpNotice", cpNotice);
                    srSql.cmd.Parameters.AddWithValue("@cpPostTime", cpPostTime);
                    srSql.cmd.Parameters.AddWithValue("@cpID", cpID);
                    srSql.cmd.ExecuteNonQuery();
                }
                srSql.conn.Close();
                Response.Redirect("cp.aspx");
            }
            #endregion

            #region 进入
            string _cpid = Request.QueryString["cpid"];

            if (_cpid == null || _cpid == "")
            {
                //添加
                //设置默认年度
                TextBoxCpYear.Text = DateTime.Now.Year.ToString();
            }
            else
            {
                //保存
                int cpid=Convert.ToInt32(_cpid);
                SRDel.SRSql srSql = new SRDel.SRSql();
                srSql.conn.Open();
                srSql.cmd.CommandText = "select * from cpTB where cpID=@cpid";
                srSql.cmd.Parameters.AddWithValue("@cpid",cpid);
                srSql.dr = srSql.cmd.ExecuteReader();
                if (srSql.dr.Read())
                {
                    HiddenFieldCpID.Value = _cpid;
                    TextBoxCpName.Text=srSql.dr["cpName"].ToString();
                    TextBoxCpEndTime.Text = ((DateTime)srSql.dr["cpEndTime"]).ToShortDateString();
                    TextBoxCpNotice.Text = srSql.dr["cpNotice"].ToString();
                    TextBoxCpStartTime.Text = ((DateTime)srSql.dr["cpStartTime"]).ToShortDateString();
                    TextBoxCpYear.Text = srSql.dr["cpYear"].ToString();
                }

                srSql.conn.Close();
            }

            #endregion
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 保存表单
            if (IsPostBack)
            {
                string tpID = Request.Form[HiddenFieldTPID.UniqueID];
                string tpName = Request.Form[TextBoxTpName.UniqueID];
                string tpStartTime = Request.Form[TextBoxTpStartTime.UniqueID];
                string tpEndTime = Request.Form[TextBoxTpEndTime.UniqueID];
                string tpNotice = Request.Form[TextBoxTpNotice.UniqueID];
                string tpPostTime = DateTime.Now.ToString();
                int cpID = Convert.ToInt32(Request.Form[HiddenFieldCpID.UniqueID]);
                int tpInd = Convert.ToInt32(Request.Form[HiddenFieldTpin.UniqueID]);

                SRDel.SRSql srSql = new SRDel.SRSql();

                srSql.conn.Open();
                if (tpID == "" || tpID == null)
                {
                    //新插入
                    srSql.cmd.CommandText = "insert into tpTB (tpName,tpStartTime,tpEndTime,tpNotice,tpPostTime,tpIndex,forCp) values(@tpName,@tpStartTime,@tpEndTime,@tpNotice,@tpPostTime,@tpIndex,@forCp)";

                    srSql.cmd.Parameters.AddWithValue("@tpName",tpName);
                    srSql.cmd.Parameters.AddWithValue("@tpStartTime", tpStartTime);
                    srSql.cmd.Parameters.AddWithValue("@tpEndTime", tpEndTime);
                    srSql.cmd.Parameters.AddWithValue("@tpNotice", tpNotice);
                    srSql.cmd.Parameters.AddWithValue("@tpPostTime", tpPostTime);
                    srSql.cmd.Parameters.AddWithValue("@tpIndex", tpInd);
                    srSql.cmd.Parameters.AddWithValue("@forCp", cpID);

                    srSql.cmd.ExecuteNonQuery();

                }
                else
                {
                    //更改
                    int _tpID = Convert.ToInt32(tpID);
                    srSql.cmd.CommandText = "update tpTB set tpName=@tpName,tpStartTime=@tpStartTime,tpEndTime=@tpEndTime,tpNotice=@tpNotice,tpIndex=@tpIndex ,forCp=@forCp where tpID=@tpID";
                    srSql.cmd.Parameters.AddWithValue("@tpName", tpName);
                    srSql.cmd.Parameters.AddWithValue("@tpStartTime", tpStartTime);
                    srSql.cmd.Parameters.AddWithValue("@tpEndTime", tpEndTime);
                    srSql.cmd.Parameters.AddWithValue("@tpNotice", tpNotice);
                    srSql.cmd.Parameters.AddWithValue("@tpIndex", tpInd);
                    srSql.cmd.Parameters.AddWithValue("@forCp", cpID);
                    srSql.cmd.Parameters.AddWithValue("@tpID", _tpID);

                    srSql.cmd.ExecuteNonQuery();
                }

                srSql.conn.Close();
                Response.Redirect("cpm.aspx?cpid=" + cpID);
            }

            #endregion

            //进入修改 、添加
            #region 进入修改 、添加
            string tpid = Request.QueryString["tpid"];

            string cpid = Request.QueryString["cpid"];
            string tpIndex=Request.QueryString["tpin"];
            //cpid无值
            if (cpid == "" || cpid == null)
            {
                Response.Redirect("/slip/404.aspx");
            }
            //无进程值
            if (tpIndex == "" || tpIndex == null)
            {
                Response.Redirect("/slip/404.aspx");
            }

            switch (Convert.ToInt32(tpIndex))
            {
                case 0:
                    LabelTitleTp.Text = "题目征集";
                    break;
                case 1:
                    LabelTitleTp.Text = "题目评审";
                    break;
                case 2:
                    LabelTitleTp.Text = "发布申报指南";
                    break;
                case 3:
                    LabelTitleTp.Text = "项目申报";
                    break;
                case 4:
                    LabelTitleTp.Text = "项目评审";
                    break;

                case 5:
                    LabelTitleTp.Text = "项目公示及师生互选";
                    break;
                case 6:
                    LabelTitleTp.Text = "项目实施";
                    break;
                case 7:
                    LabelTitleTp.Text = "中期检查";
                    break;
                case 8:
                    LabelTitleTp.Text = "中期检查结果公示";
                    break;
                case 9:
                    LabelTitleTp.Text = "开始结题";
                    break;

                case 10:
                    LabelTitleTp.Text = "结题验收";
                    break;
            }

            //设置对应项目
            HiddenFieldCpID.Value = cpid;
            //设置对应进程顺序
            HiddenFieldTpin.Value = tpIndex;

            if (tpid == null || tpid == "")
            {
                //开启进程
                LabelTitleTp.Text = "开启" + LabelTitleTp.Text;

                //检查前一项进程是否开启
                if (Convert.ToInt32(tpIndex) > 0)
                {
                    SRDel.SRSql srSql = new SRDel.SRSql();

                    srSql.conn.Open();
                    srSql.cmd.CommandText = "select  count(tpIndex) from tpTB where tpIndex=@tpIndex and forCp=@cpID";

                    srSql.cmd.Parameters.AddWithValue("@tpIndex", Convert.ToInt32(tpIndex) - 1);
                    srSql.cmd.Parameters.AddWithValue("@cpID", Convert.ToInt32(cpid));
                    int ct = Convert.ToInt32(srSql.cmd.ExecuteScalar().ToString());
                    srSql.conn.Close();
                    if (ct == 0)
                    {
                        //前一项未开启!

                        Response.Write("<script type='text/javascript'>alert('前一项进程未开启,不可开启该进程!');history.go(-1);</script>");
                    }
                }
            }
            else
            {
                //修改进程
                LabelTitleTp.Text = "修改" + LabelTitleTp.Text;
                HiddenFieldTPID.Value = tpid;
                SRDel.SRSql srSql = new SRDel.SRSql();

                srSql.conn.Open();
                srSql.cmd.CommandText = "select * from tpTB where tpID=@tpid";
                srSql.cmd.Parameters.AddWithValue("@tpid",tpid);
                srSql.dr = srSql.cmd.ExecuteReader();
                if (srSql.dr.Read())
                {
                     TextBoxTpName.Text= srSql.dr["tpName"].ToString();
                     TextBoxTpNotice.Text = srSql.dr["tpNotice"].ToString();
                     TextBoxTpStartTime.Text = ((DateTime)srSql.dr["tpStartTime"]).ToShortDateString();
                     TextBoxTpEndTime.Text = ((DateTime)srSql.dr["tpEndTime"]).ToShortDateString();
                }
                srSql.conn.Close();
            }
            #endregion
        }