protected void Button2_Click(object sender, EventArgs e) { MemberInfoModel _mod = new MemberInfoModel(); MemberInfoBLL bll = new MemberInfoBLL(); _mod = bll.GetModel(userid); if (_mod != null) { _mod.shFlag = Convert.ToInt32(this.rdlshFlag.SelectedValue); _mod.shPerson = this.txtshPerson.Text; _mod.shTime = Convert.ToDateTime(this.txtshTime.Value); _mod.unPassReason = this.txtunPassReason.Text; _mod.memberStatus = this.rdlmemberStatus.SelectedValue; _mod.memberCompanyType = GetHyType(); if ((bll.Update(_mod)) > 0) { string BackUrl = "MemberList.aspx?PageIndex=" + PageIndex; /*日志归档*/ string sql = @"select memberName as title from T_Member_Info u where memberId=" + userid + ""; PubFunction.InsertLog("业务管理", "会员管理", "会员列表", "修改", sql, userid.ToString()); ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('操作成功!');layer_close();</script>"); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { DataSet ds = new MemberInfoBLL().GetList("memberName='" + this.txtMemberId.Value + "'"); int id = 0; if (ds.Tables[0].Rows.Count > 0) { id = Convert.ToInt32(ds.Tables[0].Rows[0]["memberId"].ToString()); } model.memberId = id;// Convert.ToInt32(KillSqlIn.Form_ReplaceByString(this.txtMemberId.Value, 10)); model.money = Convert.ToDecimal(KillSqlIn.Form_ReplaceByString(this.txtMoney.Text, 10)); model.moneyType = KillSqlIn.Form_ReplaceByString(this.ddlMoneyType.SelectedValue, 20); model.remarks = KillSqlIn.Form_ReplaceByString(this.txtRemarks.Text, 200); model.addPerson = KillSqlIn.Form_ReplaceByString(this.txtAddPerson.Text, 20); model.addTime = Convert.ToDateTime(this.txtReleaseDate.Value.Trim()); model.shFlag = 0; string BackUrl = "MemberCZRecordList.aspx?PageIndex=" + PageIndex + ""; if (_mid != "") { model.sysnumber = _mid; bll.Update(model); /*日志归档*/ string sql = @"select l.memberId as title from T_Member_AccountRecord l where sysnumber='" + this._mid + "'"; PubFunction.InsertLog("业务管理", "会员列表", "会员充值列表", "修改", sql, _mid); JSUtility.AlertAndRedirect("修改成功!", BackUrl); } else { int i = bll.Add(model); /*日志归档*/ string sql = @"select l.memberId as title from T_Member_AccountRecord l where sysnumber='" + i.ToString() + "'"; PubFunction.InsertLog("业务管理", "会员列表", "会员充值列表", "添加", sql, i.ToString()); JSUtility.AlertAndRedirect("添加成功,请继续添加!", Request.RawUrl.ToString()); } }
//保存 protected void LinkButton1_Click(object sender, EventArgs e) { model.Title = SafeRequest.GetFormString("txtTitle"); model.DisplayMode = SafeRequest.GetFormInt("RadioButtonList1", 0); model.CategoryId = SafeRequest.GetFormInt("DrCategory", 0); model.Link = txtLink.Text.Trim(); model.Sort = SafeRequest.GetFormInt("txtSort", 0); #region 保存图片 if (!this.picUpload.Value.Equals("")) { string UploadFileLastName = this.picUpload.PostedFile.FileName.Substring(this.picUpload.PostedFile.FileName.LastIndexOf(".") + 1);//得到文件的扩展名 if (!PubFunction.IsPic(UploadFileLastName)) { JSUtility.Alert("上传图片格式不正确!"); return; } Random rnd = new Random(); string UpLoadFileTime = DateTime.Now.ToString("HHmmss") + rnd.Next(9999).ToString("0000"); //生成一个新的数图片名称 string fileName = UpLoadFileTime + "." + UploadFileLastName; //产生上传图片的名称 string SaveFile = DateTime.Now.ToString("yyyy/MM/dd/").Replace("-", "/"); #region 设置保存的路径 string SevedDirectory = System.Web.VirtualPathUtility.Combine(mainPath, SaveFile); string phydic = MapPath(SevedDirectory); if (!System.IO.Directory.Exists(phydic)) { System.IO.Directory.CreateDirectory(phydic); } #endregion this.picUpload.PostedFile.SaveAs(phydic + "" + fileName); string fckimg = string.Empty; string source = string.Empty; fckimg = "<a href='" + this.ResolveUrl(SevedDirectory + fileName) + "' target='_blank' id='upannexx'>" + fileName + "</a>"; source = this.ResolveUrl(SevedDirectory + fileName); model.Image = SaveFile + fileName; } else { model.Image = ViewState["ImgLink"].ToString(); } #endregion string BackUrl = "LinkList.aspx?PageIndex=" + PageIndex; if (_Lid != "0") { model.LinkId = Convert.ToInt32(_Lid); bll.Update(model); ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('修改成功');layer_close_refresh();</script>"); //状态 if (Session["LinkStatus_Hashtable"] != null) { Hashtable hTable = (Hashtable)Session["LinkStatus_Hashtable"]; hTable["ReadSessionStatus"] = "1"; Session["LinkStatus_Hashtable"] = hTable; } /*日志归档*/ string sql = @"select l.title from T_link l where linkid=" + this._Lid + ""; PubFunction.InsertLog("其它管理", "友情链接", "友情链接列表", "修改", sql, _Lid); } else { int i = bll.Add(model); JSUtility.AlertAndRedirect("添加成功,请继续添加!", Request.RawUrl.ToString()); /*日志归档*/ string sql = @"select l.title from T_link l where linkid=" + i.ToString() + ""; PubFunction.InsertLog("其它管理", "友情链接", "友情链接列表", "添加", sql, i.ToString()); } }