Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            NxPlatformMO NxPlatformMO = new NxPlatformMO("LZBgAuthorityConn");
            string       id           = context.Request["id"].ToString();
            string       message      = "";

            if (id != "")
            {
                NxPlatformEO NxPlatformEO = NxPlatformMO.GetByPK(id);
                if (NxPlatformEO.PfNewEndTime == null)
                {
                    NxPlatformEO.PfNewEndTime = new DateTime(1970, 1, 1);
                }

                if (NxPlatformEO.PfNewEndTime < DateTime.Now)
                {
                    NxPlatformMO.PutPfIsNewShowByPK(id, "0"); // 将信息修改为不显示
                    message = "0";
                }
                else
                {
                    message = NxPlatformEO.PfIsNewShow + NxPlatformEO.PfNewFunction;
                }
            }

            context.Response.ContentType = "text/plain";
            context.Response.Write(message);
        }
Пример #2
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            String strPfids   = string.Empty;
            string strPfnames = string.Empty;

            foreach (GridViewRow gvrow in gvPlatform.Rows)
            {
                CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                if (CheckBox.Checked)
                {
                    strPfids   += this.gvPlatform.DataKeys[gvrow.RowIndex]["Pf_id"].ToString() + "|";
                    strPfnames += this.gvPlatform.DataKeys[gvrow.RowIndex]["Pf_name"].ToString() + ",";
                }
            }
            if (strPfids == "" && strPfids.Length == 0)
            {
                //Jswork.Alert("请至少选择一条记录进行删除", this.Page);

                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.tip_only_delete;//"请至少选择一条记录进行删除";

                return;
            }

            strPfids = strPfids.TrimEnd('|');

            NxPlatformMO pmMO = new NxPlatformMO();

            int iSuccess = 0;

            for (int i = 0; i < strPfids.Split('|').Length; i++)
            {
                //if (pmManage.DelPlatforms("Pf_del = 1", string.Format(" Pf_id = '{0}'", strPfids.Split('|')[i])) > 0)
                StringBuilder strWhere = new StringBuilder();
                strWhere.Append(" 1=1");
                IList <MySqlParameter> parm = new List <MySqlParameter>();

                strWhere.Append(" and Pf_id =@Pt_id");
                parm.Add(new MySqlParameter("@Pt_id", strPfids.Split('|')[i]));
                if (pmManage.DelPlatforms("Pf_del = 1", strWhere.ToString(), parm) > 0)
                {
                    InsertLog(Resources.Resource.Delete_platform, string.Format("Platformname:{0},id:{1}", strPfnames.Split(',')[i], strPfids.Split('|')[i]), 12, GetPlatformIdByValue(1));

                    iSuccess += 1;
                }
            }

            if (iSuccess > 0)
            {
                Jswork.Alert(Resources.Resource.tip_delete_success, this.Page);

                this.BindPlatform();
            }
        }
Пример #3
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            String strPfids   = string.Empty;
            string strPfnames = string.Empty;

            foreach (GridViewRow gvrow in gvChannel.Rows)
            {
                CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                if (CheckBox.Checked)
                {
                    strPfids   += this.gvChannel.DataKeys[gvrow.RowIndex]["Cn_id"].ToString() + "|";
                    strPfnames += this.gvChannel.DataKeys[gvrow.RowIndex]["Cn_channelId"].ToString() + ",";
                }
            }
            if (strPfids == "" && strPfids.Length == 0)
            {
                //Jswork.Alert("请至少选择一条记录进行删除", this.Page);

                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.tip_only_delete;//"请至少选择一条记录进行删除";

                return;
            }

            strPfids = strPfids.TrimEnd('|');

            NxPlatformMO pmMO = new NxPlatformMO();

            int iSuccess = 0;

            for (int i = 0; i < strPfids.Split('|').Length; i++)
            {
                if (channelMessage.Del(strPfids.Split('|')[i]) > 0)
                {
                    InsertLog(Resources.Resource.Delete_channel, string.Format("Cn_name:{0},Cn_id:{1}", strPfnames.Split(',')[i], strPfids.Split('|')[i]), -5, GetPlatformIdByValue(1));
                    iSuccess += 1;
                }
            }

            if (iSuccess > 0)
            {
                Jswork.Alert(Resources.Resource.tip_delete_success, this.Page);

                this.BindChannel();
            }
        }