Esempio n. 1
0
        private string uploadFolder = string.Empty; //头像上传路径

        #endregion Fields

        #region Methods

        protected void btnUpdateGravatar_Click(object sender, EventArgs e)
        {
            BLL.UserExp.UsersExp UsersExpBLL = new BLL.UserExp.UsersExp();
            int imageWidth = Int32.Parse(txt_width.Text);
            int imageHeight = Int32.Parse(txt_height.Text);
            int cutTop = Int32.Parse(txt_top.Text);
            int cutLeft = Int32.Parse(txt_left.Text);
            int dropWidth = Int32.Parse(txt_DropWidth.Text);
            int dropHeight = Int32.Parse(txt_DropHeight.Text);
            string filename = Maticsoft.Common.CutPhotoHelp.SaveCutPic(Server.MapPath(ImageIcon.ImageUrl), Server.MapPath("/" + uploadFolder), 0, 0, dropWidth, dropHeight, cutLeft, cutTop, imageWidth, imageHeight);
            if (CurrentUser.UserID > 0)
            {
                Model.UserExp.UsersExp UsersExpModel = new Model.UserExp.UsersExp();

                UsersExpModel.UserAvatar = "/" + uploadFolder + "/" + filename;
                UsersExpModel.UserID = CurrentUser.UserID;
                if (UsersExpBLL.UpdateGravatar(UsersExpModel))
                {
                    //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "修改头像成功!", "UserBaseInfo.aspx");
                    Response.Redirect("UserBaseInfo.aspx");
                }
                else
                {
                    Maticsoft.Common.MessageBox.ShowFailTip(this, "修改头像失败!");
                    return;
                }
            }
        }
Esempio n. 2
0
        private void InitData()
        {
            BLL.UserExp.UsersExp userBll = new BLL.UserExp.UsersExp();
            DataSet dsUserExp = userBll.GetUserExpModel(CurrentUser.UserID);
            if (dsUserExp != null && dsUserExp.Tables[0].Rows.Count > 0)
            {
                DataRow dr = dsUserExp.Tables[0].Rows[0];
                this.lblUserName.InnerText = dr["TrueName"].ToString();
                if (dr["UserAvatar"] != null && dr["UserAvatar"].ToString().Length > 3)
                {
                    this.imgGravatar.Src = dr["UserAvatar"].ToString();
                }

                if (dr["UserRegionID"] != null)
                {
                    int rid = Common.Globals.SafeInt(dr["UserRegionID"].ToString(), 0);
                    BLL.Tao.Regions regionbll = new BLL.Tao.Regions();
                    this.litProvice.Text = regionbll.GetRegionAllName(rid);
                }

                this.lblIntroduction.Text = HttpUtility.HtmlEncode(dr["TeachDescription"].ToString());
                this.txtDesc.Text = dr["TeachDescription"].ToString();

                DataSet dsUser = userBll.GetUserCertificate(CurrentUser.UserID, null, 1);
                System.Text.StringBuilder strAuthenticArray = new System.Text.StringBuilder();
                for (int i = 0; i < dsUser.Tables[0].Rows.Count; i++)
                {
                    strAuthenticArray.Append(dsUser.Tables[0].Rows[i]["ApproveName"].ToString());
                    strAuthenticArray.Append("</br>");
                }
                if (strAuthenticArray.Length > 0)
                {
                    this.lblCertificate.Text = HttpUtility.HtmlEncode(strAuthenticArray.ToString());
                    //imgYYZ.Visible = true;
                }
                else
                {
                    //imgYYZ.Visible = false;
                }

                if (dr["Tags"] != null && dr["Tags"].ToString().Length > 0)
                {
                    this.hyLabel.Text = HttpUtility.HtmlEncode(SplitTag(dr["Tags"].ToString()));
                }
                this.txtTag.Text = HttpUtility.HtmlEncode(dr["Tags"].ToString().Replace('|', ' '));
                this.txtDesc.Visible = false;
                this.btnCom.Visible = false;
                this.txtTag.Visible = false;
            }
        }
