public void CreateAlbumsCate(AlbumsCate albumscate) { using (SqlConnection connection = base.GetConnection()) { SqlCommand command = new SqlCommand("_AlbumsCateUpdate", connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@AlbumsCateID", 0); command.Parameters.AddWithValue("@ParentCateID", albumscate.ParentCateID); command.Parameters.AddWithValue("@AlbumsCateName", albumscate.AlbumsCateName); command.Parameters.AddWithValue("@AlbumsCateTotal", albumscate.AlbumsCateTotal); command.Parameters.AddWithValue("@AlbumsCateOrder", albumscate.AlbumsCateOrder); command.Parameters.AddWithValue("@ImageThumb", albumscate.ImageThumb); command.Parameters.AddWithValue("@ImageLarge", albumscate.ImageLarge); command.Parameters.AddWithValue("@Description", albumscate.Description); command.Parameters.AddWithValue("@UserName", albumscate.UserName); command.Parameters.AddWithValue("@Created", albumscate.Created); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("Kh\x00f4ng thể tạo danh mục tin"); } command.Dispose(); } }
private AlbumsCate ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int thumb_w = Convert.ToInt32(config.New_thumb_w); int thumb_h = Convert.ToInt32(config.New_thumb_h); //int large_w = Convert.ToInt32(config.New_large_w); //int large_h = Convert.ToInt32(config.New_large_h); string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "Upload/Albums/AlbumsCate/ImgThumb/"; //string path_large = Request.PhysicalApplicationPath.Replace(@"\", "/") + "Upload/Albums/AlbumsCate/ImgLarge/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(file_icon, path_thumb, thumb_w, thumb_h); //string image_large = commonBSO.UploadImage(file_icon, path_large, large_w, large_h); AlbumsCate albumscate = new AlbumsCate(); albumscate.AlbumsCateID = (hddAlbumsCateID.Value != "") ? Convert.ToInt32(hddAlbumsCateID.Value) : 0; albumscate.ParentCateID = (ddlAlbumsCate.SelectedValue != "") ? Convert.ToInt32(ddlAlbumsCate.SelectedValue) : 0; albumscate.AlbumsCateName = txtAlbumsCateName.Text; albumscate.AlbumsCateOrder = (hddAlbumsCateOrder.Value != "") ? Convert.ToInt32(hddAlbumsCateOrder.Value) : 0; albumscate.AlbumsCateTotal = (hddAlbumsCateTotal.Value != "") ? Convert.ToInt32(hddAlbumsCateTotal.Value) : 0; albumscate.ImageThumb = (image_thumb != "") ? image_thumb : hddImageThumb.Value; //albumscate.ImageLarge = (image_large != "") ? image_large : hddImageLarge.Value; albumscate.ImageLarge = ""; albumscate.Description = txtSlogan.Text; albumscate.UserName = (hddUserName.Value != "") ? hddUserName.Value : Session["Admin_UserName"].ToString(); albumscate.Created = (hddCreated.Value != "") ? Convert.ToDateTime(hddCreated.Value) : DateTime.Now; return albumscate; }
public void CreateCateNew(AlbumsCate albumcate) { new AlbumsCateDAO().CreateAlbumsCate(albumcate); }
public void UpdateAlbumsCate(AlbumsCate albumcate) { new AlbumsCateDAO().UpdateAlbumsCate(albumcate); }