protected void btnUpdateGravatar_Click(object sender, EventArgs e) { BLL.Tao.Courses CourseBll = new BLL.Tao.Courses(); 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); uploadFolder += "/" + CurrentUser.UserID + "/" + CourseId; string filename = Maticsoft.Common.CutPhotoHelp.SaveCutPic(Server.MapPath(ImageIcon.ImageUrl), Server.MapPath("/" + uploadFolder), 0, 0, dropWidth, dropHeight, cutLeft, cutTop, imageWidth, imageHeight); if (CourseId > 0) { Model.Tao.Courses CourseModle = new Model.Tao.Courses(); CourseModle.ImageUrl = "/" + uploadFolder + "/" + filename; CourseModle.CourseID = CourseId; string returnUrl = Request.QueryString["ReturnUrl"]; if (CourseBll.EditCourseThumbnai(CourseModle)) { Response.Redirect(returnUrl); } else { Maticsoft.Common.MessageBox.Show(this, "课程图片上传失败!"); Response.Redirect(returnUrl); return; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BLL.Tao.Courses courseBll = new BLL.Tao.Courses(); DataSet ds = courseBll.GetRecommendedCourseList(this.courseId, this.top); this.DataList_RecommendedList.DataSource = ds; this.DataList_RecommendedList.DataBind(); } }
public int GetBuyNums(object courseId) { if (courseId != null) { if (!string.IsNullOrEmpty(courseId.ToString())) { BLL.Tao.Courses coursesBLL = new BLL.Tao.Courses(); return coursesBLL.GetSellCourseNum(int.Parse(courseId.ToString())); } else { return 0; } } else { return 0; } }