Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Utils.CheckRole("7"))
     {
         Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('权限信息','没有权限!','/Systestcomjun/index.aspx',2)</script>");
         return;
     }
     if (!IsPostBack)
     {
         txtSort.Text  = "20";
         ltlTitle.Text = "新增职场攻略";
         ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
         imgformat = site.ImgFormat;
         if (Request.QueryString["CPID"] != null)
         {
             ltlTitle.Text = "修改职场攻略";
             int CPID = Convert.ToInt32(Request.QueryString["CPID"]);
             ZhongLi.Model.CareerPlanning cp = bll.GetModel(CPID);
             rbtType.SelectedValue = cp.CPType;
             txtCPTitle.Text       = cp.CPTitle;
             txtCPName.Text        = cp.CPName;
             txtPhone.Text         = cp.Phone;
             txtSort.Text          = cp.Sort + "";
             txtAbsDes.Text        = cp.AbsDes;
             txtCPDes.Text         = cp.CPDes;
             if (cp.ImgUrl != "")
             {
                 img_Photo.ImageUrl = cp.ImgUrl;
             }
         }
     }
 }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Utils.CheckRole("9"))
     {
         Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('权限信息','没有权限!','/Systestcomjun/index.aspx',2)</script>");
         return;
     }
     if (!IsPostBack)
     {
         ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
         imgformat = site.ImgFormat;
         ddlNewsType.DataSource     = new ZhongLi.BLL.NewsType().GetAllList();
         ddlNewsType.DataTextField  = "Name";
         ddlNewsType.DataValueField = "NewsTypeID";
         ddlNewsType.DataBind();
         ltlTitle.Text = "新增内容";
         if (Request.QueryString["NewsID"] != null)
         {
             int NewsID = Convert.ToInt32(Request.QueryString["NewsID"]);
             ZhongLi.Model.News news = bll.GetModel(NewsID);
             txtTitle.Text = news.Title;
             if (news.ImgUrl != "")
             {
                 img_Photo.ImageUrl = news.ImgUrl;
             }
             ddlNewsType.SelectedValue = news.NewsType + "";
             ddlhot.SelectedValue      = news.Hot == true ? "1" : "2";
             txtAbsDes.Text            = news.AbsDes;
             txtNewsCon.Text           = news.NewsCon;
         }
     }
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ZhongLi.Model.siteconfig config = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
     log   = config.log;
     phone = config.phone;
     mail  = config.mail;
 }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Utils.CheckRole("14"))
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('权限信息','没有权限!','/Systestcomjun/index.aspx',2)</script>");
                return;
            }

            if (!IsPostBack)
            {
                ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
                imgformat     = site.ImgFormat;
                ltlTitle.Text = "新增内容";
                if (Request.QueryString["ID"] != null)
                {
                    int ID = Convert.ToInt32(Request.QueryString["ID"]);
                    ZhongLi.Model.CooperativePartner CP = bll.GetModel(ID);
                    txtName.Text = CP.Name;
                    if (CP.Logo != "")
                    {
                        img_Photo.ImageUrl = CP.Logo;
                    }
                    Sort.Text    = CP.Sort.ToString();
                    LinkUrl.Text = CP.LinkUrl;
                }
            }
        }