Esempio n. 3
0
 /// <summary>
 ///  检测注册邮箱是否存在 ,如果存在则不允许注册
 /// </summary>
 private void CheckEmail(HttpRequest Request, HttpResponse Response)
 {
     if (!string.IsNullOrEmpty(Request.Form["EmailAdd"]))
     {
         BLL.UserExp.UsersExp userBll=new BLL.UserExp.UsersExp();
         string EmailAdd = Request.Form["EmailAdd"];
         if (userBll.EmailExist(EmailAdd))
         {
             //存在
             Response.Write("yes");
         }
         else
         {
             //不存在
             Response.Write("no");
         }
     }
 }
Esempio n. 4
0
 protected void btnCom_Click(object sender, EventArgs e)
 {
     BLL.UserExp.UsersExp userBll = new BLL.UserExp.UsersExp();
     this.lblIntroduction.Visible = true;
     this.btnCom.Visible = false;
     this.txtDesc.Visible = false;
     this.btnEdit.Visible = true;
     this.txtTag.Visible = false;
     this.hyLabel.Visible = true;
     string destription = this.txtDesc.Text;
     string tags = this.txtTag.Text.Replace(' ', '|');
     if (userBll.UpdateTeacher(destription, tags, CurrentUser.UserID))
     {
         Maticsoft.Common.MessageBox.ShowSuccessTip(this, "保存成功!");
         InitData();
     }
     else
     {
         Maticsoft.Common.MessageBox.ShowFailTip(this, "系统忙,请稍后再试!");
     }
 }
Esempio n. 5
0
 private void GetUserInfo(HttpContext context)
 {
     JsonObject json = new JsonObject();
     string strUid = context.Request.Params["Uid"];
     if (!string.IsNullOrEmpty(strUid))
     {
         BLL.UserExp.UsersExp user = new BLL.UserExp.UsersExp();
         DataSet ds = user.GetUserInfo(int.Parse(strUid));
         if (ds != null)
         {
             if (ds.Tables[0].Rows.Count > 0)
             {
                 json.Put("UserName", ds.Tables[0].Rows[0]["UserName"]);
                 json.Put("UserAvatar", ds.Tables[0].Rows[0]["UserAvatar"]);
                 json.Put(TAO_KEY_STATUS, TAO_STATUS_SUCCESS);
             }
             else
             {
                 json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED);
             }
         }
         else
         {
             json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED);
         }
     }
     else
     {
         json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED);
     }
     context.Response.Write(json.ToString());
 }
Esempio n. 6
0
        /// <summary>
        /// 根据关键字查询课程信息
        /// </summary>
        /// <param name="context"></param>
        private void GetAuthentic(HttpContext context)
        {
            string uid = context.Request.Params["uid"];
            JsonObject json = new JsonObject();
            if (!string.IsNullOrEmpty(uid))
            {
                BLL.UserExp.UsersExp userBll = new BLL.UserExp.UsersExp();
                System.Data.DataSet dsUser = userBll.GetUserCertificate(int.Parse(uid), null, 1);
                System.Text.StringBuilder strAuthenticArray = new System.Text.StringBuilder();
                for (int i = 0; i < dsUser.Tables[0].Rows.Count; i++)
                {
                    strAuthenticArray.Append(dsUser.Tables[0].Rows[i]["ApproveName"].ToString());
                    strAuthenticArray.Append("&nbsp;");
                }

                json.Put(TAO_KEY_STATUS, TAO_STATUS_SUCCESS);
                json.Put("COUNT", strAuthenticArray.ToString());
            }
            else
            {
                json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED);
            }
            context.Response.Write(json.ToString());
        }
Esempio n. 7
0
 private void TeacherRecommended(HttpContext context)
 {
     string topStr = context.Request.Params["TopNum"];
     int topNum = Common.Globals.SafeInt(topStr, 0);
     BLL.UserExp.UsersExp userBll = new BLL.UserExp.UsersExp();
     DataSet ds = userBll.GetReTeacher(topNum);
     JsonObject json = new JsonObject();
     if (ds != null)
     {
         if (ds.Tables[0].Rows.Count > 0)
         {
             JsonArray data = new JsonArray();
             data.Add(ds.Tables[0]);
             json.Put(TAO_KEY_DATA, data);
             json.Put(TAO_KEY_STATUS, TAO_STATUS_SUCCESS);
         }
         else
         {
             json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED);
         }
     }
     else
     {
         json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED);
     }
     context.Response.Write(json.ToString());
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            BLL.UserExp.UsersExp userExpBll = new BLL.UserExp.UsersExp();
            BLL.Tao.SendInvite inviteBll = new BLL.Tao.SendInvite();
            if (this.HiddenFieldRadio.Value == "0")
            {
                if (Session["UserInfo"] == null)
                {
                    Common.CommonCode.GoLoginPage();
                }
                Maticsoft.Accounts.Bus.User user = (Maticsoft.Accounts.Bus.User)Session["UserInfo"];

                int iAddresseeId = userExpBll.GetUserIDByUserName(this.HiddenFieldUserName.Value);

                //新增站内信阅读信息
                BLL.Messages.ReceivedMessages receivedBll = new BLL.Messages.ReceivedMessages();
                Model.Messages.ReceivedMessages reveivedModel = new Model.Messages.ReceivedMessages();
                reveivedModel.AddresserId = user.UserID;
                reveivedModel.AddresseeId = iAddresseeId;
                reveivedModel.PublishContent = HiddenFieldtxtContent.Value;
                reveivedModel.PublishDate = DateTime.Now;
                reveivedModel.Title = "开课邀请";
                reveivedModel.LastTime = DateTime.Now;
                reveivedModel.IsRead = false;
                long iReslut = receivedBll.Add(reveivedModel);

                //新增站内信发送信息
                BLL.Messages.SendedMessages sendBll = new BLL.Messages.SendedMessages();
                Model.Messages.SendedMessages sendModel = new Model.Messages.SendedMessages();
                sendModel.AddresserId = user.UserID;
                sendModel.AddresseeId = iAddresseeId;
                sendModel.PublishContent = HiddenFieldtxtContent.Value;
                sendModel.PublishDate = DateTime.Now;
                sendModel.Title = "开课邀请";
                sendModel.ReceiveMessageId = iReslut;
                sendBll.Add(sendModel);

                Model.Tao.SendInvite inviteModel = new Model.Tao.SendInvite();
                inviteModel.ConstitutorID = int.Parse(this.HiddenField1.Value);
                inviteModel.InviteeID = iAddresseeId;
                inviteModel.InviteDate = DateTime.Now;
                inviteModel.InviteStatus = 0;
                inviteModel.ModuleID = int.Parse(this.HiddenField2.Value);
                if (inviteBll.Add(inviteModel) > 0)
                {
                    courseModuleBll.SendEmailSuccess(int.Parse(this.HiddenField2.Value), 1);
                    this.ErrorMsg.Visible = true;
                    this.ErrorMsg.Text = "邀请发送成功!";
                }
                else
                {
                    this.ErrorMsg.Visible = false;
                    this.ErrorMsg.Text = "邀请发送失败!";
                    return;
                }
            }
            else
            {
                int moduleId = int.Parse(this.HiddenField2.Value);
                int status = 1;
                if (courseModuleBll.SendEmailSuccess(moduleId, status))
                {
                    try
                    {
                        //l 给操作者发送邮件
                        string userMail = this.HiddenFieldUserEmail.Value;
                        string mailContent = this.HiddenFieldtxtEmailContent.Value;
                        string subject = "开课邀请";
                        Maticsoft.Common.MailSender.Send(userMail, subject, mailContent.ToString());
                    }
                    catch
                    {
                        this.ErrorMsg.Visible = false;
                        this.ErrorMsg.Text = "邀请发送失败!";
                        status = 0;
                        courseModuleBll.SendEmailSuccess(moduleId, status);
                        return;
                    }
                    this.ErrorMsg.Visible = true;
                    this.ErrorMsg.Text = "邀请发送成功!";
                    BindData(int.Parse(Request.QueryString["CourseId"]));
                }
                else
                {
                    this.ErrorMsg.Visible = false;
                    this.ErrorMsg.Text = "邀请发送失败!";
                    return;
                }
            }
        }