示例#1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Cultural.BLL.Department departBll = new Cultural.BLL.Department();
            context.Response.ContentType = "text/plain";
            string paraFID = context.Request["FID"];                                                                        //读取参数PageSize

            if (paraFID != null && paraFID.Trim() == "DL")                                                                  //列表界面
            {
                int        paraIndex   = context.Request["Index"] == null ? 1 : int.Parse(context.Request["Index"]);        //读取参数PageSize
                int        paraSize    = context.Request["PageSize"] == null ? 10 : int.Parse(context.Request["PageSize"]); //读取参数PageSize
                string     paraBoardID = context.Request["BoardID"] == null ? "0" : context.Request["BoardID"].ToString();  //读取参数
                DepartInfo departInfo  = new DepartInfo();
                departInfo.DepartList = departBll.DataTableToList(departBll.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", paraBoardID), " Weight desc,DepartID asc ", (paraIndex - 1) * paraSize, paraIndex * paraSize).Tables[0]);
                departInfo.TotalNum   = departBll.GetRecordCount(string.Format(" BoardID={0} and Status!='0' ", paraBoardID));
                context.Response.Write(JsonHelper.Serialize(departInfo));
            }
            if (paraFID != null && paraFID.Trim() == "DownL")                                                                             //列表界面
            {
                int                     paraIndex    = context.Request["Index"] == null ? 1 : int.Parse(context.Request["Index"]);        //读取参数PageSize
                int                     paraSize     = context.Request["PageSize"] == null ? 10 : int.Parse(context.Request["PageSize"]); //读取参数PageSize
                string                  paraBoardID  = context.Request["BoardID"] == null ? "0" : context.Request["BoardID"].ToString();  //读取参数
                DownLoadInfo            downLoadInfo = new DownLoadInfo();
                Cultural.BLL.DownCenter dcBll        = new Cultural.BLL.DownCenter();
                downLoadInfo.DownCenterList = dcBll.DataTableToList(dcBll.GetListByPage(string.Format(" BoardID={0} and Status!='0' ", paraBoardID), " PubTime desc ", (paraIndex - 1) * paraSize, paraIndex * paraSize).Tables[0]);
                foreach (Cultural.Model.DownCenter dc in downLoadInfo.DownCenterList)
                {
                    dc.PubTime = dc.PubTime.Substring(0, 10);
                }
                downLoadInfo.TotalNum = dcBll.GetRecordCount(string.Format(" BoardID={0} and Status!='0' ", paraBoardID));
                context.Response.Write(JsonHelper.Serialize(downLoadInfo));
            }
            if (paraFID != null && paraFID.Trim() == "DownD")                                                 //详细界面
            {
                int paraIndex = context.Request["InfoID"] == null ? 0 : int.Parse(context.Request["InfoID"]); //读取参数InfoID
                Cultural.Model.DownCenter downLoad = new Cultural.Model.DownCenter();
                Cultural.BLL.DownCenter   dcBll    = new Cultural.BLL.DownCenter();
                downLoad = dcBll.GetModel(paraIndex);
                DownLoadInfo downLoadInfo = new DownLoadInfo();
                downLoadInfo.DownCenterList = new List <Cultural.Model.DownCenter>();
                downLoadInfo.DownCenterList.Add(downLoad);
                Cultural.BLL.Board   boardBll = new Cultural.BLL.Board();
                Cultural.Model.Board board    = new Cultural.Model.Board();
                board = boardBll.GetModel(int.Parse(downLoad.BoardID.ToString()));
                downLoadInfo.BName = board.BoardName;
                context.Response.Write(JsonHelper.Serialize(downLoadInfo));
            }
        }
示例#2
0
 public void BindTextInfo(object o)
 {
     if (o != null && o.ToString().Trim() != "")
     {
         Cultural.BLL.DownCenter   dcBll      = new Cultural.BLL.DownCenter();
         Cultural.BLL.DownFile     dfBll      = new Cultural.BLL.DownFile();
         Cultural.Model.DownCenter downCenter = new Cultural.Model.DownCenter();
         downCenter = dcBll.GetModel(int.Parse(o.ToString()));
         if (downCenter != null)
         {
             txtDownTitle.Text         = downCenter.DownTitle;
             txtDownTitle.Enabled      = false;
             txtDownDesc.Text          = downCenter.DownDesc;
             txtDownDesc.Enabled       = false;
             ddlDownLoad.SelectedIndex = ddlDownLoad.Items.IndexOf(ddlDownLoad.Items.FindByValue(downCenter.BoardID.ToString()));
             ddlDownLoad.Enabled       = false;
             repDownFile.DataSource    = dfBll.GetModelList(string.Format(" Status!='0' and DownID={0} ", downCenter.DownID));
             repDownFile.DataBind();
         }
     }
 }