Ejemplo n.º 5
0
        protected void btnsave_Click(object sender, EventArgs e)
        {
            ZhongLi.Model.CareerPlanning cp = null;
            if (Request.QueryString["CPID"] != null)
            {
                cp = bll.GetModel(Convert.ToInt32(Request.QueryString["CPID"]));
            }
            else
            {
                cp = new ZhongLi.Model.CareerPlanning();
            }
            cp.CPTitle = txtCPTitle.Text;
            cp.CPName  = txtCPName.Text;
            cp.Phone   = txtPhone.Text;
            cp.CPType  = rbtType.SelectedValue;
            cp.Sort    = Convert.ToInt32(txtSort.Text);
            cp.AbsDes  = txtAbsDes.Text;
            cp.CPDes   = txtCPDes.Text;

            ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
            if (fileImg.HasFile)
            {
                if (fileImg.PostedFile.ContentLength <= site.FileSize * 1024)
                {
                    string fileExt  = Utils.GetFileExt(fileImg.FileName);
                    string newname  = DateTime.Now.ToString("yyyyMMddHHmmssffff") + "." + fileExt;
                    string filePath = Utils.GetMapPath("/upload/news/") + newname;
                    fileImg.SaveAs(filePath);
                    cp.ImgUrl = "/upload/news/" + newname;
                }
            }
            if (cp.CPID == 0)
            {
                if (bll.Add(cp) > 0)
                {
                    webHelper.addLog("新添加了职场攻略“" + cp.CPTitle + "”");
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('新增职场攻略','保存成功!','',1)</script>");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('新增职场攻略','保存失败','',2)</script>");
                }
            }
            else
            {
                if (bll.Update(cp))
                {
                    webHelper.addLog("修改了职场攻略“" + cp.CPTitle + "”");
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('编辑职场攻略','保存成功!','',1)</script>");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('编辑职场攻略','保存失败','',2);</script>");
                }
            }
        }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BindNews();
     ZhongLi.Model.siteconfig config = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
     log    = config.log;
     phone  = config.phone;
     mail   = config.mail;
     bjtu   = config.bgtu;
     QRCode = config.QRCode;
 }
Ejemplo n.º 7
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     ZhongLi.Model.News news = null;
     if (Request.QueryString["NewsID"] != null)
     {
         news = bll.GetModel(Convert.ToInt32(Request.QueryString["NewsID"]));
     }
     else
     {
         news            = new ZhongLi.Model.News();
         news.CreateTime = DateTime.Now;
         news.ImgUrl     = "";
     }
     news.Title    = txtTitle.Text;
     news.NewsType = Convert.ToInt32(ddlNewsType.SelectedValue);
     ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
     if (fileImg.HasFile)
     {
         if (fileImg.PostedFile.ContentLength <= site.FileSize * 1024)
         {
             string fileExt  = Utils.GetFileExt(fileImg.FileName);
             string newname  = DateTime.Now.ToString("yyyyMMddHHmmssffff") + "." + fileExt;
             string filePath = Utils.GetMapPath("/upload/news/") + newname;
             fileImg.SaveAs(filePath);
             news.ImgUrl = "/upload/news/" + newname;
         }
     }
     news.Hot     = ddlhot.SelectedValue == "1" ? true : false;
     news.NewsCon = txtNewsCon.Text;
     news.AbsDes  = txtAbsDes.Text;
     if (news.NewsID == 0)
     {
         if (bll.Add(news) > 0)
         {
             webHelper.addLog("新添加了内容“" + news.Title + "”");
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('新增内容','保存成功!','',1)</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('新增内容','保存失败','',2)</script>");
         }
     }
     else
     {
         if (bll.Update(news))
         {
             webHelper.addLog("修改了内容“" + news.Title + "”");
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('编辑内容','保存成功!','',1)</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('编辑内容','保存失败','',2);</script>");
         }
     }
 }
