Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);
                    hduid.Value = modeluser.ID.ToString();

                }
                if (Request.Params["cooperationModelId"] != null)
                {
                    cModel = cbll.GetModel(int.Parse(Request.Params["cooperationModelId"].ToString()));
                    if (cModel.ID > 0)
                    {
                        hdcid.Value = cModel.ID.ToString();
                        hdcname.Value = cModel.Name;
                        RptBind(" ChanelID='" + cModel.ID.ToString() + "'" + this.CombSqlTxt(this.keywords));

                    }
                }

            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);
                    hduid.Value = modeluser.ID.ToString();

                }

                baseUrl = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.IndexOf(Request.RawUrl));
                
                if (Request.Params["classId"] != null)
                {
                    classId = Request.Params["classId"].ToString();
                    platformId = Request.Params["classId"].ToString();
                }
                else
                {
                    platformId = "所有平台";
                }
                if (Request.Params["keywords"] != null)
                {
                    keywords = Request.Params["keywords"].ToString();
                    searchinput.Value = Request.Params["keywords"].ToString();
                }
                if (Request.Params["cooperateModelId"] != null)
                {
                    DataTable dt = cbll.GetList(" UserID='" + modeluser.ID + "'  AND c.id='" + Request.Params["cooperateModelId"] + "'").Tables[0]; 
                    if (dt.Rows.Count > 0)
                    {
                        lbTitle.Text = dt.Rows[0]["Title"].ToString();
                        lbBrand.Text = dt.Rows[0]["Brand"].ToString();
                        lbPtitle.Text = dt.Rows[0]["Ptitle"].ToString();
                    }
                    cooperateModelId = Request.Params["cooperateModelId"].ToString();
                    cModel = cbll.GetModel(int.Parse(Request.Params["cooperateModelId"].ToString()));
                     if (cModel.ID > 0)
                     {
                         hdcid.Value = cModel.ID.ToString();
                         hdcname.Value = cModel.Name;
                         RptBind(this.CombSqlTxt(this.classId, this.keywords), "UpdateDate desc");
                     }
                }
            }
            InfoView();
        }
Пример #3
0
    {/// <summary>
     /// 用于新增引用
     /// </summary>
     /// <param name="Model"></param>
     /// <returns></returns>
        public int AddChannel(Model.Channel Model)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("insert Channel(CreateDate, ChannelName,Creator, SealNameId, BeginDate, EndDate) values(GETDATE(),@ChannelName,@Creator,@SealNameId,@BeginDate,@EndDate)");
            return(ZGZY.Common.SqlHelper.ExecuteNonQuery(
                       ZGZY.Common.SqlHelper.connStr,
                       CommandType.Text, strsql.ToString(),
                       new SqlParameter[] {
                new SqlParameter("@ChannelName", Model.ChannelName),
                new SqlParameter("@Creator", Model.Creator),
                new SqlParameter("@SealNameId", Model.SealNameId),
                new SqlParameter("@BeginDate", Model.BeginDate),
                new SqlParameter("@EndDate", Model.EndDate)
            }));
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);
                    hduid.Value = modeluser.ID.ToString();

                }
                if (Request.Params["cooperateId"] != null)
                {
                    DataTable dt = cbll.GetList(" UserID='" + modeluser.ID + "'  AND c.id='" + Request.Params["cooperateId"] + "'").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        lbTitle.Text = dt.Rows[0]["Title"].ToString();
                        lbBrand.Text = dt.Rows[0]["Brand"].ToString();
                        lbPtitle.Text = dt.Rows[0]["Ptitle"].ToString();
                    }

                    cModel = cbll.GetModel(int.Parse(Request.Params["cooperateId"].ToString()));
                    if (cModel.ID > 0)
                    {
                        hdcid.Value = cModel.ID.ToString();
                        hdcname.Value = cModel.Title;
                        chooseGame=extbll.GetList(" e.ChanelID='" + cModel.ID.ToString() + "'").Tables[0];
                    }
                    else
                    {
                        string myScript = @"alertRedirectMsg('参数错误!','error.gif','Channel.aspx');";
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                    }
                }
                else
                {
                    string myScript = @"alertRedirectMsg('参数错误!','error.gif','Channel.aspx');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                }
                InfoView();
            }
        }
