/// <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); } }
/// <summary> /// 数据绑定 /// </summary> protected void databind() { //加载项目信息 E_Item data = new T_Item().GetModel(new E_Item() { EnterpriseID = eid }); if (data != null) { ltItemName.Text = data.ItemName; ltItemIntro.Text = data.ItemIntro; ltSignature.Text = data.Signature; ltItemContent.Text = data.ItemContent; imgPhoto.ImageUrl = MLMGC.COMP.Config.GetEnterpriseItemPhotoUrl(data.Photo); ltEstablished.Text = data.Established.ToShortDateString(); //txtCityID.Text = data.CityID.ToString(); region.RegionID = data.CityID; } //加载个人信息 E_Personal pData = new T_Personal().GetModel(new E_Personal() { PersonalID = PersonalID, UserID = UserID }); if (pData != null) { txtUserName.Text = pData.RealName; txtMobile.Text = pData.Mobile; txtTel.Text = pData.Tel; txtEmail.Text = pData.Email; txtAddress.Text = pData.Address; //判断个人是否已经加入了项目 if (pData.ItemFlag == EnumItemFlag.已经加入项目) { btnApply.Enabled = false; } } //判断个人是否已经申请过了该项目 if (btnApply.Enabled)//若btnApply不可以用,说明他已经加入了项目,就不用再判断他是否申请过该项目了。 { bool flag = new T_ItemApply().Exists(new E_ItemApply() { ItemID = iid, UserID = UserID, ApplyType = EnumApplyType.申请加入 }); if (flag) { btnApply.Text = "申请已提交,正在申核。"; btnApply.Enabled = false; } } loadMessage(); }
/// <summary> /// 绑定数据 /// </summary> protected void databind() { //判断用户是否已经申请过退出,若申请过,不允许再申请 bool flag = new T_ItemApply().Exists(new E_ItemApply() { ItemID = itemid, UserID = UserID, ApplyType = EnumApplyType.申请退出 }); if (flag) { Jscript.AlertAndRedirect(this, "你已经提交了退出申请,请耐心等待!", "itemlist.aspx"); } }
/// <summary> /// 企业总监申述个人用户项目申请 /// </summary> private void UpdateStatus() { int aid, status, type; if (!int.TryParse(nv["aid"], out aid) || !int.TryParse(nv["status"], out status) || !int.TryParse(nv["type"], out type)) { HttpContext.Current.Response.Write("0"); return; } E_ItemApply data = new E_ItemApply(); data.EnterpriseID = bp.EnterpriceID; data.ApplyType = type == 1 ? EnumApplyType.申请加入 : EnumApplyType.申请退出; data.ApplyID = aid; data.SetStatus = status; int result = new T_ItemApply().Update(data); HttpContext.Current.Response.Write(result.ToString()); }
/// <summary> /// 申请该项目 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnApply_Click(object sender, EventArgs e) { E_ItemApply data = new E_ItemApply(); data.ItemID = iid; data.ApplyType = EnumApplyType.申请加入; data.UserID = UserID; data.Reason = ""; bool flag = new T_ItemApply().Add(data); if (flag) { Jscript.ShowMsg("申请成功", this); databind(); } else { Jscript.ShowMsg("留言失败!", this); } }