Ejemplo n.º 8
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     ZhongLi.Model.CooperativePartner cp = null;
     if (Request.QueryString["ID"] != null)
     {
         cp = bll.GetModel(Convert.ToInt32(Request.QueryString["ID"]));
     }
     else
     {
         cp            = new ZhongLi.Model.CooperativePartner();
         cp.CreateDate = DateTime.Now;
         cp.Logo       = "";
     }
     cp.Name = txtName.Text;
     ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
     if (fileLogo.HasFile)
     {
         if (fileLogo.PostedFile.ContentLength <= site.FileSize * 1024)
         {
             string fileExt  = Utils.GetFileExt(fileLogo.FileName);
             string newname  = DateTime.Now.ToString("yyyyMMddHHmmssffff") + "." + fileExt;
             string filePath = Utils.GetMapPath("/upload/CooperativePartner/") + newname;
             fileLogo.SaveAs(filePath);
             cp.Logo = "/upload/CooperativePartner/" + newname;
         }
     }
     cp.Sort    = Convert.ToInt32(Sort.Text);
     cp.LinkUrl = LinkUrl.Text;
     if (cp.ID == 0)
     {
         if (bll.Add(cp) > 0)
         {
             webHelper.addLog("新添加了合作伙伴“" + cp.Name + "”");
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('合作伙伴','保存成功!','',1)</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('合作伙伴','保存失败','',2)</script>");
         }
     }
     else
     {
         if (bll.Update(cp))
         {
             webHelper.addLog("修改了内容“" + cp.Name + "”");
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('合作伙伴','保存成功!','',1)</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('合作伙伴','保存失败','',2);</script>");
         }
     }
 }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
     imgformat = site.ImgFormat;
     if (!IsPostBack)
     {
         phone.Text         = site.phone;
         mail.Text          = site.mail;
         bjtu               = site.bgtu;
         ggtu               = site.QRCode;
         lgo                = site.log;
         ggimg.ImageUrl     = "../../" + site.QRCode;
         logimg.ImageUrl    = "../../" + site.log;
         img_Photo.ImageUrl = "../../" + site.bgtu;
     }
 }
Ejemplo n.º 10
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["OrderID"] != null)
     {
         int        OrderID     = Convert.ToInt32(Request.QueryString["OrderID"]);
         DataTable  perdt       = bll.getPerByOrderID(OrderID);
         int        PerID       = Convert.ToInt32(perdt.Rows[0]["PerID"]);
         string     RealName    = perdt.Rows[0]["RealName"].ToString();
         int        SerUserID   = Convert.ToInt32(perdt.Rows[0]["SerUserID"]);
         decimal    RewardMoney = Convert.ToDecimal(perdt.Rows[0]["RewardMoney"]);
         siteconfig site        = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
         if (bll.PassAuth(OrderID, PerID, SerUserID, RewardMoney, site.Commission))
         {
             DateTime time = DateTime.Now;
             //添加消息表
             ZhongLi.Model.Person_Message msg = new ZhongLi.Model.Person_Message();
             msg.MesCon   = "您的悬赏订单审核通过啦,恭喜您成功入职!";
             msg.SendTime = time;
             msg.PerID    = PerID;
             msg.MesType  = 0;
             new ZhongLi.BLL.Person_Message().Add(msg);
             ZhongLi.Model.ServerUser_Message sermsg = new ZhongLi.Model.ServerUser_Message();
             sermsg.MesCon    = "您的订单审核通过啦,您已获得悬赏佣金,赶紧去钱包查看吧!";
             sermsg.SendTime  = time;
             sermsg.SerUserID = SerUserID;
             sermsg.MesType   = 0;
             new ZhongLi.BLL.ServerUser_Message().Add(sermsg);
             //推送通知
             //求职者
             JPushApiExample.ALERT       = "您的悬赏订单审核通过啦,恭喜您成功入职!";
             JPushApiExample.MSG_CONTENT = "您的悬赏订单审核通过啦,恭喜您成功入职!";
             PushPayload pushsms = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("p" + PerID, "OrderAuth");
             JPushApiExample.push(pushsms);
             //人才经纪人
             JPushApiExample.ALERT       = "您的订单审核通过啦,您已获得悬赏佣金,赶紧去钱包查看吧!";
             JPushApiExample.MSG_CONTENT = "您的订单审核通过啦,您已获得悬赏佣金,赶紧去钱包查看吧!";
             PushPayload pushsms1 = JPushApiExample.PushObject_ios_audienceMore_messageWithExtras("s" + SerUserID, "OrderAuth");
             JPushApiExample.push(pushsms1);
             webHelper.addLog("通过了“" + RealName + "”的入职资料审核");
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('入职协议审核','审核成功!','Auth.aspx?OrderID=" + OrderID + "',1)</script>");
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('入职协议审核','审核失败!','Auth.aspx?OrderID=" + OrderID + "',1)</script>");
         }
     }
 }