Пример #5
0
        /// <summary>
        /// 用于更具id去查询某一引用
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public Model.Channel GetChannelById(object Id)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("select * from Channel where Id=@Id");
            SqlDataReader READ = ZGZY.Common.SqlHelper.ExecuteReader(ZGZY.Common.SqlHelper.connStr, CommandType.Text, strsql.ToString(), new SqlParameter[] { new SqlParameter("@Id", Id) });

            while (READ.Read())
            {
                ZGZY.Model.Channel model = new Model.Channel();
                //Id, ChannelName, CreateDate, Creator, SealNameId, BeginDate, EndDate
                model.Id          = int.Parse(READ["id"].ToString());
                model.ChannelName = READ["ChannelName"].ToString();
                model.CreateDate  = DateTime.Parse(READ["CreateDate"].ToString());
                model.Creator     = READ["Creator"].ToString();
                model.SealNameId  = Int32.Parse(READ["SealNameId"].ToString());
                model.BeginDate   = DateTime.Parse(READ["BeginDate"].ToString());
                model.EndDate     = DateTime.Parse(READ["EndDate"].ToString());
                return(model);
            }
            return(null);
        }
Пример #6
0
        /// <summary>
        ///用于修改引用
        /// </summary>
        /// <param name="Model"></param>
        /// <returns></returns>
        public int EditChannelById(Model.Channel Model)
        {
            StringBuilder       strsql = new StringBuilder();
            List <SqlParameter> list   = new List <SqlParameter>();

            if (Model.ChannelName != "" && Model.ChannelName != null)
            {
                strsql.Append("ChannelName=@ChannelName,");
            }
            list.Add(new SqlParameter("@ChannelName", Model.ChannelName));
            if (Model.SealNameId != 0)
            {
                strsql.Append("SealNameId=@SealNameId,");
            }
            list.Add(new SqlParameter("@SealNameId", Model.SealNameId));
            if (Model.BeginDate != null)
            {
                strsql.Append("BeginDate=@BeginDate,");
            }
            list.Add(new SqlParameter("@BeginDate", Model.BeginDate));
            if (Model.EndDate != null)
            {
                strsql.Append("EndDate=@EndDate,");
            }
            list.Add(new SqlParameter("@EndDate", Model.EndDate));
            if (Model.Creator != null)
            {
                strsql.Append("Creator=@Creator,");
            }
            list.Add(new SqlParameter("@Creator", Model.Creator));
            if (strsql.Length > 0)
            {
                strsql.Remove(strsql.Length - 1, 1);
                strsql.Append(" where Id=@Id ");
                list.Add(new SqlParameter("@Id", Model.Id));
            }
            return(ZGZY.Common.SqlHelper.ExecuteNonQuery(ZGZY.Common.SqlHelper.connStr, CommandType.Text, " update Channel set " + strsql.ToString(), list.ToArray()));
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!getUserCookies())
                {
                    Response.Redirect("~/Index.aspx");
                }
                else
                {
                    modeluser = blluser.GetModelByName(uid);
                    hduid.Value = modeluser.ID.ToString();

                }
                
                if (Request.Params["cooperateModelId"] != null)
                {
                    DataTable dt = cbll.GetList(" UserID='" + modeluser.ID + "'  AND c.id='" + Request.Params["cooperateModelId"] + "'").Tables[0]; 
                    if (dt.Rows.Count > 0)
                    {
                        lbTitle.Text = dt.Rows[0]["Title"].ToString();
                        lbBrand.Text = dt.Rows[0]["Brand"].ToString();
                        lbPtitle.Text = dt.Rows[0]["Ptitle"].ToString();
                    }
                    cModel = cbll.GetModel(int.Parse(Request.Params["cooperateModelId"].ToString()));
                    if (cModel.ID > 0)
                    {
                        hdcid.Value = cModel.ID.ToString();
                        hdcname.Value = cModel.Name;
                        RptBind(" ChanelID='" + cModel.ID.ToString() + "'");
                        //this.rptList.DataSource = extbll.GetList(" e.ChanelID='" + cModel.ID.ToString() + "'").Tables[0];
                        //this.rptList.DataBind();
                    }
                }

            }
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var tb = ctx.ExecuteDataTable("Select * From Channel where State<>255 and ParentId=0 and [Type] in (1,2)");

                ddlParentId.Items.Add(new ListItem("顶级栏目", "0"));
                if (tb != null && tb.Rows.Count > 0)
                {
                    var channels = tb.ToList <Model.Channel>();
                    foreach (var channel in channels)
                    {
                        var item = new ListItem(channel.Name, channel.ID.ToString());
                        item.Attributes.Add("type", channel.Type.ToString());
                        ddlParentId.Items.Add(item);
                    }
                }

                ddlType.Items.Add(new ListItem("栏目列表页", "2"));
                ddlType.Items.Add(new ListItem("内容列表页", "1"));
                ddlType.Items.Add(new ListItem("单独内容页", "0"));
            }
            else
            {
                AjaxResult response = null;

                var txtParentId    = Request.Form["ctl00$ContentPlaceHolder1$ddlParentId"];
                var txtName        = Request.Form["txtName"];
                var txtCode        = Request.Form["txtCode"];
                var txtType        = Request.Form["ctl00$ContentPlaceHolder1$ddlType"];
                var sltContentType = Request.Form["sltContentType"];
                var txtState       = Request.Form["sltState"];
                var txtRemark      = Request.Form["txtRemark"];
                var txtSort        = Request.Form["txtSort"];
                var imageUrl       = !string.IsNullOrEmpty(Request.Form["hifShowImage"])
                                   ? common.Common.UploadImagePath + Request.Form["hifShowImage"]
                                   : "";

                if (string.IsNullOrEmpty(txtCode))
                {
                    response = new AjaxResult()
                    {
                        Success = 0, Message = "代号不能为空!"
                    };
                    this.Response.Write(common.Common.GetJSMsgBox(response.Message));
                    return;
                }

                if (string.IsNullOrEmpty(txtType))
                {
                    response = new AjaxResult()
                    {
                        Success = 0, Message = "类别不能为空。"
                    };
                    this.Response.Write(common.Common.GetJSMsgBox(response.Message));
                    return;
                }

                if (string.IsNullOrEmpty(sltContentType))
                {
                    response = new AjaxResult()
                    {
                        Success = 0, Message = "内容类型不能为空。"
                    };
                    this.Response.Write(common.Common.GetJSMsgBox(response.Message));
                    return;
                }

                if (string.IsNullOrEmpty(txtName))
                {
                    response = new AjaxResult()
                    {
                        Success = 0, Message = "用户名不能为空。"
                    };
                    this.Response.Write(common.Common.GetJSMsgBox(response.Message));
                    return;
                }

                var dt = new Model.Channel()
                {
                    CreateDate  = DateTime.Now,
                    Type        = Convert.ToInt16(txtType),
                    Code        = txtCode,
                    ModifyDate  = DateTime.Now,
                    Name        = txtName,
                    ContentType = Convert.ToInt16(sltContentType),
                    CreatedBy   = (Session["LoginAdmin"] as Model.Admin).ID,
                    ModifiedBy  = (Session["LoginAdmin"] as Model.Admin).ID,
                    Remark      = txtRemark,
                    ImageUrl    = imageUrl,
                    ParentId    = Convert.ToInt16(txtParentId),
                    State       = Convert.ToInt16(txtState),
                    Sort        = Convert.ToInt16(txtSort),
                };

                DataContext dc = new DataContext();

                dc.BeginTransaction();
                try
                {
                    var bll = new BLL.BLLBase();
                    var id  = bll.Add(dc, dt);

                    dc.CommitTransaction();

                    response = new AjaxResult()
                    {
                        Success = 1, Message = "操作成功", Data = id
                    };
                }
                catch (Exception exception)
                {
                    dc.RollBackTransaction();
                    response = new AjaxResult()
                    {
                        Success = 0, Message = "操作失败:" + exception.Message, Data = 0
                    };
                }
                finally
                {
                    dc.CloseConnection();
                }

                this.Response.Write(common.Common.GetJSMsgBox(response.Message));
            }
        }
