Пример #1
0
        private string callback       = "";      //回调

        protected void Page_Load(object sender, EventArgs e)
        {
            filesize       = LYRequest.GetInt("filesize", 1024);
            filetype       = LYRequest.GetString("filetype", "image");
            tofilepath     = LYRequest.GetString("filepath", "/UpLoads/");
            recievetxtname = LYRequest.GetString("recievetxtname", "");
            ismultifile    = LYRequest.GetInt("ismultifile", 0);
            callback       = LYRequest.GetString("callback", "");

            int type = LYRequest.GetInt("type", 0);

            if (!IsPostBack)
            {
                if (!chkLogin(type))
                {
                    return;
                }

                if (recievetxtname == "")
                {
                    Lbl_Tip.Text        = "缺少参数recievetxtname";
                    File_Upload.Visible = false;
                    Btn_Submit.Visible  = false;
                }
            }
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     typeid = LYRequest.GetString("typeid");
     if (!IsPostBack)
     {
         LoadInit();
     }
     BindData();
 }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SearchName = LYRequest.GetString("SearchName", true);
            typeid     = LYRequest.GetString("typeid");


            if (!IsPostBack)
            {
                InitData();
                BindList();
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    page   = LYRequest.GetInt("page", 1);
            string typeid = LYRequest.GetString("typeid");

            if (typeid == "")
            {
                typeid = "XW";
            }
            if (base.Request["cmd"] != null && base.Request["cmd"] == "list")
            {
                BindData(page, typeid);
            }
        }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (base.Request["action"] != null && base.Request["action"] == "set")
     {
         SetTmpCode();
     }
     else
     {
         id              = LYRequest.GetString("id");
         hideid.Value    = MW.Common.LYRequest.GetString("hidCtl");
         hideradio.Value = MW.Common.LYRequest.GetString("txtCtl");
         if (!IsPostBack)
         {
             InitData();
             BindList();
         }
     }
 }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SearchName = MW.Common.LYRequest.GetString("SearchName", true);
            Operator   = LYRequest.GetString("Operator", "");
            Begin_Time = LYRequest.GetString("Begin_Time", "");
            End_Time   = LYRequest.GetString("End_Time", "");
            KeyWord    = LYRequest.GetString("KeyWord", "");
            type       = LYRequest.GetString("type", "");
            id         = LYRequest.GetInt("id", 0);
            re         = LYRequest.GetInt("re", 0);
            rurl       = LYRequest.GetString("rurl", Server.UrlDecode(Request.Url.ToString()));

            if (type == "reset")
            {
                ResetSMS();
            }
            if (!IsPostBack)
            {
                InitData();
                BindList();
            }
        }
Пример #7
0
        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            context.Response.ContentType = "application/json";
            string cmd    = LYRequest.GetString("cmd");
            string result = "";

            switch (cmd.ToLower())
            {
            case "getlearningtask":
                int year  = LYRequest.GetInt("year", DateTime.Now.Year);
                int month = LYRequest.GetInt("month", DateTime.Now.Month);
                result = GetLearningTask(year, month);
                break;

            default:
                result = "";
                break;
            }
            context.Response.Write(result);
            context.Response.Flush();
            context.Response.End();
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            filesize   = LYRequest.GetInt("filesize", 1024);
            filetype   = LYRequest.GetString("filetype", "image");
            tofilepath = LYRequest.GetString("filepath", "/upLoads/");
            int type = LYRequest.GetInt("type", 0);

            if (!IsPostBack)
            {
                string errors = string.Empty;
                string Pic    = string.Empty;
                string file   = "";

                if (!chkLogin(type))
                {
                    errors = "未登录,请登陆后上传资源!";
                }
                else
                {// 上传文件
                    HttpFileCollection filecollection = HttpContext.Current.Request.Files;
                    HttpPostedFile     hpf            = filecollection.Get("filedata");
                    if (hpf == null)
                    {
                        hpf = filecollection.Get(0);
                    }
                    MW.Common.JUpload upload = new MW.Common.JUpload();
                    upload.IsUsedFtp   = false;
                    upload.FileSize    = filesize;
                    upload.FileType    = filetype;
                    upload.IsWaterMark = iswatermark;
                    try
                    {
                        if (hpf.ContentLength > 0)
                        {
                            string result = upload.SaveFile(hpf, tofilepath);

                            if (result == "0")//文件格式不正确
                            {
                                errors = "文件格式不正确 " + filetype;
                            }
                            else if (result == "1") //文件大小超过filesizeK
                            {
                                errors = "文件大小超过 " + filesize + "K";
                            }
                            else if (result == "3") //文件大小超过filesizeK
                            {
                                errors = "非法的文件 ";
                            }
                            else
                            {
                                result = "/" + result.TrimStart('/');
                                Pic    = BasePage.GetWebPath + result;
                                file   = hpf.FileName;
                            }
                        }
                        else
                        {
                            errors = "无数据提交";
                        }
                    }
                    catch (Exception)
                    {
                        errors = "没有上传文件";
                    }
                }

                HttpContext.Current.Response.Write("{'err':'" + jsonString(errors) + "','msg':'" + Pic + "','file':'" + jsonString(file) + "'}");
                HttpContext.Current.Response.End();
            }
        }