示例#3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string paraFID = context.Request["FID"];            //读取参数PageSize

            if (paraFID != null && paraFID.Trim() == "HomePic") //中心概括界面
            {
                Cultural.BLL.HomeImg homeBll = new Cultural.BLL.HomeImg();
                string paraImgDesc           = context.Request["ImgDesc"] == null ? "" : context.Request["ImgDesc"]; //读取参数图片描述
                string paraImgURL            = context.Request["ImgURL"] == null ? "" : context.Request["ImgURL"];   //读取参数图片路径
                if (paraImgURL != null && paraImgURL.ToString().Trim() != "")
                {
                    try
                    {
                        Cultural.Model.HomeImg homeImg = new Cultural.Model.HomeImg();
                        homeImg.ImgDesc = CommonFun.ClearHtml(paraImgDesc);
                        homeImg.ImgURL  = paraImgURL;
                        homeImg.Status  = "1";
                        homeBll.Add(homeImg);
                    }
                    catch
                    {
                        context.Response.Write(JsonHelper.Serialize("error"));
                    }
                }
                context.Response.Write(JsonHelper.Serialize("success"));
            }
            else if (paraFID != null && paraFID.Trim() == "DownInfo")
            {
                string Title   = context.Request["Title"] == null ? "" : context.Request["Title"];
                string Desc    = context.Request["Desc"] == null ? "" : context.Request["Desc"];
                int    BoardID = context.Request["BoardID"] == null ? 0 : int.Parse(context.Request["BoardID"]);
                int    Author  = context.Request["Author"] == null ? 0 : int.Parse(context.Request["Author"]);
                Cultural.BLL.DownCenter   downCBll   = new Cultural.BLL.DownCenter();
                Cultural.Model.DownCenter downCenter = new Cultural.Model.DownCenter();
                downCenter.Author    = Author;
                downCenter.BoardID   = BoardID;
                downCenter.DownDesc  = Desc;
                downCenter.DownTitle = Title;
                downCenter.PubTime   = string.Format("{0}-{1}-{2} {3}:{4}", DateTime.Now.Year, DateTime.Now.Month.ToString().PadLeft(2, '0'), DateTime.Now.Day.ToString().PadLeft(2, '0'), DateTime.Now.Hour.ToString().PadLeft(2, '0'), DateTime.Now.Minute.ToString().PadLeft(2, '0'));
                downCenter.Status    = "1";
                try
                {
                    List <Cultural.Model.DownCenter> tdList = new List <Cultural.Model.DownCenter>();
                    tdList = downCBll.GetModelList(string.Format(" DownTitle='{0}' ", downCenter.DownTitle));
                    if (tdList != null && tdList.Count > 0)
                    {
                        context.Response.Write(JsonHelper.Serialize("error"));
                    }
                    else
                    {
                        downCBll.Add(downCenter);
                        List <Cultural.Model.DownCenter> dList = new List <Cultural.Model.DownCenter>();
                        dList = downCBll.GetModelList(string.Format(" Author={0} and BoardID={1} and  DownTitle='{2}' order by PubTime desc ", downCenter.Author, downCenter.BoardID, downCenter.DownTitle));
                        if (dList != null && dList.Count > 0)
                        {
                            context.Response.Write(JsonHelper.Serialize(dList[0].DownID));
                        }
                        else
                        {
                            context.Response.Write(JsonHelper.Serialize("error"));
                        }
                    }
                }
                catch
                {
                    context.Response.Write(JsonHelper.Serialize("error"));
                }
            }
            else if (paraFID != null && paraFID.Trim() == "DownFile")
            {
                string FileOriName = context.Request["FileOriName"] == null ? "" : context.Request["FileOriName"];
                string FilePath    = context.Request["FilePath"] == null ? "" : context.Request["FilePath"];
                int    DownID      = context.Request["DownID"] == null ? 0 : int.Parse(context.Request["DownID"]);
                if (DownID != 0)
                {
                    Cultural.BLL.DownFile   downFBll = new Cultural.BLL.DownFile();
                    Cultural.Model.DownFile downFile = new Cultural.Model.DownFile();
                    downFile.DownID      = DownID;
                    downFile.FileOriName = FileOriName;
                    downFile.FilePath    = FilePath;
                    downFile.Status      = "1";
                    try
                    {
                        downFBll.Add(downFile);
                        context.Response.Write(JsonHelper.Serialize("success"));
                    }
                    catch
                    {
                        context.Response.Write(JsonHelper.Serialize("error"));
                    }
                }
            }
            else
            {
                context.Response.Write(JsonHelper.Serialize("error"));
            }
        }