Пример #9
0
        protected void submitbtn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.channelname.Text))
            {
                string myScript = @"alertMsg('渠道名称不能为空!','error.gif');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                return;
            }
            #region 删除
            //if (this.channeltype.SelectedValue=="0")
            //{
            //    string myScript = @"alertMsg('请选择行业分类!','error.gif');";
            //    Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //    return;
            //}
            //if (this.channeltype.SelectedValue == "1")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('网站名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('网站地址不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "5")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('软件名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('软件下载连接不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "10")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('应用商店名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('应用商店下载连接不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "12")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('网站名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('网站地址不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "16")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('APP名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('APP下载连接不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }
            //}
            //else if (this.channeltype.SelectedValue == "19")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('自身资源说明不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }

            //}
            //else if (this.channeltype.SelectedValue == "19")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('自身资源说明不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }

            //}
            //else if (this.channeltype.SelectedValue == "21")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('自身资源说明不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }

            //}
            //else if (this.channeltype.SelectedValue == "23")
            //{
            //    if (string.IsNullOrEmpty(this.txtWebName.Text))
            //    {
            //        string myScript = @"alertMsg('名称不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    } 
            //    if (string.IsNullOrEmpty(this.txtWebUrl.Text))
            //    {
            //        string myScript = @"alertMsg('覆盖AP数量不能为空!','error.gif');";
            //        Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
            //        return;
            //    }

            //}
            #endregion
            //批量删除
            string ClassList="";
            int n = 0;
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("lb_id")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("cb_id");
                if (cb.Checked)
                {
                    ClassList += id.ToString();
                    n++;
                }
            }
            if (n == 0)
            {
                string myScript = @"alertMsg('请选择产品!','error.gif');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                return;
            }
            else if (n>1)
            {
                string myScript = @"alertMsg('只能选择一种商品推广!','error.gif');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                return;
            }
            try
            {
                modeluser = blluser.GetModelByName(Request.Cookies["UserPage_UID"].Value.ToString());
                Model.Channel cModel = new Model.Channel();
                BLL.Channel cbll = new BLL.Channel();
                cModel.Title = channelname.Text;
                cModel.CatalogID = "";//channeltype.SelectedValue;
                cModel.Name = "";//txtWebName.Text;
                cModel.Url = "";//txtWebUrl.Text;
                cModel.ParentId = int.Parse(ClassList);
                cModel.Status = 1;
                cModel.UserID = modeluser.ID;
                cModel.Bak1 = "game" + ClassList + "_" + DateTime.Now.ToString("MMdd");
                int num=cbll.Add(cModel);
                if (num>0)
                {
                    Model.Log modLog = new Model.Log();
                    modLog.UserId = num;
                    modLog.UserName = channelname.Text;
                    InsertLog(modLog);
                    string myScript = @"alertRedirectMsg('渠道添加成功!','success.gif','Channel.aspx');";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                }
            }
            catch
            {
                string myScript = @"alertMsg('渠道添加失败!','error.gif');";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "MyScript", myScript, true);
                return;
            }
        }