Ejemplo n.º 11
0
        protected void btnsave_Click(object sender, EventArgs e)
        {
            ZhongLi.Model.siteconfig site = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
            if (fileLogo.HasFile)
            {
                //if (fileLogo.PostedFile.ContentLength <= site.FileSize * 1024)
                //{
                string fileExt  = Utils.GetFileExt(fileLogo.FileName);
                string newname  = Guid.NewGuid() + "." + fileExt;
                string filePath = Utils.GetMapPath("/img/") + newname;
                fileLogo.SaveAs(filePath);
                bjtu      = "img/" + newname;
                site.bgtu = bjtu;
                //}
            }
            if (lgofill.HasFile)
            {
                //if (lgofill.PostedFile.ContentLength <= site.FileSize * 1024)
                //{
                string logfileExt  = Utils.GetFileExt(lgofill.FileName);
                string lognewname  = Guid.NewGuid() + "." + logfileExt;
                string logfilePath = Utils.GetMapPath("/img/") + lognewname;
                lgofill.SaveAs(logfilePath);
                lgo      = "img/" + lognewname;
                site.log = lgo;
                //}
            }
            if (ggfill.HasFile)
            {
                //if (ggfill.PostedFile.ContentLength <= site.FileSize * 1024)
                //{
                string ggfileExt  = Utils.GetFileExt(ggfill.FileName);
                string ggnewname  = Guid.NewGuid() + "." + ggfileExt;
                string ggfilePath = Utils.GetMapPath("/img/") + ggnewname;
                ggfill.SaveAs(ggfilePath);
                ggtu        = "img/" + ggnewname;
                site.QRCode = ggtu;
                //}
            }

            site.phone = phone.Text;
            site.mail  = mail.Text;

            ZhongLi.Model.siteconfig sites = new ZhongLi.Bll.siteconfig().saveConifg(site, Server.MapPath("/xmlconfig/site.config"));
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "set", "<script>window.onload=showmsgclose('首页设置','保存成功','',1)</script>");
        }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BindNews();
            string type = Request["type"];
            string id   = Request["id"];

            switch (type)
            {
            case "news":
                NEWM  = NEW.GetModel(Convert.ToInt32(id));
                title = NEWM.Title;
                count = NEWM.NewsCon;
                time  = "发表时间:" + NEWM.CreateTime.ToString();
                break;

            case "jo":
                jom   = jo.GetModel(Convert.ToInt32(id));
                title = jom.JobTraTitle;
                count = jom.JobTraDes;
                time  = "";
                break;

            case "cp":
                cpm   = cp.GetModel(Convert.ToInt32(id));
                title = cpm.CPTitle;
                count = cpm.CPDes;
                time  = "发表时间:" + cpm.CreateTime.ToString();
                break;
            }
            ZhongLi.Model.siteconfig config = new ZhongLi.Bll.siteconfig().loadConfig(Server.MapPath("/xmlconfig/site.config"));
            log    = config.log;
            phone  = config.phone;
            mail   = config.mail;
            bjtu   = config.bgtu;
            QRCode = config.QRCode;
        }
