protected void Page_Load(object sender, EventArgs e) { _cusName = DTRequest.GetString("txtCusName"); _cid = DTRequest.GetString("hCusId"); _method = DTRequest.GetString("ddlmethod"); _isconfirm = DTRequest.GetString("ddlisConfirm"); _sforedate = DTRequest.GetString("txtsforedate"); _eforedate = DTRequest.GetString("txteforedate"); _sdate = DTRequest.GetString("txtsdate"); _edate = DTRequest.GetString("txtedate"); _num = DTRequest.GetString("txtNum"); _chk = DTRequest.GetString("txtChk"); _numdate = DTRequest.GetString("txtNumDate"); manager = GetAdminInfo(); this.pageSize = GetPageSize(10); //每页数量 if (!Page.IsPostBack) { if (string.IsNullOrEmpty(DTRequest.GetString("page"))) { _isconfirm = "False"; } initData(); RptBind("rp_type=1 " + CombSqlTxt(), "isnull(rp_date,'3000-01-01') desc,isnull(pm_sort,-1) asc,rp_id desc"); } }
protected void Page_Load(object sender, EventArgs e) { _orderid = DTRequest.GetString("txtOrderID"); _cusName = DTRequest.GetString("txtCusName"); _cid = DTRequest.GetString("hCusId"); _type = DTRequest.GetString("ddltype"); _num = DTRequest.GetString("txtNum"); _sdate = DTRequest.GetString("txtsDate"); _edate = DTRequest.GetString("txteDate"); _cusName1 = DTRequest.GetString("txtCusName1"); _cid1 = DTRequest.GetString("hCusId1"); _content = DTRequest.GetString("txtContent"); _sign = DTRequest.GetString("ddlsign"); _money = DTRequest.GetString("txtMoney"); _nature = DTRequest.GetString("ddlnature"); _detail = DTRequest.GetString("txtDetails"); this.pageSize = GetPageSize(10); //每页数量 if (!Page.IsPostBack) { InitData(); ChkAdminLevel("sys_ReconciliationSearch", DTEnums.ActionEnum.View.ToString()); //检查权限 RptBind("1=1" + CombSqlTxt(), "fc_addDate desc,fin_adddate desc"); } }
private void send_complaint_click(HttpContext context) { Model.article model = new Model.article(); BLL.article bll = new BLL.article(); //姓名 var name = DTRequest.GetString("name"); //电话 var tel = DTRequest.GetString("tel"); //email var email = DTRequest.GetString("email"); //投诉建议 var message = DTRequest.GetString("message"); model.channel_id = 10; model.category_id = 48; model.title = message; model.status = 0; model.fields = new Dictionary <string, string>(); model.fields.Add("name", name); model.fields.Add("tel", tel); model.fields.Add("email", email); model.zhaiyao = message; model.content = message; if (bll.Add(model) > 0) { context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,投诉建议成功!\"}"); return; } context.Response.Write("{\"status\": 0, \"msg\": \"对不起,保存过程中发生错误!\"}"); }
private void UpLoadFile(HttpContext context) { Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(); string _delfile = DTRequest.GetString("DelFilePath"); HttpPostedFile _upfile = context.Request.Files["Filedata"]; bool _iswater = false; //默认不打水印 bool _isthumbnail = false; //默认不生成缩略图 if (DTRequest.GetQueryString("IsWater") == "1") { _iswater = true; } if (DTRequest.GetQueryString("IsThumbnail") == "1") { _isthumbnail = true; } if (_upfile == null) { context.Response.Write("{\"status\": 0, \"msg\": \"请选择要上传文件!\"}"); return; } UpLoad upFiles = new UpLoad(); string msg = upFiles.fileSaveAs(_upfile, _isthumbnail, _iswater); //删除已存在的旧文件,旧文件不为空且应是上传文件,防止跨目录删除 if (!string.IsNullOrEmpty(_delfile) && _delfile.IndexOf("../") == -1 && _delfile.ToLower().StartsWith(siteConfig.webpath.ToLower() + siteConfig.filepath.ToLower())) { Utils.DeleteUpFile(_delfile); } //返回成功信息 context.Response.Write(msg); context.Response.End(); }
private void UpLoadFile(HttpContext context) { string _delfile = DTRequest.GetString("DelFilePath"); //要删除的文件 string fileName = DTRequest.GetString("name"); //文件名 byte[] byteData = FileHelper.ConvertStreamToByteBuffer(context.Request.InputStream); //获取文件流 bool _iswater = false; //默认不打水印 bool _isthumbnail = false; //默认不生成缩略图 if (DTRequest.GetQueryString("IsWater") == "1") { _iswater = true; } if (DTRequest.GetQueryString("IsThumbnail") == "1") { _isthumbnail = true; } if (byteData.Length == 0) { context.Response.Write("{\"status\": 0, \"msg\": \"请选择要上传文件!\"}"); return; } UpLoad upLoad = new UpLoad(); string msg = upLoad.FileSaveAs(byteData, fileName, _isthumbnail, _iswater); //删除已存在的旧文件 if (!string.IsNullOrEmpty(_delfile)) { upLoad.DeleteFile(_delfile); } //返回成功信息 context.Response.Write(msg); context.Response.End(); }
protected void Page_Load(object sender, EventArgs e) { string order_no = DTRequest.GetString("order_no"); if (order_no.StartsWith("R")) //充值订单 { Model.user_recharge model = new BLL.user_recharge().GetModel(order_no); if (model != null && model.status == 1) { string resurl = new Web.UI.BasePage().linkurl("payment", "?action=succeed&order_no=" + order_no); Response.Write("{\"status\": 1, \"url\": \"" + resurl + "\"}"); return; } } else if (order_no.StartsWith("B")) //商品订单 { Model.orders model = new BLL.orders().GetModel(order_no); if (model != null && model.payment_status == 2) { string resurl = new Web.UI.BasePage().linkurl("payment", "?action=succeed&order_no=" + order_no); Response.Write("{\"status\": 1, \"url\": \"" + resurl + "\"}"); return; } } Response.Write("{\"status\": 0, \"msg\": \"订单未支付成功!\"}"); return; }
private void UpLoadFile(HttpContext context) { string _delfile = DTRequest.GetString("DelFilePath"); HttpPostedFile _upfile = context.Request.Files["Filedata"]; bool _iswater = false; //默认不打水印 bool _isthumbnail = false; //默认不生成缩略图 if (DTRequest.GetQueryString("IsWater") == "1") { _iswater = true; } if (DTRequest.GetQueryString("IsThumbnail") == "1") { _isthumbnail = true; } if (_upfile == null) { context.Response.Write("{\"status\": 0, \"msg\": \"请选择要上传文件!\"}"); return; } UpLoad upFiles = new UpLoad(); string msg = upFiles.fileSaveAs(_upfile, _isthumbnail, _iswater); //删除已存在的旧文件 if (!string.IsNullOrEmpty(_delfile)) { Utils.DeleteUpFile(_delfile); } //返回成功信息 context.Response.Write(msg); context.Response.End(); }
protected void Page_Load(object sender, EventArgs e) { //读取站点配置信息 Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(); SortedDictionary <string, string> sPara = GetRequestGet(); if (sPara.Count > 0)//判断是否有带返回参数 { Notify aliNotify = new Notify(); bool verifyResult = aliNotify.Verify(sPara, DTRequest.GetString("notify_id"), DTRequest.GetString("sign")); if (verifyResult)//验证成功 { //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表 string trade_no = DTRequest.GetString("trade_no"); //支付宝交易号 string order_no = DTRequest.GetString("out_trade_no"); //获取订单号 string trade_status = DTRequest.GetString("trade_status"); //交易状态 if (trade_status == "WAIT_SELLER_SEND_GOODS" || trade_status == "TRADE_FINISHED" || trade_status == "TRADE_SUCCESS") { //成功状态 Response.Redirect(new Web.UI.BasePage().linkurl("payment", "succeed", order_no)); return; } } } //失败状态 Response.Redirect(new Web.UI.BasePage().linkurl("payment", "error")); return; }
private void UpLoadFile(HttpContext context) { Rain.Model.siteconfig siteconfig = new Rain.BLL.siteconfig().loadConfig(); string _filepath = DTRequest.GetString("DelFilePath"); HttpPostedFile file = context.Request.Files["Filedata"]; bool isWater = false; bool isThumbnail = false; if (DTRequest.GetQueryString("IsWater") == "1") { isWater = true; } if (DTRequest.GetQueryString("IsThumbnail") == "1") { isThumbnail = true; } if (file == null) { context.Response.Write("{\"status\": 0, \"msg\": \"请选择要上传文件!\"}"); } else { string s = new UpLoad().fileSaveAs(file, isThumbnail, isWater); if (!string.IsNullOrEmpty(_filepath) && _filepath.IndexOf("../") == -1 && _filepath.ToLower().StartsWith(siteconfig.webpath.ToLower() + siteconfig.filepath.ToLower())) { Utils.DeleteUpFile(_filepath); } context.Response.Write(s); context.Response.End(); } }
private void sign_article_click(HttpContext context) { var username = DTRequest.GetString("username"); var password = DTRequest.GetString("password"); BLL.xiehui bll = new BLL.xiehui(); Model.xiehui model = bll.GetModel(username, password, true); if (model == null) { context.Response.Write("{\"status\": 2, \"msg\": \"用户名或密码有误,请重试!\"}"); return; } BLL.article bllArticle = new BLL.article(); var id = DTRequest.GetInt("id", 0); var articleModel = bllArticle.GetModel(id); articleModel.status = 2; articleModel.sign_user_name += username + "|" + DateTime.Now.ToString() + ","; //判断当前用户是否已签收过 var isUserSign = bllArticle.GetList(1, " id=" + id + " and sign_user_name like '%" + username + "|%'", "add_time desc").Tables[0].Rows.Count; if (isUserSign > 0) { context.Response.Write("{\"status\": 0, \"msg\": \"对不起,该用户已经签收!\"}"); return; } if (bllArticle.Update(articleModel)) { context.Response.Write("{\"status\": 1, \"msg\": \"恭喜您,签收成功!\"}"); return; } context.Response.Write("{\"status\": 0, \"msg\": \"对不起,签收过程中发生错误!\"}"); }
public Model.AjaxResult Like(HttpContext context, Model.AjaxResult ajax) { int channel_id = ConvertTool.ToInt(DTRequest.GetString("channel_id"), 0); if (channel_id <= 0) { return(ErrorAjaxResult(ajax, @"频道错误")); } int article_id = ConvertTool.ToInt(DTRequest.GetString("article_id"), 0); if (article_id <= 0) { return(ErrorAjaxResult(ajax, @"文章错误")); } BLL.article bllarticle = new BLL.article(); string fieldname = ReflexHelp.Name(() => new Model.article().like_count); bool issu = bllarticle.UpdateField(channel_id, article_id, string.Format("{0} = {0} + 1", fieldname)); if (!issu) { return(ErrorAjaxResult(ajax, @"点赞失败!")); } ajax.Status = Model.AjaxResult.StatusValue.Success; ajax.Msg = @"点赞成功!"; return(ajax); }
private void navigation_validate(HttpContext context) { string navname = DTRequest.GetString("param"); string old_name = DTRequest.GetString("old_name"); if (string.IsNullOrEmpty(navname)) { context.Response.Write("{ \"info\":\"该导航别名不可为空!\", \"status\":\"n\" }"); return; } if (navname.ToLower() == old_name.ToLower()) { context.Response.Write("{ \"info\":\"该导航别名可使用\", \"status\":\"y\" }"); return; } //检查保留的名称开头 if (navname.ToLower().StartsWith("channel_")) { context.Response.Write("{ \"info\":\"该导航别名系统保留,请更换!\", \"status\":\"n\" }"); return; } LingLong.Admin.BLL.navigation bll = new LingLong.Admin.BLL.navigation(); if (bll.Exists(navname)) { context.Response.Write("{ \"info\":\"该导航别名已被占用,请更换!\", \"status\":\"n\" }"); return; } context.Response.Write("{ \"info\":\"该导航别名可使用\", \"status\":\"y\" }"); return; }
private void username_validate(HttpContext context) { string username = DTRequest.GetString("param"); //如果为Null,退出 if (string.IsNullOrEmpty(username)) { context.Response.Write("{ \"info\":\"用户名不可为空\", \"status\":\"n\" }"); return; } //过滤注册用户名字符 string[] strArray = userConfig.regkeywords.Split(','); foreach (string s in strArray) { if (s.ToLower() == username.ToLower()) { context.Response.Write("{ \"info\":\"该用户名不可用\", \"status\":\"n\" }"); return; } } BLL.users bll = new BLL.users(); //查询数据库 if (!bll.Exists(username.Trim())) { context.Response.Write("{ \"info\":\"该用户名可用\", \"status\":\"y\" }"); return; } context.Response.Write("{ \"info\":\"该用户名已被注册\", \"status\":\"n\" }"); return; }
protected void Page_Load(object sender, EventArgs e) { //读取站点配置信息 Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(); Dictionary <string, string> sPara = GetRequestGet(); if (sPara.Count > 0)//判断是否有带返回参数 { Notify aliNotify = new Notify(); bool verifyResult = aliNotify.VerifyReturn(sPara, Request.QueryString["sign"]); if (verifyResult)//验证成功 { //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表 string trade_no = DTRequest.GetString("trade_no"); //支付宝交易号 string order_no = DTRequest.GetString("out_trade_no"); //获取订单号 string result = DTRequest.GetString("result"); //交易状态 if (result == "success") { //成功状态 Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=succeed&order_no=" + order_no)); return; } } } //失败状态 Response.Redirect(new Web.UI.BasePage().linkurl("payment", "?action=error")); return; }
protected void Page_Load(object sender, EventArgs e) { //读取站点配置信息 Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig(); v_oid = DTRequest.GetString("v_oid").ToUpper(); v_pstatus = DTRequest.GetString("v_pstatus"); v_pstring = DTRequest.GetString("v_pstring"); v_pmode = DTRequest.GetString("v_pmode"); v_md5str = DTRequest.GetString("v_md5str"); v_amount = DTRequest.GetString("v_amount"); v_moneytype = DTRequest.GetString("v_moneytype"); remark1 = DTRequest.GetString("remark1"); remark2 = DTRequest.GetString("remark2"); // 拼凑加密串 string signtext = v_oid + v_pstatus + v_amount + v_moneytype + Config.Key; signtext = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(signtext, "md5").ToUpper(); if (signtext == v_md5str) { if (v_pstatus.Equals("20")) { //成功状态 Response.Redirect(new Web.UI.BasePage().linkurl("payment", "succeed", v_oid)); return; } } //失败状态 Response.Redirect(new Web.UI.BasePage().linkurl("payment", "error")); return; }
protected void Page_Load(object sender, EventArgs e) { _ordernum = DTRequest.GetString("txtOrder"); _cusname = DTRequest.GetString("txtCusName"); _cusid = DTRequest.GetString("hCusId"); _status = DTRequest.GetString("ddlcheck"); _type = DTRequest.GetString("ddltype"); _smonth = DTRequest.GetString("txtsDate"); _emonth = DTRequest.GetString("txteDate"); manager = GetAdminInfo(); this.pageSize = GetPageSize(10); //每页数量 if (!Page.IsPostBack) { if (string.IsNullOrEmpty(DTRequest.GetString("page"))) { _status = "1"; } InitData(); RptBind(CombSqlTxt(), "fin_adddate desc,fin_id desc"); } txtOrder.Text = _ordernum; ddltype.SelectedValue = _type; txtCusName.Text = _cusname; hCusId.Value = _cusid; ddlcheck.SelectedValue = _status; txtsDate.Text = _smonth; txteDate.Text = _emonth; }
private void post_news_commend(HttpContext context) { int uid = DTRequest.GetInt("uid", 0); string name = DTRequest.GetString("name"); string avatar = DTRequest.GetString("avatar"); int isPN = DTRequest.GetInt("isPN", 0); int news_id = DTRequest.GetInt("news_id", 0); string cont = DTRequest.GetString("cont"); Model.news_commend model = new Model.news_commend(); model.user_id = uid; model.name = name; model.avatar = avatar; model.ispn = isPN; model.news_id = news_id; model.ishide = 0; model.time = DateTime.Now; model.cont = cont; if (isPN == 1 && new BLL.user().GetCount("id=" + uid + " and phone!=''") == 0) {//判断为产品,需要填写手机号 context.Response.Write("{\"status\":0,\"msg\":\"请先在个人信息中补充联系电话!\"}"); return; } if (new BLL.news_commend().Add(model) > 0) { context.Response.Write("{\"status\":1,\"msg\":\"提交成功!\"}"); } else { context.Response.Write("{\"status\":0,\"msg\":\"提交失败!\"}"); } }
private void update_user(HttpContext context) { string openid = DTRequest.GetString("openid"); string name = DTRequest.GetString("name"); int sex = DTRequest.GetInt("sex", 0); string phone = DTRequest.GetString("phone"); string email = DTRequest.GetString("email"); Model.user model = new BLL.user().GetModel(openid); model.nickname = name; model.sex = sex; model.phone = phone; model.email = email; if (new BLL.user().Update(model)) { if ((model.nickname != "" && model.sex != 0 && model.phone != "" && model.email != "") && new BLL.amount().GetCount("type=3 and user_id=" + model.id) == 0) { Model.amount amount = new Model.amount() { user_id = model.id, type = 3, Amount = 1.88M, remark = "填写完整个人信息", time = DateTime.Now }; new BLL.amount().Add(amount); new BLL.user().UpdateField(model.id, "amount=amount+" + amount.Amount); } context.Response.Write("{\"status\":1,\"msg\":\"修改成功!\"}"); } else { context.Response.Write("{\"status\":0,\"msg\":\"修改失败!\"}"); } }
protected void Page_Load(object sender, EventArgs e) { this.pageSize = GetPageSize(10); //每页数量 _cusName = DTRequest.GetString("txtCusName"); _cid = DTRequest.GetString("hCusId"); _customer = DTRequest.GetString("txtCustomer"); _hcustomer = DTRequest.GetString("hCustomer"); _type = DTRequest.GetString("ddltype"); _sign = DTRequest.GetString("ddlsign"); _money1 = DTRequest.GetString("txtMoney1"); _nature = DTRequest.GetString("ddlnature"); _sdate = DTRequest.GetString("txtsDate"); _edate = DTRequest.GetString("txteDate"); _sdate1 = DTRequest.GetString("txtsDate1"); _edate1 = DTRequest.GetString("txteDate1"); _name = DTRequest.GetString("txtName"); _address = DTRequest.GetString("txtAddress"); _sign1 = DTRequest.GetString("ddlsign1"); _money2 = DTRequest.GetString("txtMoney2"); _person1 = DTRequest.GetString("txtPerson1").ToUpper(); _person2 = DTRequest.GetString("txtPerson2").ToUpper(); _person3 = DTRequest.GetString("txtPerson3").ToUpper(); _person4 = DTRequest.GetString("txtPerson4").ToUpper(); _person5 = DTRequest.GetString("txtPerson5").ToUpper(); _oid = DTRequest.GetString("txtOrderID"); _chk = DTRequest.GetString("txtChk"); _status = DTRequest.GetString("ddlstatus"); _lockstatus = DTRequest.GetString("ddllock"); _area = DTRequest.GetString("ddlarea"); _sdate2 = DTRequest.GetString("txtsDate2"); _edate2 = DTRequest.GetString("txteDate2"); _check = DTRequest.GetString("ddlcheck"); _self = DTRequest.GetString("self"); _detail = DTRequest.GetString("txtDetails"); manager = GetAdminInfo(); if (_self == "1") { _person1 = manager.user_name; txtPerson1.Enabled = false; } if (!Page.IsPostBack) { InitData(); if (_self != "1") { ChkAdminLevel("sys_settlementCustomer", DTEnums.ActionEnum.View.ToString()); //检查权限 } if (!string.IsNullOrEmpty(_cid) && _cid != "0") { RptBind(); } else { JscriptMsg("请先选择应收付对象", ""); return; } } }
private void get_pro_list(HttpContext context) { int page = DTRequest.GetInt("page", 1); int category = DTRequest.GetInt("category", 0); int uid = DTRequest.GetInt("uid", 0); string keywords = DTRequest.GetString("keywords"); string city = DTRequest.GetString("city"); int count = 0; int pageSize = 8; int sum = 0; if (uid == 0) { sum = new BLL.product().GetCount("status=2 and city=" + (city == "未知" ? "city" : "'" + city + "'") + " and category=" + (category == 0 ? "category" : category.ToString())); } else { sum = new BLL.product().GetCount("status=2 and user_id=" + uid); } if ((page - 1) * pageSize >= sum) { //没有更多数据 context.Response.Write("{\"status\":0,\"msg\":\"没有更多数据\"}"); return; } DataSet ds = new DataSet(); if (uid == 0) { ds = new BLL.product().GetList(pageSize, page, "status=2 and city=" + (city == "未知" ? "city" : "'" + city + "'") + " and category=" + (category == 0 ? "category" : category.ToString()) + " and title like '%" + keywords + "%'", "pass_time desc", out count); } else { ds = new BLL.product().GetList(pageSize, page, "status=2 and user_id=" + uid, "pass_time desc", out count); } DataTable dt = ds.Tables[0]; dt.Columns.Add("zan", typeof(int)); dt.Columns.Add("collect", typeof(int)); dt.Columns.Add("view", typeof(int)); foreach (DataRow dr in dt.Rows) { dr["view"] = new BLL.news_view().GetCount("news_id=" + dr["id"].ToString() + " and isPN=1 and type=1"); dr["collect"] = new BLL.news_commend().GetCount("news_id=" + dr["id"].ToString()); dr["zan"] = new BLL.news_view().GetCount("news_id=" + dr["id"].ToString() + " and isPN=1 and type=2"); } string strJson = DTcms.Common.JsonHelper.DataTableToJSON(ds.Tables[0]); context.Response.Write(strJson); }
private void get_qunID(HttpContext context) { string iv = DTRequest.GetString("iv"); string encryptedData = DTRequest.GetString("encryptedData"); string key = DTRequest.GetString("key"); context.Response.Write(AES_decrypt(encryptedData, "", iv)); }
/// <summary> /// 获得初始化的 Ajax json 响应结果模型 Jsonp 跨域请求时使用 /// </summary> public override Model.AjaxResult GetInitAjaxJsonResultModel() { this.JsonpCallback_Name = DTRequest.GetString(JsonpCallbackParameterKeyName()); return(new Model.AjaxResult() { JsonpCallback = this.JsonpCallback_Name, }); }
private Model.visitor_message GetCommitInfo() { return(new Model.visitor_message() { name = DTRequest.GetString("name"), tel = DTRequest.GetString("tel"), msg = DTRequest.GetString("msg"), }); }
protected void Page_Load(object sender, EventArgs e) { mobiles = DTRequest.GetString("mobiles"); if (!Page.IsPostBack) { ChkAdminLevel("user_sms", DTEnums.ActionEnum.View.ToString()); //检查权限 ShowInfo(mobiles); TreeBind("is_lock=0"); //绑定类别 } }
protected dt_users queryUser() { var context = new Agp2pDataContext(); order_no = DTRequest.GetString("order_no"); var ordersId = context.dt_orders.SingleOrDefault(o => o.order_no == order_no).user_id; var userId = context.dt_users.SingleOrDefault(g => g.id == ordersId); return(userId); }
protected dt_order_goods queryOrder() { var context = new Agp2pDataContext(); order_no = DTRequest.GetString("order_no"); var ordersId = context.dt_orders.SingleOrDefault(o => o.order_no == order_no).id; var orderGoods = context.dt_order_goods.SingleOrDefault(g => g.order_id == ordersId); return(orderGoods); }
protected void Page_Load(object sender, EventArgs e) { this.mobiles = DTRequest.GetString("mobiles"); if (this.Page.IsPostBack) { return; } this.ChkAdminLevel(nameof(user_sms), DTEnums.ActionEnum.View.ToString()); this.ShowInfo(this.mobiles); this.TreeBind("is_lock=0"); }
private void UpLoadPayFile(HttpContext context) { Model.sysconfig sysConfig = new BLL.sysconfig().loadConfig(); //检查是否允许匿名上传 if (!new ManagePage().IsAdminLogin()) { context.Response.Write("{\"status\": 0, \"msg\": \"禁止匿名非法上传!\"}"); return; } string fileName = DTRequest.GetString("name"); //文件名 int pid = DTRequest.GetQueryInt("pid"); string ftype = DTRequest.GetQueryString("ftype");; //文件类别 bool _isthumbnail = false; //默认不生成缩略图 byte[] byteData = FileHelper.ConvertStreamToByteBuffer(context.Request.InputStream); //获取文件流 if (byteData.Length == 0) { context.Response.Write("{\"status\": 0, \"msg\": \"请选择要上传文件!\"}"); return; } if (DTRequest.GetQueryString("IsThumbnail") == "1") { _isthumbnail = true; } UpLoad upLoad = new UpLoad(); fileName = fileName.Replace(" ", "");//去掉空格 string msg = upLoad.PayFileSaveAs(byteData, fileName, _isthumbnail, pid, ftype); msg = Regex.Replace(msg, @"(\\[^bfrnt\\/'\""])", "\\$1");//利用正则表达式先把待解析的字符串中的带“\”特殊字符处理,再进行解析操作 JObject jo = JObject.Parse(msg); if (jo["status"].ToString() == "1") { Model.manager manager = new ManagePage().GetAdminInfo();//获得当前登录管理员信息 Model.payPic file = new Model.payPic(); file.pp_rid = pid; file.pp_type = Utils.ObjToByte(ftype); file.pp_fileName = fileName; file.pp_filePath = jo["path"].ToString(); file.pp_thumbFilePath = jo["thumb"].ToString(); file.pp_size = Utils.ObjToDecimal(jo["size"].ToString(), 0); file.pp_addDate = DateTime.Now; file.pp_addName = manager.real_name; file.pp_addPerson = manager.user_name; new BLL.payPic().insertPayFile(file, manager); } //返回成功信息 context.Response.Write(msg); context.Response.End(); }
protected void Page_Load(object sender, EventArgs e) { this.pageSize = GetPageSize(10); //每页数量 oidStr = DTRequest.GetString("oidStr"); _cusName = DTRequest.GetString("txtCusName"); _cid = DTRequest.GetString("hCusId"); _type = DTRequest.GetString("ddltype"); _sign = DTRequest.GetString("ddlsign"); _money1 = DTRequest.GetString("txtMoney1"); _nature = DTRequest.GetString("ddlnature"); _sdate = DTRequest.GetString("txtsDate"); _edate = DTRequest.GetString("txteDate"); _sdate1 = DTRequest.GetString("txtsDate1"); _edate1 = DTRequest.GetString("txteDate1"); _name = DTRequest.GetString("txtName"); _address = DTRequest.GetString("txtAddress"); _sign1 = DTRequest.GetString("ddlsign1"); _money2 = DTRequest.GetString("txtMoney2"); _person1 = DTRequest.GetString("txtPerson1").ToUpper(); _person2 = DTRequest.GetString("txtPerson2").ToUpper(); _person3 = DTRequest.GetString("txtPerson3").ToUpper(); _person4 = DTRequest.GetString("txtPerson4").ToUpper(); _person5 = DTRequest.GetString("txtPerson5").ToUpper(); _oid = DTRequest.GetString("txtOrderID"); _chk = DTRequest.GetString("txtChk"); _status = DTRequest.GetString("ddlstatus"); _lockstatus = DTRequest.GetString("ddllock"); _area = DTRequest.GetString("ddlarea"); _sdate2 = DTRequest.GetString("txtsDate2"); _edate2 = DTRequest.GetString("txteDate2"); _sdate3 = DTRequest.GetString("txtsDate3"); _edate3 = DTRequest.GetString("txteDate3"); manager = GetAdminInfo(); if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(_cid) && _cid != "0") { DataTable dt = new BLL.Customer().GetList(0, "c_id=" + _cid + "", "").Tables[0]; if (dt != null) { labCustomerName.Text = dt.Rows[0]["c_name"].ToString(); labCustomerPhone.Text = dt.Rows[0]["co_number"].ToString(); } RptBind(); } else { JscriptMsg("请先选择应收付对象", ""); return; } } }
//关健字查询 protected void btnSearch_Click(object sender, EventArgs e) { _sdate = DTRequest.GetString("txtsDate"); _edate = DTRequest.GetString("txteDate"); _person = DTRequest.GetString("txtPerson"); _depart = DTRequest.GetString("txtDepart"); _status = DTRequest.GetString("ddlstatus"); _dstatus = DTRequest.GetString("ddldstatus"); _lockstatus = DTRequest.GetString("ddllock"); _area = DTRequest.GetString("ddlarea"); _orderarea = DTRequest.GetString("ddlorderarea"); RptBind(CombSqlTxt(), " op_number asc"); }