Пример #10
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            string action = context.Request.Params["action"];

            ZGZY.Model.UserOperateLog userOperateLog = null;   //操作日志对象
            try
            {
                ZGZY.Model.User user = ZGZY.Common.UserHelper.GetUser(context);   //获取cookie里的用户对象
                userOperateLog          = new Model.UserOperateLog();
                userOperateLog.UserIp   = context.Request.UserHostAddress;
                userOperateLog.UserName = user.UserId;

                switch (action)
                {
                case "getbutton":                                            //根据用户的权限获取用户点击的菜单有权限的按钮
                    string    pageName = context.Request.Params["pagename"];
                    string    menuCode = context.Request.Params["menucode"]; //菜单标识码
                    DataTable dt       = new ZGZY.BLL.Customers().GetButtonByMenuCodeAndUserId(menuCode, user.Id);
                    string    sum      = ZGZY.Common.ToolbarHelper.GetToolBar(dt, pageName);
                    context.Response.Write(sum);
                    break;

                case "add":
                    if (user != null && new ZGZY.BLL.Authority().IfAuthority("Channel", "add", user.Id))
                    {
                        ZGZY.Model.Channel channelAdd = new Model.Channel();
                        channelAdd.ChannelName = context.Request.Params["ui_Channel_ChannelName_add"];
                        channelAdd.Creator     = context.Request.Params["ui_Channel_Creator_add"];
                        channelAdd.BeginDate   = DateTime.Parse(context.Request.Params["ui_Channel_BeginDate_add"]);
                        channelAdd.EndDate     = DateTime.Parse(context.Request.Params["ui_Channel_EndDate_add"]);
                        channelAdd.CreateDate  = DateTime.Now;
                        channelAdd.SealNameId  = 72;



                        int departmentId = new ZGZY.BLL.Channel().AddChannel(channelAdd);
                        if (departmentId > 0)
                        {
                            userOperateLog.OperateInfo = "添加引用";
                            userOperateLog.IfSuccess   = true;
                            userOperateLog.Description = "添加成功,客户主键:" + departmentId;
                            context.Response.Write("{\"msg\":\"添加成功!\",\"success\":true}");
                        }
                        else
                        {
                            userOperateLog.OperateInfo = "添加引用";
                            userOperateLog.IfSuccess   = false;
                            userOperateLog.Description = "添加失败";
                            context.Response.Write("{\"msg\":\"添加失败!\",\"success\":false}");
                        }
                    }
                    else
                    {
                        userOperateLog.OperateInfo = "添加引用";
                        userOperateLog.IfSuccess   = false;
                        userOperateLog.Description = "无权限,请联系管理员";
                        context.Response.Write("{\"msg\":\"无权限,请联系管理员!\",\"success\":true}");
                    }
                    ZGZY.BLL.UserOperateLog.InsertOperateInfo(userOperateLog);
                    break;

                case "search":
                    string strWhere  = "1=1";
                    string sort      = context.Request.Params["sort"];  //排序列
                    string order     = context.Request.Params["order"]; //排序方式 asc或者desc
                    int    pageindex = int.Parse(context.Request.Params["page"]);
                    int    pagesize  = int.Parse(context.Request.Params["rows"]);

                    int    totalCount;    //输出参数
                    string strJson = new ZGZY.BLL.Button().GetPager("Channel", "Id, ChannelName, CreateDate, Creator, SealNameId, BeginDate, EndDate", sort + " " + order, pagesize, pageindex, strWhere, out totalCount);
                    context.Response.Write("{\"total\": " + totalCount.ToString() + ",\"rows\":" + strJson + "}");
                    userOperateLog.OperateInfo = "查询按钮";
                    userOperateLog.IfSuccess   = true;
                    userOperateLog.Description = "查询条件:" + strWhere + " 排序:" + sort + " " + order + " 页码/每页大小:" + pageindex + " " + pagesize;
                    ZGZY.BLL.UserOperateLog.InsertOperateInfo(userOperateLog);
                    break;

                case "edit":
                    if (user != null && new ZGZY.BLL.Authority().IfAuthority("Channel", "edit", user.Id))
                    {
                        ZGZY.Model.Channel channelAdd = new Model.Channel();
                        channelAdd.Id          = Int32.Parse(context.Request.Params["id"]);
                        channelAdd.ChannelName = context.Request.Params["ui_Channel_ChannelName_edit"];
                        channelAdd.Creator     = context.Request.Params["ui_Channel_Creator_edit"];
                        channelAdd.BeginDate   = DateTime.Parse(context.Request.Params["ui_Channel_BeginDate_edit"]);
                        channelAdd.EndDate     = DateTime.Parse(context.Request.Params["ui_Channel_EndDate_edit"]);

                        int outputRow = new ZGZY.BLL.Channel().EditChannelById(channelAdd);
                        if (outputRow > 0)
                        {
                            userOperateLog.OperateInfo = "修改引用";
                            userOperateLog.IfSuccess   = true;
                            userOperateLog.Description = "修改成功,客户主键:" + outputRow;
                            context.Response.Write("{\"msg\":\"修改成功!\",\"success\":true}");
                        }
                        else
                        {
                            userOperateLog.OperateInfo = "修改引用";
                            userOperateLog.IfSuccess   = false;
                            userOperateLog.Description = "修改失败";
                            context.Response.Write("{\"msg\":\"修改失败!\",\"success\":false}");
                        }
                    }
                    else
                    {
                        userOperateLog.OperateInfo = "修改引用";
                        userOperateLog.IfSuccess   = false;
                        userOperateLog.Description = "无权限,请联系管理员";
                        context.Response.Write("{\"msg\":\"无权限,请联系管理员!\",\"success\":true}");
                    }
                    ZGZY.BLL.UserOperateLog.InsertOperateInfo(userOperateLog);
                    break;

                case "delete":
                    if (user != null && new ZGZY.BLL.Authority().IfAuthority("Channel", "delete", user.Id))
                    {
                        object departmentIds = context.Request.Params["id"];
                        if (new ZGZY.BLL.Channel().DeleteChannelById(departmentIds) == 1)
                        {
                            userOperateLog.OperateInfo = "删除引用";
                            userOperateLog.IfSuccess   = true;
                            userOperateLog.Description = "删除成功,引用主键:" + departmentIds;
                            context.Response.Write("{\"msg\":\"删除成功!\",\"success\":true}");
                        }
                        else
                        {
                            userOperateLog.OperateInfo = "删除引用";
                            userOperateLog.IfSuccess   = false;
                            userOperateLog.Description = "删除失败,客户主键:" + departmentIds;
                            context.Response.Write("{\"msg\":\"删除失败!\",\"success\":false}");
                        }
                    }
                    else
                    {
                        userOperateLog.OperateInfo = "删除引用";
                        userOperateLog.IfSuccess   = false;
                        userOperateLog.Description = "无权限,请联系管理员";
                        context.Response.Write("{\"msg\":\"无权限,请联系管理员!\",\"success\":false}");
                    }
                    ZGZY.BLL.UserOperateLog.InsertOperateInfo(userOperateLog);
                    break;

                default:
                    context.Response.Write("{\"result\":\"参数错误!\",\"success\":false}");
                    break;
                }
            }
            catch (Exception ex)
            {
                context.Response.Write("{\"msg\":\"" + ZGZY.Common.JsonHelper.StringFilter(ex.Message) + "\",\"success\":false}");
                userOperateLog.OperateInfo = "菜单功能异常";
                userOperateLog.IfSuccess   = false;
                userOperateLog.Description = ZGZY.Common.JsonHelper.StringFilter(ex.Message);
                ZGZY.BLL.UserOperateLog.InsertOperateInfo(userOperateLog);
            }
        }