Ejemplo n.º 13
0
        private void ManagerFile(HttpContext context)
        {
            ZhongLi.Model.siteconfig siteConfig = new ZhongLi.Bll.siteconfig().loadConfig(Utils.GetXmlMapPath("Configpath"));
            //String aspxUrl = context.Request.Path.Substring(0, context.Request.Path.LastIndexOf("/") + 1);

            //根目录路径,相对路径
            String rootPath = "/"; //站点目录+上传目录siteConfig.webpath + siteConfig.attachpath +
            //根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
            String rootUrl = "/";  //siteConfig.webpath + siteConfig.attachpath +
            //图片扩展名
            String fileTypes = "gif,jpg,jpeg,png,bmp";

            String currentPath    = "";
            String currentUrl     = "";
            String currentDirPath = "";
            String moveupDirPath  = "";

            String dirPath = Utils.GetMapPath(rootPath);
            String dirName = context.Request.QueryString["dir"];
            //if (!String.IsNullOrEmpty(dirName))
            //{
            //    if (Array.IndexOf("image,flash,media,file".Split(','), dirName) == -1)
            //    {
            //        context.Response.Write("Invalid Directory name.");
            //        context.Response.End();
            //    }
            //    dirPath += dirName + "/";
            //    rootUrl += dirName + "/";
            //    if (!Directory.Exists(dirPath))
            //    {
            //        Directory.CreateDirectory(dirPath);
            //    }
            //}

            //根据path参数,设置各路径和URL
            String path = context.Request.QueryString["path"];

            path = String.IsNullOrEmpty(path) ? "" : path;
            if (path == "")
            {
                currentPath    = dirPath;
                currentUrl     = rootUrl;
                currentDirPath = "";
                moveupDirPath  = "";
            }
            else
            {
                currentPath    = dirPath + path;
                currentUrl     = rootUrl + path;
                currentDirPath = path;
                moveupDirPath  = Regex.Replace(currentDirPath, @"(.*?)[^\/]+\/$", "$1");
            }

            //排序形式,name or size or type
            String order = context.Request.QueryString["order"];

            order = String.IsNullOrEmpty(order) ? "" : order.ToLower();

            //不允许使用..移动到上一级目录
            if (Regex.IsMatch(path, @"\.\."))
            {
                context.Response.Write("Access is not allowed.");
                context.Response.End();
            }
            //最后一个字符不是/
            if (path != "" && !path.EndsWith("/"))
            {
                context.Response.Write("Parameter is not valid.");
                context.Response.End();
            }
            //目录不存在或不是目录
            if (!Directory.Exists(currentPath))
            {
                context.Response.Write("Directory does not exist.");
                context.Response.End();
            }

            //遍历目录取得文件信息
            string[] dirList  = Directory.GetDirectories(currentPath);
            string[] fileList = Directory.GetFiles(currentPath);

            switch (order)
            {
            case "size":
                Array.Sort(dirList, new NameSorter());
                Array.Sort(fileList, new SizeSorter());
                break;

            case "type":
                Array.Sort(dirList, new NameSorter());
                Array.Sort(fileList, new TypeSorter());
                break;

            case "name":
            default:
                Array.Sort(dirList, new NameSorter());
                Array.Sort(fileList, new NameSorter());
                break;
            }

            Hashtable result = new Hashtable();

            result["moveup_dir_path"]  = moveupDirPath;
            result["current_dir_path"] = currentDirPath;
            result["current_url"]      = currentUrl;
            result["total_count"]      = dirList.Length + fileList.Length;
            List <Hashtable> dirFileList = new List <Hashtable>();

            result["file_list"] = dirFileList;
            for (int i = 0; i < dirList.Length; i++)
            {
                DirectoryInfo dir  = new DirectoryInfo(dirList[i]);
                Hashtable     hash = new Hashtable();
                hash["is_dir"]   = true;
                hash["has_file"] = (dir.GetFileSystemInfos().Length > 0);
                hash["filesize"] = 0;
                hash["is_photo"] = false;
                hash["filetype"] = "";
                hash["filename"] = dir.Name;
                hash["datetime"] = dir.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
                dirFileList.Add(hash);
            }
            for (int i = 0; i < fileList.Length; i++)
            {
                FileInfo  file = new FileInfo(fileList[i]);
                Hashtable hash = new Hashtable();
                hash["is_dir"]   = false;
                hash["has_file"] = false;
                hash["filesize"] = file.Length;
                hash["is_photo"] = (Array.IndexOf(fileTypes.Split(','), file.Extension.Substring(1).ToLower()) >= 0);
                hash["filetype"] = file.Extension.Substring(1);
                hash["filename"] = file.Name;
                hash["datetime"] = file.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
                dirFileList.Add(hash);
            }
            context.Response.AddHeader("Content-Type", "application/json; charset=UTF-8");
            context.Response.Write(JsonMapper.ToJson(result));
            context.Response.End();
        }
Ejemplo n.º 14
0
 public static siteconfig SettingsListLoad()
 {
     ZhongLi.Bll.siteconfig   bll  = new ZhongLi.Bll.siteconfig();
     ZhongLi.Model.siteconfig site = bll.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SITE_XML_CONFING));
     return(site);
 }