///// <summary> ///// 用户查询 ///// </summary> ///// <param name="sender"></param> ///// <param name="e"></param> //protected void SearchButton_Click(object sender, EventArgs e) //{ // string strName = ""; // int strUserType =0; // string strSubClass =""; // Response.Redirect(string.Format("SysUserSearch.aspx?UserName={0}&UserTypeID={1}&SubClassID={2}", strName, strUserType, strSubClass)); //} protected void Add_Submit_Click(object sender, EventArgs e) { string strName = UserName.Text.ToString(); string strPwd = PassWord.Text.ToString(); string strRname = RealName.Text.ToString(); int typeid = int.Parse(TypeID.SelectedValue.ToString()); string subClass = SubClassID.SelectedValue.ToString(); if (subClass.Equals("-1")) { Jscript.AjaxAlert(this, "请 选择用户类型"); return; } int groupid = int.Parse(GroupID1.Value.ToString()); string strDept = Dept.Text.ToString(); string strQQ = QQ.Text.ToString(); string strTaobao = WangWang.Text.ToString(); string strTel = Tel.Text.ToString(); string strEmail = Email.Text.ToString(); string strDesc = Description.Text.ToString(); string strState = State.SelectedValue.ToString(); string strSex = Sex.SelectedValue.ToString(); Leyp.Model.User u = new Leyp.Model.User(); u.UserName = strName; u.Password = StrHelper.EncryptPassword(strPwd, StrHelper.PasswordType.MD5);//MD5加密 u.Description = strDesc; u.Email = strEmail; u.GroupID = groupid; u.TypeID = typeid; u.QQ = strQQ; u.RealName = strRname; u.Sex = strSex; u.State = strState; u.WangWang = strTaobao; u.Tel = strTel; u.Dept = strDept; u.BankAccount = BankAccount.Text.ToString(); u.Bankname = Bankname.Text.ToString(); u.Character = Character.Text.ToString(); u.CompanyInfo = CompanyInfo.Text.ToString(); u.CompanyName = CompanyName.Text.ToString(); u.Address = Address.Text.ToString(); u.SubClassID = int.Parse(SubClassID.SelectedValue.ToString()); u.LatelyLogin = ""; if (Leyp.SQLServerDAL.Factory.getUserDAL().insertNewUser(u)) { Panel1.Visible = false; HyperLink1.Visible = true; } else { Panel1.Visible = false; HyperLink1.Text = "添加失败!可能用户名已经存在!请重新注册"; HyperLink1.Visible = true; } }
protected void butSava_Click(object sender, EventArgs e) { FNEWS_TYPE dalNewsType = new FNEWS_TYPE(); string id = Request.QueryString["id"]; ENEWSType eNewsType = dalNewsType.GetDAL().GetModel(Convert.ToInt32(Hid.Value)); eNewsType.TypeName = txtTypeName.Text.Trim(); eNewsType.ParentID = Convert.ToInt32(DD_Type.SelectedValue); if (isfabu.Checked == true) { eNewsType.ISFabu = 1; } else { eNewsType.ISFabu = 0; } if (islimit.Checked == true) //0全访问1会员访问 { eNewsType.ISLimit = 1; } else { eNewsType.ISLimit = 0; } bool count = dalNewsType.GetDAL().Update(eNewsType); if (count) { Jscript.RedirectToFrames("Admin_NewsType.aspx"); } else { Jscript.Alert("异常错误,请重试!"); } }
protected void Page_Load(object sender, EventArgs e) { //获取品搜数据 long id = Requests.GetQueryLong("id", 0); long userid = Requests.GetQueryLong("userid", 0); string username = Requests.GetQueryString("username"); E_PinsouUser data = new E_PinsouUser(); data.ID = id; data.Pinsou_UserID = userid; data.UserName = username; //查询登录信息 DataTable dt = new T_User().Pinsou_AutoLogin(data); if (dt != null && dt.Rows.Count == 1)//验证通过 { string name = dt.Rows[0]["Email"].ToString(); string pwd = dt.Rows[0]["password"].ToString(); Login(name, pwd); } else //验证失败 { Jscript.ShowMsg("信息错误无法登录!", this); return; } }
/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void butSava_Click(object sender, EventArgs e) { SHUniversity.KPI.Model.Users u = new SHUniversity.KPI.Model.Users(); u.ID = int.Parse(hidid.Value); u.BrithDay = SHUniversity.KPI.Common.ConvertDatetime(txt_birthday.Text.Trim()); u.CreatDate = DateTime.Now; u.Email = txt_email.Text.Trim(); u.InDate = Common.ConvertDatetime(txt_indate.Text.Trim()); u.Moblie = txt_moblie.Text.Trim(); u.Name = txt_name.Text.Trim(); u.Password = txt_pwd.Text.Trim(); u.Ramerk = txt_common.Text.Trim(); u.Satat = 1; u.Sex = int.Parse(rb_sex.SelectedValue); u.Tel = txt_tell.Text.Trim(); u.UserType = int.Parse(rb_usertype.SelectedValue); u.WorkID = txt_workID.Text.Trim(); u.Xueli = txt_xueli.Text.Trim(); u.Xuexiao = txt_xuexiao.Text.Trim(); u.Zhiwu = txt_zhiwu.Text.Trim(); bool result = uBll.Update(u); if (result) { Jscript.RedirectToFrames("UserManage.aspx"); } else { Jscript.Alert("修改异常,请重试"); Jscript.RedirectToFrames("UserManage.aspx"); } }
/// <summary> /// 提交退出申请 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { string reason = txtReason.Text.Trim(); if (string.IsNullOrEmpty(reason)) { Jscript.ShowMsg("请输入退出理由!", this); return; } E_ItemApply data = new E_ItemApply(); data.ItemID = itemid; data.UserID = UserID; data.ApplyType = EnumApplyType.申请退出; data.Reason = reason; bool flag = new T_ItemApply().Add(data); if (flag) { Jscript.AlertAndRedirect(this, "申请成功", "itemlist.aspx"); } else { Jscript.ShowMsg("申请失败", this); } }
protected void AddSubmit_Click(object sender, EventArgs e) { string str = SalesOutID.Text.ToString(); Jscript.AjaxAlert(this, str); return; }
/// <summary> /// 批量删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button2_Click(object sender, EventArgs e) { string ids = selInfo(); int num = 0; if (ids.Length == 0) { Jscript.Alert("请选择要删除的记录!", this.Page); return; } string[] arr = ids.TrimEnd(',').Split(','); for (int i = 0; i < arr.Length; i++) { if (AdminUserService.Delete(Convert.ToInt32(arr[i])) > 0) { num++; } } ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('成功删除" + num + "条记录!');", true); DataSet ds = AdminUserService.GetList(""); if (ds.Tables[0].Rows.Count > 0) { this.repInfo.DataSource = ds; repInfo.DataBind(); } }
/// <summary> /// 彻底删除按钮处理事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDelete_Click(object sender, EventArgs e) { string ciids = hdClientInfoIDs.Value; hdClientInfoIDs.Value = ""; if (!MLMGC.COMP.StringUtil.IsStringArrayList(ciids))//判断格式是否正确 格式:1,21,321 { HttpContext.Current.Response.Write("参数错误"); return; } E_ItemClientInfo data = new E_ItemClientInfo(); data.EnterpriseID = EnterpriceID; data.ClientInfoIDs = ciids; bool flag = new T_ItemClientInfo().ThoroughDelete(data); if (flag) { Jscript.AlertAndRedirect(this, "删除成功", "Recycled.aspx"); } else { Jscript.ShowMsg("删除失败", this); } }
protected void SupplierList_RowDeleting(object sender, GridViewDeleteEventArgs e) { string SupplierID = SupplierList.DataKeys[e.RowIndex]["SupplierID"].ToString(); Jscript.OpenWebFormSize("SupplierDetail.aspx?SupplierID=" + SupplierID + "", 600, 500, 10, 100); return; }
public void update() { if (this.TextBox1.Text.Trim() == string.Empty) { Jscript.Alert("投票信息标题不能为空!", this.Page); } else if (this.Text1.Value.Trim() == string.Empty) { Jscript.Alert("到期时间不能为空!", this.Page); } else { HXD.SQLServerDAL.tb_U_TouPiao toupiaodal = new HXD.SQLServerDAL.tb_U_TouPiao(); //投票操作类 HXD.Model.tb_U_TouPiao toupiaomodel = new HXD.Model.tb_U_TouPiao(); //投票属性类 toupiaomodel.id = id; toupiaomodel.title = this.TextBox1.Text.Trim(); toupiaomodel.is_Examine = this.CheckBox1.Checked ? 1 : 0; //是否审核 toupiaomodel.is_Recommendation = this.CheckBox2.Checked ? 1 : 0; //是否推荐 toupiaomodel.end_time = Convert.ToDateTime(this.Text1.Value); toupiaomodel.VoteType = this.RadioButton1.Checked ? 1 : 2; if (toupiaodal.Update(toupiaomodel)) { Jscript.AlertAndRedirect("投票信息修改成功!", "TouPiaoList.aspx?Page=" + Pages); } else { Jscript.Alert("投票信息修改失败!", Page); return; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { string NewTypeid = NewType.SelectedValue.ToString(); if (NewTypeid.Equals("a")) { Jscript.AjaxAlert(this, "请选择信息类型"); return; } string Infos = contents.Text.Trim(); string Titles = txtTitle.Text.ToString(); Notice n = new Notice(); n.CreateDate = DateTime.Now.ToString("yyyy-MM-dd"); n.Info = Infos; n.Title = Titles; n.Type = int.Parse(NewTypeid); n.UserName = getUserName(); Leyp.SQLServerDAL.Factory.getNoticeDAL().insertNewEntity(n); txtTitle.Text = ""; contents.Text = ""; Jscript.AjaxAlert(this, "添加成功"); }
protected void databind() { //获取个人信息,判断他的信息是否完善,如果不完善,跳转到个人资料页面进行填写。 E_Personal dataPersonal = new E_Personal(); dataPersonal.UserID = UserID; dataPersonal.PersonalID = PersonalID; dataPersonal = new T_Personal().GetModel(dataPersonal); if (dataPersonal == null) { Response.Redirect("../main.aspx"); } //判断资料是否完善 if (!new T_Personal().IsPerfect(dataPersonal)) { Jscript.AlertAndRedirect(this, "个人信息不完善", "../Modify.aspx"); return; } //获取文库目录分类 DataTable dt = new T_WenKuClass().GetList(); if (dt == null) { return; } //绑定目录分类 foreach (DataRow row in dt.Rows) { ddlCategory.Items.Add(new ListItem(row["WenKuClassName"].ToString(), row["WenKuClassID"].ToString())); } ddlCategory.Items.Add(new ListItem("其它", "0")); }
/// <summary> /// 提交新群组 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void submit_Click(object sender, EventArgs e) { string strName = GroupName_New.Text.ToString(); string strDesc = Description_new.Text.ToString(); if (strName.Length < 2) { Jscript.AjaxAlert(this, "群名称不能为空"); return; } else { Group gp = new Group(); gp.GroupName = strName; gp.Description = strDesc; if (Leyp.SQLServerDAL.Factory.getGroupDAL().insertNewGroup(gp)) { HyperLink1.Visible = true; viewPanel.Visible = false; addSystemLog("新添群组" + strName); } else { HyperLink1.Text = "添加失败!可能是名称重复了!你可以返回重新试试"; HyperLink1.Visible = true; viewPanel.Visible = false; } } }
protected void Button1_Click(object sender, EventArgs e) { SalesOut s = new SalesOut(); SalesOrder so = new SalesOrder(); s.Consignee = Consignee.Text.ToString(); s.CreateDate = CreateDate.Text.ToString(); s.DeliveryID = int.Parse(DeliveryID.SelectedValue.ToString()); s.Description = Description.Text.ToString(); s.SalesOutID = SalesOutID.Text.ToString(); s.UserName = getUserName(); s.TradeDate = TradeDate.Text.ToString(); s.SalesOrderID = SalesOrderID.Text.ToString(); so.CustomerArea = CustomerArea.Value.ToString(); so.CustomerID = CustomerIDType.Value + CustomerID.Text.ToString(); so.CustomerName = CustomerName.Text.ToString(); so.CustomerPost = CustomerPost.Text.ToString(); so.CustomerTel = CustomerTel.Text.ToString(); so.Discount = float.Parse(Discount.Text.ToString()); so.AttachPay = float.Parse(AttachPay.Text.ToString()); so.SalesOrderID = SalesOrderID.Text.ToString(); so.PlatformID = int.Parse(Platform.SelectedValue.ToString()); if (Leyp.SQLServerDAL.Sales.Factory.getSalesOrderDAL().updateCustomerInfo(so)) //顾客信息更新成功 { Leyp.SQLServerDAL.Sales.Factory.getSalesOutDAL().updataEntity(s); Jscript.RefreshParent("Manager_SalesOutOrder.aspx"); Jscript.CloseWindow(); } }
protected void Page_Load(object sender, EventArgs e) { using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession()) { SqlDb.Dcms_User user = new SqlDb.Dcms_User(); UpdateModelByForm(user, Request.Form); IQuery query = session.GetQuery(user).Where(SqlDb.Dcms_User._USER_NAME_.EqulesExp(Request.Form["User_Name"])); List <SqlDb.Dcms_User> userList = query.GetList <SqlDb.Dcms_User>(); if (userList.Count == 1) { //if (userList[0].User_Email != "") // { // SendeMail(userList[0].User_PassWord); // Jscript.AlertAndBack("邮件已发送,请及时查收."); // } if (userList[0].User_Name == user.User_Name && userList[0].User_Email == user.User_Email) { Jscript.AlertAndBack("您的密码是: " + userList[0].User_PassWord + " 请妥善保管!"); } else { Jscript.AlertAndBack("身份验证错误!"); } } else { Jscript.AlertAndBack("用户名不存在."); } } }
protected void Button1_Click(object sender, EventArgs e) { SalesDispatchDAL sdal = new SalesDispatchDAL(); sdal.sentUpdate(int.Parse(OrderID.Text.ToString()), DateTime.Now.ToString("yyyy-MM-dd"), 3, " 问题描述:" + issueInfo.Text.ToString(), float.Parse("0.00")); VSalesDispatch vs = Leyp.SQLServerDAL.Sales.Factory.getSalesDispatchDAL().getByID(int.Parse(OrderID.Text.ToString())); //在接着得到销售订单 VSalesOrder vso = Leyp.SQLServerDAL.Sales.Factory.getSalesOrderDAL().getByID(vs.SalesOrderID); //得到下单用户 string username = vso.UserName; ServiceInfo s = new ServiceInfo(); s.CreateDate = DateTime.Now.ToString("yyyy-MM-dd"); s.Content = "订单号:" + vs.SalesOrderID + "配送错误,请您查询。原因是:" + issueInfo.Text; s.ServiceTitle = "配送问题--" + DateTime.Now.ToString("yyyy-MM-dd"); s.UserName = username; s.TypeID = 2; if (Leyp.SQLServerDAL.Factory.getServiceInfoDAL().insertNewEntity(s)) { Jscript.RefreshParent("MySalesDispatch.aspx"); Jscript.CloseWindow(); } }
/// <summary> /// 批量删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { string ids = selInfo(); int num = 0; if (ids.Length == 0) { Jscript.Alert("请选择要删除的记录!", this.Page); return; } string[] arr = ids.TrimEnd(',').Split(','); int newsId = 0; for (int i = 0; i < arr.Length; i++) { int id = Convert.ToInt32(arr[i]); newsId = TopNewsService.GetModel(id).newsId; if (TopNewsService.Delete(id) > 0) { NewsService.UpdateTop(newsId, 0); num++; } } ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('成功删除" + num + "条记录!');", true); sp.InitBindData(Repeater1, pager1, "TopNews", "id", sear()); }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { string UserName = GridView1.DataKeys[e.RowIndex]["UserName"].ToString(); Jscript.CloseWindowReturnValues(UserName); return; }
protected void btnSubmit_Click(object sender, EventArgs e) { if (ServiceTypeDropDownList1.SelectedValue.ToString().Equals("")) { Jscript.AjaxAlert(this, "请选择类型"); return; } ServiceInfo s = new ServiceInfo(); s.CreateDate = DateTime.Now.ToString("yyyy-MM-dd"); s.Content = Content.Text; s.ServiceTitle = ServiceTitle.Text; s.UserName = getUserName(); s.TypeID = int.Parse(ServiceTypeDropDownList1.SelectedValue.ToString()); if (SalesOrderID.Text.ToString().Equals("")) { s.SalesOrderID = "无"; } else { s.SalesOrderID = SalesOrderID.Text.ToString(); } if (Leyp.SQLServerDAL.Factory.getServiceInfoDAL().insertNewEntity(s)) { Panel1.Visible = false; Panel2.Visible = true; } }
protected void Databang() { object action = Request.QueryString["action"]; if (action != null) { if (action.ToString().Equals("edit")) { int SubClassID = Int16.Parse(Request.QueryString["SubClassID"].ToString()); UserTypeSubClass s = new UserTypeSubClass(); s = Leyp.SQLServerDAL.Factory.getUserTypeSubClassDAL().getByID(SubClassID); SubTypeName.Text = s.SubClassName; Pageaction.Text = "edit"; editSubClassID.Text = SubClassID.ToString(); UserTypeDropDownList.Visible = false; } else if (action.ToString().Equals("del")) { int SubClassID = Int16.Parse(Request.QueryString["SubClassID"].ToString()); if (Leyp.SQLServerDAL.Factory.getUserTypeSubClassDAL().deleteNode(SubClassID)) { addSystemLog("成功删除用户类型ID" + SubClassID); Jscript.AjaxAlert(this, " 删除成功"); } else { Jscript.AjaxAlert(this, " 用户已经使用!不能删除!"); } } } listDatabang(); userTypeBand(); }
protected void DataList1_ItemCommand(object source, RepeaterCommandEventArgs e) { string id = e.CommandArgument.ToString(); if (e.CommandName == "edit") { Response.Redirect("PathConfig.aspx?id=" + id); } else if (e.CommandName == "Add") { Response.Redirect("Article_lanmu2_add.aspx?id=" + id); } else if (e.CommandName == "SetFirst") { Response.Redirect("Article_setfirst.aspx?type=" + id); } else if (e.CommandName == "Delete") { int count = int.Parse(da.GetSingeData("select count(*) from tm_path where myparent=" + id).ToString()); if (count > 0) { Jscript.Alert("该分类存在子类,不能被删除!"); } else { string sql = "delete from tm_path where id=" + id; da.RunSql(sql); Bind(); } //Response.Redirect("Article_setfirst.aspx?type=" + id); } }
/// 发布资讯 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnRelease_Click(object sender, EventArgs e) { if (Session["loginUser"] == null) { Jscript.AlertAndRedirect("请登录", "/admin/login.aspx"); return; } string peopleCount = txtPeopleCount.Text.Trim(); if (peopleCount.Length == 0) { lblError.Text = "请输入招聘人数"; return; } Invite item = new Invite(); item.inviteType = 0; try { item.inviteType = Convert.ToInt32(txtPeopleCount.Text.Trim()); } catch (Exception je) { lblError.Text = "招聘人数输入错误"; return; } item.inviteName = txtTitle.Text.Trim(); item.inviteInfo = this.content1.Value; item.inviteDesc = txtZhaiYao.Value.Trim(); txtHidInfo.Text = item.inviteInfo; item.inforemark = txtHidInfo.Text.Trim(); txtHidInfo.Text = item.inviteDesc; item.descremark = txtHidInfo.Text; item.addTime = DateTime.Now; item.status = 0; if (id != 0) { item.id = id; if (InviteService.Update(item)) { Jscript.AlertAndRedirect("修改成功", "inviteInfo.aspx"); } else { Jscript.AlertAndRedirect("修改失败", "inviteInfo.aspx"); } } else { int num = InviteService.Add(item); if (num > 0) { Jscript.AlertAndRedirect("添加成功", "inviteInfo.aspx"); } else { Jscript.AlertAndRedirect("添加失败", "inviteInfo.aspx"); } } }
protected void AddSubmit_Click(object sender, EventArgs e) { string str0 = CustomerID.Text.ToString(); string str1 = CreateDate.Text.ToString(); string str2 = SalesOrderID.Text.ToString(); string str3 = Description.Value.ToString(); SalesRecord s = new SalesRecord(); s.CreateDate = str1; s.CustomerID = str0; s.Description = str3; s.SalesOrderID = str2; s.PlatformID = int.Parse(Platform.SelectedValue.ToString()); s.UserName = getUserName(); Leyp.SQLServerDAL.Sales.SalesRecordDAL bl = new Leyp.SQLServerDAL.Sales.SalesRecordDAL(); bl.insertNewEntity(s); CustomerID.Text = ""; CreateDate.Text = ""; SalesOrderID.Text = ""; Jscript.CloseWindowReturnValues("顾客ID:" + str0); }
protected void rp_main_ItemCommand(object source, RepeaterCommandEventArgs e) { SHUniversity.KPI.Model.Users currUser = Session["SHUUser"] as SHUniversity.KPI.Model.Users; string parma = e.CommandArgument.ToString(); //0未提交1正在审核2审核通过3退回 if (e.CommandName == "pass") { bool r = kpiBll.ChangeStatus(parma, 2, currUser.Name, currUser.WorkID); if (r) { Jscript.Alert("审核成功"); } else { Jscript.Alert("审核失败,稍后再试"); } } if (e.CommandName == "back") { bool r = kpiBll.ChangeStatus(parma, 3, currUser.Name, currUser.WorkID); if (r) { Jscript.Alert("审核成功"); } else { Jscript.Alert("审核失败,稍后再试"); } } }
//数据库操作错误信息显示 public static void ShowDBErrMsg(int flag, string msg) { string ErrMsg = ""; HSql hs = new HSql(); hs.Open("SELECT Top 1 msg_desc FROM [msg_mstr] WHERE msg_id=" + flag.ToString()); if (hs.NextRow()) { if (msg != "") { ErrMsg = "【" + msg + "】 "; } ErrMsg = ErrMsg + hs["msg_desc"].ToString().Trim(); } else { ErrMsg = "发生未知类型错误:" + flag.ToString(); } if (ErrMsg != "") { Jscript.AlertAndGoBack(" 错误提示: " + ErrMsg); } }
protected void Page_Load(object sender, EventArgs e) { string successMessage = IRequest.GetFormString("successMessage"); string successUrl = IRequest.GetFormString("successUrl"); string errorMessage = IRequest.GetFormString("errorMessage"); if ((IRequest.GetFormString("Js_RealName").Length <= 1) || (IRequest.GetFormString("Js_Tel").Length <= 1) || (IRequest.GetFormString("Js_Email").Length <= 1)) { Jscript.AlertAndBack(errorMessage); } else { try { using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession()) { SqlDb.Dcms_JobSeeker jobSeeker = new SqlDb.Dcms_JobSeeker(); jobSeeker.Js_AddTime = DateTime.Now; UpdateModelByForm(jobSeeker, Request.Form); session.Create(jobSeeker); } Jscript.AlertAndRedirect(successMessage, successUrl); } catch { Jscript.AlertAndBack(errorMessage); } } }
protected void Button1_Click(object sender, EventArgs e) { if (this.TextBox1.Text.Trim() == string.Empty) { Jscript.Alert("投票信息标题不能为空!", this.Page); } else if (this.Text1.Value.Trim() == string.Empty) { Jscript.Alert("到期时间不能为空!", this.Page); } else { HXD.SQLServerDAL.tb_U_TouPiao toupiaodal = new HXD.SQLServerDAL.tb_U_TouPiao(); //投票操作类 HXD.Model.tb_U_TouPiao toupiaomodel = new HXD.Model.tb_U_TouPiao(); //投票属性类 toupiaomodel.title = this.TextBox1.Text.Trim(); toupiaomodel.is_Examine = this.CheckBox1.Checked ? 1 : 0; toupiaomodel.is_Recommendation = this.CheckBox2.Checked ? 1 : 0; toupiaomodel.end_time = Convert.ToDateTime(this.Text1.Value); toupiaomodel.VoteType = this.RadioButton1.Checked ? 1 : 2; if (toupiaodal.Add(toupiaomodel)) { Jscript.AlertAndRedirect("投票信息添加成功!", "TouPiaoList.aspx?Page=" + Pages); } else { Jscript.Alert("投票信息添加失败!", this.Page); } } }
/// <summary> /// 保存信息 /// </summary> protected void ModelSave() { string Field = "ClassId,", Val = this.ClassId.SelectedValue + "{$split$}"; mField mF = new mField(); bField bF = new bField(); mF.TableName = mm.TableName; DataSet ds = bF.FieldList(mF); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string ValTemp = System.Web.HttpContext.Current.Request.Form[ds.Tables[0].Rows[i]["Field"].ToString()]; if (ValTemp != string.Empty && ValTemp != null) { Field += ds.Tables[0].Rows[i]["Field"].ToString() + ","; Val += HXD.ModelField.Common.FieldType.FormatField(ds.Tables[0].Rows[i]["Type"].ToString(), ds.Tables[0].Rows[i]["Field"].ToString()) + "{$split$}"; } } if (mm.Id == 0) { bm.ModelInsert(mm.TableName, Field, Val); } else { bm.ModelUpdate(mm.Id, mm.TableName, Field, Val); } if (MenuId == 0) { Jscript.Alert("保存成功!", this.Page); binder(); } else { Response.Redirect("Model_Manage.aspx?MenuId=" + MenuId); } }
/// <summary> /// 登录 /// </summary> /// <param name="name"></param> /// <param name="pwd"></param> protected void Login(string name, string pwd) { E_User data = new E_User(); data.UserType = (int)MLMGC.DataEntity.User.UserType.个人用户; data.UserName = name; data.Password = MLMGC.COMP.EncryptString.EncryptPassword(pwd);//加密 data = new MLMGC.BLL.User.T_User().UserLogin(data); if (data != null) { E_PersonalUser dataPU = new E_PersonalUser(); dataPU.UserID = data.UserID; dataPU.PersonalID = data.EnterpriseID; dataPU.UserName = data.UserName; dataPU.Password = data.Password; new MLMGC.Security.PersonalPage().Login(dataPU); //登录成功添加日志 data.LoginIP = HttpContext.Current.Request.ServerVariables["Remote_Addr"]; data.Browser = HttpContext.Current.Request.Browser.Type; data.Resolution = ""; bool flag = new MLMGC.BLL.User.T_User().AddLoginInfo(data); Response.Redirect("../Personal/Default.aspx"); } else { Jscript.ShowMsg("密码错误!", this); return; } }
protected void databind() { //获取文库编号 int id; if (!int.TryParse(Request["id"], out id)) { Jscript.AlertAndRedirect(this, "参数错误", "List.aspx"); return; } //根据编号获取文库详情 E_WenKu data = new E_WenKu(); data.WenKuID = id; data = new T_WenKu().GetModel(data); if (data == null) { Jscript.ShowMsg("未获取对象", this); return; } //判断swf文件是否存在,若不存在,则直接返回 string flashpath = MLMGC.COMP.Config.GetWenKu("swf\\" + data.FileUrl.Substring(0, data.FileUrl.LastIndexOf(".")) + ".swf"); if (!File.Exists(flashpath)) { Jscript.CloseWindow("对应的文件未找到:"+flashpath); return; } lblCaption.Text = data.Caption; lblIntro.Text = data.Intro; lblKeyword.Text = data.Keywords; lblSize.Text = MLMGC.COMP.CommonMethod.FileSize(data.FileSize); FlashUrl = Config.GetWenKuUrl("swf/"+data.FileUrl.Substring(0, data.FileUrl.LastIndexOf(".")) + ".swf"); }