Пример #11
0
 public int AddChannel(Model.Channel model)
 {
     return(dal.AddChannel(model));
 }
Пример #12
0
 public int EditChannelById(Model.Channel model)
 {
     return(dal.EditChannelById(model));
 }
Пример #13
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Model.Channel DataRowToModel(DataRow row)
 {
     Model.Channel model = new Model.Channel();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = int.Parse(row["ID"].ToString());
         }
         if (row["CatalogID"] != null && row["CatalogID"].ToString() != "")
         {
             model.CatalogID = row["CatalogID"].ToString();
         }
         if (row["Title"] != null)
         {
             model.Title = row["Title"].ToString();
         }
         if (row["ParentId"] != null && row["ParentId"].ToString() != "")
         {
             model.ParentId = int.Parse(row["ParentId"].ToString());
         }
         if (row["ClassList"] != null)
         {
             model.ClassList = row["ClassList"].ToString();
         }
         if (row["ClassLayer"] != null && row["ClassLayer"].ToString() != "")
         {
             model.ClassLayer = int.Parse(row["ClassLayer"].ToString());
         }
         if (row["UserID"] != null && row["UserID"].ToString() != "")
         {
             model.UserID = int.Parse(row["UserID"].ToString());
         }
         if (row["IsShow"] != null && row["IsShow"].ToString() != "")
         {
             if ((row["IsShow"].ToString() == "1") || (row["IsShow"].ToString().ToLower() == "true"))
             {
                 model.IsShow = true;
             }
             else
             {
                 model.IsShow = false;
             }
         }
         if (row["IsLock"] != null && row["IsLock"].ToString() != "")
         {
             if ((row["IsLock"].ToString() == "1") || (row["IsLock"].ToString().ToLower() == "true"))
             {
                 model.IsLock = true;
             }
             else
             {
                 model.IsLock = false;
             }
         }
         if (row["IsMenu"] != null && row["IsMenu"].ToString() != "")
         {
             if ((row["IsMenu"].ToString() == "1") || (row["IsMenu"].ToString().ToLower() == "true"))
             {
                 model.IsMenu = true;
             }
             else
             {
                 model.IsMenu = false;
             }
         }
         if (row["Name"] != null)
         {
             model.Name = row["Name"].ToString();
         }
         if (row["Url"] != null)
         {
             model.Url = row["Url"].ToString();
         }
         if (row["status"] != null && row["status"].ToString() != "")
         {
             model.Status = int.Parse(row["status"].ToString());
         }
         if (row["Bak1"] != null)
         {
             model.Bak1 = row["Bak1"].ToString();
         }
         if (row["Bak2"] != null)
         {
             model.Bak2 = row["Bak2"].ToString();
         }
         if (row["Bak3"] != null)
         {
             model.Bak3 = row["Bak3"].ToString();
         }
         if (row["Bak4"] != null)
         {
             model.Bak4 = row["Bak4"].ToString();
         }
     }
     return model;
 }
Пример #14
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.Channel GetModel(int ID)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 ID,CatalogID,Title,ParentId,ClassList,ClassLayer,UserID,IsShow,IsLock,IsMenu,Name,Url,status,Bak1,Bak2,Bak3,Bak4 from Channel ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters = {
					new SqlParameter("@ID", SqlDbType.Int,4)
			};
            parameters[0].Value = ID;

            Model.Channel model = new Model.Channel();
            DataSet ds = DbHelper.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }