Exemple #1
0
 protected void btnUpdate_Click(object sender, System.EventArgs e)
 {
     string username = this.txtUserName.Text;
     string passward = this.txtPassword.Text;
     Maticsoft.Accounts.Bus.User currentUser = new Maticsoft.Accounts.Bus.User();
     if (!currentUser.SetPassword(username, passward))
     {
         this.lblMsg.ForeColor = Color.Red;
         this.lblMsg.Text = "更新用户信息发生错误!";
     }
     else
     {
         this.lblMsg.ForeColor = Color.Blue;
         this.lblMsg.Text = "用户信息更新成功!";
     }
 }
Exemple #2
0
 private void SaveInfo(bool type)
 {
     string TrueName = this.txtName.Text;//教师名称
     string TeachDec = this.txtDec.Value;//教师简介------注意替换HTML标签和JS脚本
     if (UserBll.EditUesInfo(TrueName, TeachDec, CurrentUser.UserID, this.txtDepartmentName.Value))
     {
         UserBll.UpdateTeacherAc(this.HiddenField_ICOPath.Value, CurrentUser.UserID);
         CurrentUser = new Maticsoft.Accounts.Bus.User(CurrentUser.UserID);
         Session["UserInfo"] = CurrentUser;
         if (type)
         {
             Response.Redirect("UploadCourse.aspx?CourseId=" + CourseId);
         }
         else
         {
             Response.Redirect("/PublishCourse/TeacherAvatarEdit.aspx?CourseId=" + this.hfCourseID.Value + "&ReturnUrl=" + this.hfRuturnUrl.Value);
         }
     }
     else
     {
         Maticsoft.Common.MessageBox.Show(this, "教师信息保存失败!");
     }
 }
Exemple #3
0
 public string GetUserNameByCache(int userID)
 {
     string cacheKey = "UserName-" + userID;
     object cache = DataCache.GetCache(cacheKey);
     if (cache == null)
     {
         try
         {
             cache = new Maticsoft.Accounts.Bus.User(userID).UserName;
             if (cache == null)
             {
                 return "";
             }
             int configInt = ConfigHelper.GetConfigInt("CacheTime");
             DataCache.SetCache(cacheKey, cache, DateTime.Now.AddMinutes((configInt > 0) ? ((double) configInt) : ((double) 180)), TimeSpan.Zero);
         }
         catch
         {
             return "";
         }
     }
     return cache.ToString();
 }
Exemple #4
0
        public string getTeacherCount(object courseId, object createUid)
        {
            if (courseId != null && createUid != null)
            {
                if (!string.IsNullOrEmpty(courseId.ToString()) && !string.IsNullOrEmpty(createUid.ToString()))
                {

                    int cid = int.Parse(courseId.ToString());
                    int count = coursesBll.GetCourserteacher(cid);
                    //return count;
                    string teacherName = string.Empty;
                    if (PageValidate.IsNumber(createUid.ToString()))
                    {
                        Maticsoft.Accounts.Bus.User currentUser = new Maticsoft.Accounts.Bus.User(Convert.ToInt32(createUid));
                        if (null != currentUser)
                        {
                            teacherName = currentUser.TrueName;
                            if (count > 1)
                            {
                                return teacherName + "<br/>等" + count + "人";
                            }
                            else
                            {
                                return teacherName;
                            }
                        }
                        else
                        {
                            return "不详";
                        }
                    }
                    else
                    {
                        return "不详";
                    }
                }
                else
                {
                    return "不详";
                }
            }
            else
            {
                return "不详";
            }
        }