private Brand ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int thumb_w = Convert.ToInt32(config.Product_thumb_w); int thumb_h = Convert.ToInt32(config.Product_thumb_h); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Brand/"; commonBSO commonBSO = new commonBSO(); string icon = commonBSO.UploadImage(file_icon, path, thumb_w, thumb_h); Brand brand = new Brand(); brand.BrandID = (hddBrandID.Value != "") ? Convert.ToInt32(hddBrandID.Value) : 0; brand.BrandName = txtBrandName.Text; brand.BrandUrl = txtBrandUrl.Text; brand.Image = icon; brand.ShortDescribe = txtShortDescribe.Text; brand.Language = Language.language; return brand; }
private Adv ReceiveHtml() { int thumb_w = Convert.ToInt32(txtAdvWidth.Text); int thumb_h = Convert.ToInt32(txtAdvHeight.Text); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Advertising/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(file_image_thumb, path, thumb_w, thumb_h); Adv adv = new Adv(); adv.AdvID = (hddAdvID.Value != "") ? Convert.ToInt32(hddAdvID.Value) : 0; adv.AdvUrl = txtAdvUrl.Text; adv.AdvImage = (image_thumb != "") ? image_thumb : hddAdvImageThumb.Value; adv.AdvWidth = Convert.ToInt32(txtAdvWidth.Text); adv.AdvHeight = Convert.ToInt32(txtAdvHeight.Text); adv.AdvPostDate = DateTime.Now; adv.AdvEndDate = DateTime.Now; adv.AdvStatus = Convert.ToBoolean(rdbAdvStatus.SelectedValue); return adv; }
private Link ReceiveHtml() { int thumb_w = Convert.ToInt32(txtLinkWidth.Text); int thumb_h = Convert.ToInt32(txtLinkHeight.Text); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Link/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(file_image_thumb, path, thumb_w, thumb_h); Link link = new Link(); link.LinkID = (hddLinkID.Value != "") ? Convert.ToInt32(hddLinkID.Value) : 0; link.LinkUrl = txtLinkUrl.Text; link.LinkImage = (image_thumb != "") ? image_thumb : hddLinkImageThumb.Value; link.LinkWidth = Convert.ToInt32(txtLinkWidth.Text); link.LinkHeight = Convert.ToInt32(txtLinkHeight.Text); link.LinkType = 1; link.LinkStatus = Convert.ToBoolean(rdbLinkStatus.SelectedValue); return link; }
private SinglePage ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int icon_w = Convert.ToInt32(config.New_thumb_w); int icon_h = Convert.ToInt32(config.New_thumb_h); commonBSO commonBSO = new commonBSO(); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/SinglePage/"; string imgIcon = commonBSO.UploadImage(fileIcon, path, icon_w, icon_h); SinglePage singlepage = new SinglePage(); singlepage.SinglePageID = (hddSinglePageID.Value != "") ? Convert.ToInt32(hddSinglePageID.Value) : 0; singlepage.SinglePageName = txtSinglePageName.Text; singlepage.Icon = (imgIcon != "") ? imgIcon : hddIcon.Value; singlepage.SinglePageDesc = txtRadSinglePageDesc.Html; singlepage.SinglePageContent = txtRadSinglePageContent.Html; singlepage.Language = Language.language; singlepage.Status = Convert.ToBoolean(rdbStatus.SelectedValue); singlepage.CreateDate = DateTime.Now; singlepage.CreatedUserName = Session["Admin_UserName"].ToString(); return singlepage; }
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; }
private News 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); commonBSO commonBSO = new commonBSO(); string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/News/NewsThumb/"; string image_thumb = commonBSO.UploadImage(file_image_thumb, path_thumb, thumb_w, thumb_h); int large_w = Convert.ToInt32(config.New_large_w); int large_h = Convert.ToInt32(config.New_large_h); string path_large = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/News/NewsLarge/"; string image_large = commonBSO.UploadImage(file_image_large, path_large, large_w, large_h); News news = new News(); news.NewsID = (hddNewsID.Value != "") ? Convert.ToInt32(hddNewsID.Value) : 0; news.CateNewsID = Convert.ToInt32(ddlCateNews.SelectedValue); news.ParentNewsID = (hddParentNewsID.Value != "") ? Convert.ToInt32(hddParentNewsID.Value) : 0; news.Title = txtTitle.Text; news.ShortDescribe = txtRadShort.Html; news.FullDescribe = txtRadFull.Html; news.ImageThumb = (image_thumb != "") ? image_thumb : hddImageThumb.Value; news.ImageLarge = (image_large != "") ? image_large : hddImageLarge.Value; news.Author = txtAuthor.Text; news.PostDate = txtRadDate.SelectedDate.Value; news.RelationTotal = (hddRelationTotal.Value != "") ? Convert.ToInt32(hddRelationTotal.Value) : 0; news.Status = Convert.ToBoolean(rdbStatus.SelectedItem.Value); news.Language = Language.language; news.Ishot = Convert.ToBoolean(rdbIshot.SelectedValue); news.Ishome = Convert.ToBoolean(rdbIshome.SelectedValue); news.IsComment = Convert.ToBoolean(rdbComment.SelectedValue); news.Isview = (hddIsView.Value != "") ? Convert.ToInt32(hddIsView.Value) : 0; news.CommentTotal = (hddCommentTotal.Value != "") ? Convert.ToInt32(hddCommentTotal.Value) : 0; news.CreatedUserName = (hddCreateUserName.Value != "") ? hddCreateUserName.Value : Session["Admin_UserName"].ToString(); news.GroupCate = 1; news.IsApproval = Convert.ToBoolean(rdbApproval.SelectedValue); if (hddApprovalUserName.Value != "") { news.ApprovalUserName = hddApprovalUserName.Value; news.ApprovalDate = Convert.ToDateTime(hddApprovalDate.Value); } else if (Convert.ToBoolean(rdbApproval.SelectedValue)) { news.ApprovalUserName = Session["Admin_UserName"].ToString(); news.ApprovalDate = DateTime.Now; } else { news.ApprovalUserName = ""; news.ApprovalDate = DateTime.Now; } return news; }
private Albums ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); commonBSO commonBSO = new commonBSO(); int thumb_w = Convert.ToInt32(config.New_icon_w); int thumb_h = Convert.ToInt32(config.New_icon_h); string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Albums/AlbumsImg/ImgThumb/"; int large_w = Convert.ToInt32(config.New_large_w); int large_h = Convert.ToInt32(config.New_large_h); string path_large = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Albums/AlbumsImg/ImgLarge/"; string image_thumb = commonBSO.UploadImage(file_image_thumb, path_thumb, thumb_w, thumb_h); string image_large = commonBSO.UploadImage(file_image_large, path_large, large_w, large_h); Albums album = new Albums(); //album.AlbumID = (hddAlbumID.Value != "") ? Convert.ToInt32(hddAlbumID.Value) : 0; //album.CateNewsID = (ddlCateNews.SelectedValue != "") ? Convert.ToInt32(ddlCateNews.SelectedValue) : 0; //album.ImageThumb = (image_thumb != "") ? image_thumb : hddImageThumb.Value; //album.ImageLarge = (image_large != "") ? image_large : hddImageLarge.Value; //album.IsHome = Convert.ToBoolean(rdbIsHome.SelectedValue); //album.Order = (hddOrder.Value != "") ? Convert.ToInt32(hddOrder.Value) : 0; album.AlbumsID = (hddAlbumID.Value != "") ? Convert.ToInt32(hddAlbumID.Value) : 0; album.AlbumsCateID = Convert.ToInt32(ddlAlbumsCate.SelectedValue); album.Title = txtTitle.Text; album.Description = txtRadShort.Html; album.ImageThumb = (image_thumb != "") ? image_thumb : hddImageThumb.Value; album.ImageLarge = (image_large != "") ? image_large : hddImageLarge.Value; album.Author = txtAuthor.Text; album.PostDate = txtRadDate.SelectedDate.Value; album.Status = Convert.ToBoolean(rdbStatus.SelectedItem.Value); album.Ishot = Convert.ToBoolean(rdbIshot.SelectedValue); album.Ishome = Convert.ToBoolean(rdbIshome.SelectedValue); album.Isview = (hddIsView.Value != "") ? Convert.ToInt32(hddIsView.Value) : 0; album.CommentTotal = (hddCommentTotal.Value != "") ? Convert.ToInt32(hddCommentTotal.Value) : 0; album.CreatedUserName = (hddCreateUserName.Value != "") ? hddCreateUserName.Value : Session["Admin_UserName"].ToString(); album.ApprovalUserName = (hddApprovalUserName.Value != "") ? hddApprovalUserName.Value : Session["Admin_UserName"].ToString(); album.IsComment = true; album.IsApproval = true; album.ApprovalDate = (hddApprovalDate.Value != "") ? Convert.ToDateTime(hddApprovalDate.Value) : DateTime.Now; return album; }
public Modules ReceiveHtml() { Modules modules = new Modules(); // string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Admin/Admin_Theme/Icons/"; string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Admin_Theme/Icons/"; commonBSO commonBSO = new commonBSO(); string icon_upload = commonBSO.UploadImage(uploadIcon, path, 55, 55); modules.ModulesID = (txtModulesID.Value != "") ? Convert.ToInt32(txtModulesID.Value) : 0; modules.ModulesName = (txtModulesName.Text != "") ? txtModulesName.Text.Trim() : ""; modules.ModulesOrder = 0; modules.ModulesParent = (ddlModules.SelectedValue != "") ? Convert.ToInt32(ddlModules.SelectedValue) : 0; modules.ModulesUrl = (txtModulesUrl.Text != "") ? txtModulesUrl.Text.Trim() : ""; modules.ModulesHelp = txtRadHelp.Html; modules.ModulesIcon = (icon_upload != "") ? icon_upload : hddIcon.Value; return modules; }
public ModulesFrontPanel ReceiveHtml() { ModulesFrontPanel _modulesFrontPanel = new ModulesFrontPanel(); // string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Admin/Admin_Theme/Icons/"; string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Admin_Theme/Icons/"; commonBSO commonBSO = new commonBSO(); string icon_upload = commonBSO.UploadImage(uploadIcon, path, 32, 32); _modulesFrontPanel.ModulesFrontPanelID = (txtModulesFrontPanelID.Value != "") ? Convert.ToInt32(txtModulesFrontPanelID.Value) : 0; _modulesFrontPanel.ModulesFrontPanelName = (txtModulesFrontPanelName.Text != "") ? txtModulesFrontPanelName.Text.Trim() : ""; _modulesFrontPanel.ModulesFrontPanelOrder = 0; _modulesFrontPanel.ModulesFrontPanelParent = (ddlModulesFrontPanel.SelectedValue != "") ? Convert.ToInt32(ddlModulesFrontPanel.SelectedValue) : 0; //_modulesFrontPanel.ModulesFrontPanelUrl = (txtModulesFrontPanelUrl.Text != "") ? txtModulesFrontPanelUrl.Text.Trim() : ""; if (dropControl.SelectedIndex > 0) { _modulesFrontPanel.ModulesFrontPanelUrl = dropControl.SelectedValue; } _modulesFrontPanel.ModulesFrontPanelHelp = txtRadHelp.Content; _modulesFrontPanel.ModulesFontPanelContent = txtRadFull.Content; _modulesFrontPanel.ModulesFrontPanelIcon = (icon_upload != "") ? icon_upload : hddIcon.Value; _modulesFrontPanel.ModulesFrontPanelTitle = (txtModulesFrontPanelTitle.Text != "") ? txtModulesFrontPanelTitle.Text.Trim() : ""; _modulesFrontPanel.ModulesFrontPanelValue = (ddlValueCategory.SelectedValue != "") ? ddlValueCategory.SelectedValue.Trim() : "0"; _modulesFrontPanel.ModulesFrontPanelRecord = (txtRecord.Text != "") ? Convert.ToInt32(txtRecord.Text) : 5; _modulesFrontPanel.ModulesFrontPanelPanel = rdbPanel.SelectedValue; _modulesFrontPanel.ModulesFrontPanelStatus = chkStatus.Checked; _modulesFrontPanel.Language = NgonNgu.SelectedValue; return _modulesFrontPanel; }
private CateNews ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int icon_w = Convert.ToInt32(config.New_icon_w); int icon_h = Convert.ToInt32(config.New_icon_h); int img_w = Convert.ToInt32(config.New_large_w); int img_h = Convert.ToInt32(config.New_large_h); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "Upload/Category/"; commonBSO commonBSO = new commonBSO(); string image_icon = commonBSO.UploadImage(file_icon, path, icon_w, icon_h); string image = commonBSO.UploadImage(FileUpload1, path, img_w, img_h); CateNews catenews = new CateNews(); catenews.CateNewsID = (hddCateNewsID.Value != "") ? Convert.ToInt32(hddCateNewsID.Value) : 0; catenews.ParentNewsID = (ddlCateNews.SelectedValue != "") ? Convert.ToInt32(ddlCateNews.SelectedValue) : 0; catenews.CateNewsName = txtCateNewsName.Text; catenews.CateNewsOrder = (hddCateNewsOrder.Value != "") ? Convert.ToInt32(hddCateNewsOrder.Value) : 0; catenews.CateNewsTotal = (hddCateNewsTotal.Value != "") ? Convert.ToInt32(hddCateNewsTotal.Value) : 0; catenews.Language = Language.language; catenews.GroupCate = Convert.ToInt32(HddGroupCate.Value); catenews.Icon = (image_icon != "") ? image_icon : hddIcon.Value; catenews.Image = (image != "") ? image : hddImage.Value; catenews.Slogan = txtSlogan.Text; catenews.UserName = (hddUserName.Value != "") ? hddUserName.Value : Session["Admin_UserName"].ToString(); catenews.Created = (hddCreated.Value != "") ? Convert.ToDateTime(hddCreated.Value) : DateTime.Now; catenews.isUrl = Convert.ToBoolean(rdbType.SelectedValue); catenews.Url = txtUrl.Text; catenews.Roles = ""; return catenews; }
private Download ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int thumb_w = Convert.ToInt32(config.New_large_w); int thumb_h = Convert.ToInt32(config.New_large_h); commonBSO commonBSO = new commonBSO(); string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Download/DownloadThumb/"; string image_thumb = commonBSO.UploadImage(file_image_thumb, path_thumb, thumb_w, thumb_h); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Download/Files/"; string file_upload = commonBSO.UploadFile(file_attached, path, 18000000000000); Download download = new Download(); download.DownloadID = (hddDownloadID.Value != "") ? Convert.ToInt32(hddDownloadID.Value) : 0; download.CateDownloadID = Convert.ToInt32(ddlCateDownload.SelectedValue); download.Title = txtTitle.Text; download.ShortDescribe = txtRadShort.Html; download.FullDescribe = txtRadFull.Html; download.ImageThumb = (image_thumb != "") ? image_thumb : hddImageThumb.Value; download.FileName = (file_upload != "") ? file_upload : hddFileName.Value; download.Author = txtAuthor.Text; download.PostDate = txtRadDate.SelectedDate.Value; download.RelationTotal = (hddRelationTotal.Value != "") ? Convert.ToInt32(hddRelationTotal.Value) : 0; download.Status = Convert.ToBoolean(rdbStatus.SelectedItem.Value); download.Language = Language.language; download.Ishot = Convert.ToBoolean(rdbIshot.SelectedValue); download.Ishome = Convert.ToBoolean(rdbIshome.SelectedValue); download.IsComment = Convert.ToBoolean(rdbComment.SelectedValue); download.Isview = (hddIsView.Value != "") ? Convert.ToInt32(hddIsView.Value) : 0; download.CommentTotal = (hddCommentTotal.Value != "") ? Convert.ToInt32(hddCommentTotal.Value) : 0; download.CreatedUserName = (hddCreateUserName.Value != "") ? hddCreateUserName.Value : Session["Admin_UserName"].ToString(); download.IsApproval = Convert.ToBoolean(rdbApproval.SelectedValue); if (hddApprovalUserName.Value != "") { download.ApprovalUserName = hddApprovalUserName.Value; download.ApprovalDate = Convert.ToDateTime(hddApprovalDate.Value); } else if (Convert.ToBoolean(rdbApproval.SelectedValue)) { download.ApprovalUserName = Session["Admin_UserName"].ToString(); download.ApprovalDate = DateTime.Now; } else { download.ApprovalUserName = ""; download.ApprovalDate = DateTime.Now; } return download; }
public ETO.Admin ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); ETO.Config config = configBSO.GetAllConfig(Language.language); int icon_w = Convert.ToInt32(config.New_icon_w); int icon_h = Convert.ToInt32(config.New_icon_h); SecurityBSO securityBSO = new SecurityBSO(); ETO.Admin admin = new ETO.Admin(); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Avatar/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(txtAvatar, path, icon_w, icon_h); admin.AdminLoginType = Convert.ToBoolean(rdbLoginType.SelectedItem.Value); //if (rdbLoginType.SelectedItem.Value.Equals("True")) //{ admin.AdminPass = (txtAdminPass.Text != "") ? securityBSO.EncPwd(txtAdminPass.Text.Trim()) : hddPass.Value; admin.AdminName = (txtAdminName.Text != "") ? txtAdminName.Text.Trim() : hddAdmin_Username.Value; admin.AdminEmail = (txtAdminEmail.Text != "") ? txtAdminEmail.Text.Trim() : ""; //} // admin.RolesID = (ddlRoles.SelectedValue != "") ? Convert.ToInt32(ddlRoles.SelectedValue) : 0; admin.RolesID = 1; admin.AdminActive = Convert.ToBoolean(rdbList.SelectedItem.Value); admin.AdminFullName = (txtFullName.Text != "") ? txtFullName.Text.Trim() : ""; admin.AdminCreated = Convert.ToDateTime(hdd_Created.Value); admin.AdminLog = Convert.ToDateTime(hdd_log.Value); //admin.AdminPermission = ""; admin.AdminPermission = (CheckedList() != "") ? CheckedList() : ""; admin.AdminAddress = (txtAddress.Text != "") ? txtAddress.Text.Trim() : ""; admin.AdminPhone = (txtPhone.Text != "") ? txtPhone.Text.Trim() : ""; admin.AdminNickYahoo = (txtNickYahoo.Text != "") ? txtNickYahoo.Text.Trim() : ""; admin.AdminNickSkype = (txtNickSkype.Text != "") ? txtNickSkype.Text.Trim() : ""; admin.AdminAvatar = (image_thumb != "") ? image_thumb : hddImageThumb.Value; admin.AdminSex = Convert.ToBoolean(rdbSex.SelectedItem.Value); admin.AdminBirth = txtBirth.SelectedDate.Value; return admin; }
private Video ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.lang); int thumb_w = Convert.ToInt32(config.Product_large_w); int thumb_h = Convert.ToInt32(config.Product_large_h); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Video/"; commonBSO commonBSO = new commonBSO(); string icon = commonBSO.UploadImage(file_icon, path, thumb_w, thumb_h); string pathvideo = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Video/Files/"; string file_upload = commonBSO.UploadVideo(txtFileName, pathvideo, 18000000000000); Video video = new Video(); video.VideoID = (hddVideoID.Value != "") ? Convert.ToInt32(hddVideoID.Value) : 0; video.VideoName = txtVideoName.Text; video.VideoUrl = ""; video.VideoEmbed = txtVideoUrl.Text; video.Image = (icon != "") ? icon : hddIcon.Value; video.FileName = (file_upload != "") ? file_upload : hddFileName.Value; video.ShortDescribe = txtShortDescribe.Text; video.PostDate = txtRadDate.SelectedDate.Value; video.IsHome = Convert.ToBoolean(rdbIsHome.SelectedValue); video.VideoType = Convert.ToBoolean(rdbType.SelectedValue); video.Language = NgonNgu.SelectedValue; return video; }
protected void btnSend_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Page.RouteData.Values["subid"].ToString())) //Update record { ListQuestionBSO listQuestionBSO = new ListQuestionBSO(); if (!string.IsNullOrEmpty(txtRadShort.Html)) { 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); ListQuestion listQuestionUpdate = new ListQuestion(); commonBSO commonBSO = new commonBSO(); string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Question/Images/"; string image_thumb = commonBSO.UploadImage(image_Attach, path_thumb, thumb_w, thumb_h); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Question/Files/"; string file_upload = commonBSO.UploadFile(file_Attach, path, 18000000000); string strFile = (file_upload != "") ? file_upload : HiddenField_FileAttach.Value; string strImage = (image_thumb != "") ? image_thumb : HiddenField_ImageAttach.Value; listQuestionBSO.UpdateSubQuestion(Convert.ToInt32(Page.RouteData.Values["subid"]), txtRadShort.Html, strImage, strFile); txtRadShort.Html = ""; //clientview.Text = strFile; } clientview.Text = String.Format(Resources.StringAdmin.AddNewsSuccessful); Response.Redirect("~/Admin/listdetailquestion/" + HiddenField_QuestionID.Value.ToString() + "/Default.aspx"); //initControl(Id); } else //Addnew record { ListQuestion listQuestion = ReceiveHtml_(); ListQuestionBSO listQuestionBSO = new ListQuestionBSO(); if (!string.IsNullOrEmpty(listQuestion.Question_Content)) { listQuestionBSO.CreateListQuestion(listQuestion); } else { //hien thong bao yeu cau nhap noi dung } //clientview.Text = String.Format(Resources.StringAdmin.AddNewsSuccessful); string strID = HiddenField_QuestionID.Value.ToString() + ","; //Cap nhat lai trang thai cau hoi doi voi cau hoi parent //Kiem tra user_Name login ? user_name CreateQuestion if (Session["Admin_UserName"].ToString() != HiddenField_CreateUserName.Value) { //Cap nhat status = 2: Da xu ly listQuestionBSO.UpdateQuestionStatus(strID, 2); //----Gui mail thong bao den khach hang khi co cau tra loi //------Lay userName sendMailToUser(listQuestion); } else { //Cap nhat status = 0: cau hoi moi listQuestionBSO.UpdateQuestionStatus(strID, 0); //Gui mail den nhom support khi khach hang reply sendMailToGroup(listQuestion); //------------ Gui email thong bao den nhom nhom support cua tung san pham } Response.Redirect("~/Admin/listdetailquestion/" + HiddenField_QuestionID.Value.ToString() + "/Default.aspx"); } }
private ListQuestion 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); commonBSO commonBSO = new commonBSO(); string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Question/Images/"; string image_thumb = commonBSO.UploadImage(image_Attach, path_thumb, thumb_w, thumb_h); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Question/Files/"; string file_upload = commonBSO.UploadFile(file_Attach, path, 18000000000); ListQuestion listQuestion = new ListQuestion(); //Cau hoi moi: Co lay thong tin tu cau hoi parent listQuestion.Question_ParentID = Convert.ToInt32(Page.RouteData.Values["Id"]); listQuestion.CateNewsID = int.Parse(HiddenField_CateNewsID.Value.ToString()); listQuestion.Question_Title = "Trả lời: " + HiddenField_Question_Title.Value.ToString(); listQuestion.CreateDate = DateTime.Parse(HiddenField_CreateDate.Value.ToString()); listQuestion.CreateUserName = HiddenField_CreateUserName.Value.ToString(); //-------------Noi dung lay tu form listQuestion.Question_Content = txtRadShort.Html; listQuestion.Question_FileAttach = (file_upload != "") ? file_upload : HiddenField_FileAttach.Value; listQuestion.Question_Image = (image_thumb != "") ? image_thumb : HiddenField_ImageAttach.Value; listQuestion.IsApproval = false; //Chua duoc duyet listQuestion.ApprovalUserName = Session["Admin_UserName"].ToString(); listQuestion.QuestionStatus = 2; //Cau hoi da tra loi listQuestion.ApprovalDate = DateTime.Now; //Ngay phe duyet if (Page.RouteData.Values["Id"] != null) //Truong hop edit cau hoi, nhung thong tin duoc fix { //listQuestion.Question_ID = Id; //listQuestion.QuestionStatus = int.Parse(HiddenField_QuestionStatus.Value); //listQuestion.CreateDate = DateTime.Parse(HiddenField_CreateDate.Value); //listQuestion.CreateUserName = HiddenField_CreateUserName.Value; } return listQuestion; }
public MenuLinks ReceiveHtml() { MenuLinks menuLinks = new MenuLinks(); // string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Admin/Admin_Theme/Icons/"; string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/MenuLinks/"; commonBSO commonBSO = new commonBSO(); string icon_upload = commonBSO.UploadImage(uploadIcon, path, 80, 80); menuLinks.MenuLinksID = (txtMenuLinksID.Value != "") ? Convert.ToInt32(txtMenuLinksID.Value) : 0; menuLinks.MenuLinksName = (txtMenuLinksName.Text != "") ? txtMenuLinksName.Text.Trim() : ""; menuLinks.MenuLinksOrder = 0; menuLinks.MenuLinksParent = (ddlMenuLinks.SelectedValue != "") ? Convert.ToInt32(ddlMenuLinks.SelectedValue) : 0; menuLinks.MenuLinksUrl = (txtMenuLinksUrl.Text != "") ? txtMenuLinksUrl.Text.Trim() : ""; menuLinks.MenuLinksHelp = txtRadHelp.Html; menuLinks.MenuLinksIcon = (icon_upload != "") ? icon_upload : hddIcon.Value; menuLinks.Status = Convert.ToBoolean(rdbStatus.SelectedValue); menuLinks.IsView = Convert.ToBoolean(rdbIsView.SelectedValue); menuLinks.Target = ddlTarget.SelectedValue; return menuLinks; }
public Member ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int icon_w = Convert.ToInt32(config.New_icon_w); int icon_h = Convert.ToInt32(config.New_icon_h); SecurityBSO securityBSO = new SecurityBSO(); Member member = new Member(); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Avatar/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(txtAvatar, path, icon_w, icon_h); member.MemberID = (hddMemberID.Value != "") ? Convert.ToInt32(hddMemberID.Value) : 0; member.UserName = (txtUserName.Text != "") ? txtUserName.Text.Trim() : hddUsername.Value; member.Email = (txtEmail.Text != "") ? txtEmail.Text.Trim() : ""; member.Password = (txtPassword.Text != "") ? securityBSO.EncPwd(txtPassword.Text.Trim()) : ""; member.FullName = (txtFullName.Text != "") ? txtFullName.Text.Trim() : ""; member.Address = (txtAddress.Text != "") ? txtAddress.Text.Trim() : ""; member.Phone = (txtPhone.Text != "") ? txtPhone.Text.Trim() : ""; member.NickYahoo = (txtNickYahoo.Text != "") ? txtNickYahoo.Text.Trim() : ""; member.NickSkype = (txtNickSkype.Text != "") ? txtNickSkype.Text.Trim() : ""; member.Avatar = (image_thumb != "") ? image_thumb : hddImageThumb.Value; member.Sex = Convert.ToBoolean(rdbSex.SelectedItem.Value); member.Birth = txtBirth.SelectedDate.Value; member.Actived = Convert.ToBoolean(rdbList.SelectedItem.Value); return member; }
private ListQuestion ReceiveHtml_() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int thumb_w = Convert.ToInt32(config.New_large_w); int thumb_h = Convert.ToInt32(config.New_large_h); commonBSO commonBSO = new commonBSO(); string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Question/Images/"; string image_thumb = commonBSO.UploadImage(image_Attach, path_thumb, thumb_w, thumb_h); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Question/Files/"; string file_upload = commonBSO.UploadFile(file_Attach, path, 18000000000); ListQuestion listQuestion = new ListQuestion(); //Cau hoi moi listQuestion.CateNewsID = Convert.ToInt32(ddlCateNews.SelectedValue); listQuestion.Question_Title = txtTitle.Text.Trim(); listQuestion.Question_Content = txtRadShort.Html; listQuestion.CreateUserName = Session["Admin_UserName"].ToString(); listQuestion.Question_FileAttach = (file_upload != "") ? file_upload : HiddenField_FileAttach.Value; listQuestion.Question_Image = (image_thumb != "") ? image_thumb : HiddenField_ImageAttach.Value; listQuestion.CreateDate = DateTime.Now; listQuestion.IsApproval = false; //Chua duoc duyet listQuestion.ApprovalUserName = ""; listQuestion.QuestionStatus = 0; listQuestion.ApprovalDate = DateTime.Now; if (Page.RouteData.Values["Id"] != null) { listQuestion.Question_ID = Convert.ToInt32(HiddenField_QuestionID.Value); listQuestion.QuestionStatus = int.Parse(HiddenField_QuestionStatus.Value); listQuestion.CreateDate = DateTime.Parse(HiddenField_CreateDate.Value); listQuestion.CreateUserName = HiddenField_CreateUserName.Value; } return listQuestion; }
protected Pages 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); commonBSO commonBSO = new commonBSO(); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/BlogPage/"; string image = commonBSO.UploadImage(file_image_thumb, path, thumb_w, thumb_h); Pages pages = new Pages(); pages.PageID = (hddPageID.Value != "") ? Convert.ToInt32(hddPageID.Value) : 0; pages.PageName = (ddlPage.SelectedIndex != 0) ? ddlPage.SelectedValue.ToString() : txtPageName.Text; pages.Icon = rdbGroup.SelectedItem.Value; pages.PageTitle = (txtTitle.Text != "") ? txtTitle.Text : ""; pages.PageType = Convert.ToBoolean(rdbType1.SelectedValue); pages.Describe = txtRadshort.Html; pages.Imagethumb = (image != "") ? image : hddImage.Value; pages.PageContent = txtRad_full.Html; pages.PostDate = txtRadDate.SelectedDate.Value; pages.Author = txtAuthor.Text; pages.Status = Convert.ToBoolean(rdbActive.SelectedItem.Value); pages.IsView = Convert.ToBoolean(rdbIsView.SelectedItem.Value); pages.Language = Language.language; pages.IsComment = Convert.ToBoolean(rdbComment.SelectedValue); pages.VisitTotal = (hddVisitTotal.Value != "") ? Convert.ToInt32(hddVisitTotal.Value) : 0; pages.CommentTotal = (hddCommentTotal.Value != "") ? Convert.ToInt32(hddCommentTotal.Value) : 0; pages.CreatedUserName = (hddCreateUserName.Value != "") ? hddCreateUserName.Value : Session["Admin_UserName"].ToString(); pages.IsApproval = Convert.ToBoolean(rdbApproval.SelectedValue); if (hddApprovalUserName.Value != "") { pages.ApprovalUserName = hddApprovalUserName.Value; pages.ApprovalDate = Convert.ToDateTime(hddApprovalDate.Value); } else if (Convert.ToBoolean(rdbApproval.SelectedValue)) { pages.ApprovalUserName = Session["Admin_UserName"].ToString(); pages.ApprovalDate = DateTime.Now; } else { pages.ApprovalUserName = ""; pages.ApprovalDate = DateTime.Now; } return pages; }
private Album 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); string path_thumb = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Album/AlbumThumb/"; int large_w = Convert.ToInt32(config.New_large_w); int large_h = Convert.ToInt32(config.New_large_h); string path_large = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Album/AlbumLarge/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(file_image_large, path_thumb, thumb_w, thumb_h); string image_large = commonBSO.UploadImage(file_image_large, path_large, large_w, large_h); Album album = new Album(); album.AlbumID = (hddAlbumID.Value != "") ? Convert.ToInt32(hddAlbumID.Value) : 0; album.CateNewsID = (ddlCateNews.SelectedValue != "") ? Convert.ToInt32(ddlCateNews.SelectedValue) : 0; album.ImageThumb = (image_thumb != "") ? image_thumb : hddImageThumb.Value; album.ImageLarge = (image_large != "") ? image_large : hddImageLarge.Value; album.IsHome = Convert.ToBoolean(rdbIsHome.SelectedValue); album.Order = (hddOrder.Value != "") ? Convert.ToInt32(hddOrder.Value) : 0; return album; }
private CateNewsGroup ReceiveHtml() { string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "Upload/Category/Group/"; commonBSO commonBSO = new commonBSO(); string image_icon = commonBSO.UploadImage(icon, path, 55, 55); CateNewsGroup catenewsGroup = new CateNewsGroup(); catenewsGroup.CateNewsGroupID = (hddCateNewsGroupID.Value != "") ? Convert.ToInt32(hddCateNewsGroupID.Value) : 0; catenewsGroup.CateNewsGroupName = txtCateNewsGroupName.Text; catenewsGroup.GroupCate = (txtGroupCate.Text != "") ? Convert.ToInt32(txtGroupCate.Text) : 0; catenewsGroup.Order = (hddOrder.Value != "") ? Convert.ToInt32(hddOrder.Value) : 0; catenewsGroup.Description = txtDescription.Text; catenewsGroup.IsView = chkView.Checked; catenewsGroup.IsHome = chkHome.Checked; catenewsGroup.IsMenu = chkMenu.Checked; catenewsGroup.IsNew = chkNews.Checked; catenewsGroup.IsPage = chkPage.Checked; catenewsGroup.Language = NgonNgu.SelectedValue; catenewsGroup.Icon = (image_icon != "") ? image_icon : hddIcon.Value; catenewsGroup.IsUrl = Convert.ToBoolean(rdbUrl.SelectedValue); catenewsGroup.Url = txtUrl.Text; catenewsGroup.Position = (txtPosition.Text != "") ? Convert.ToInt32(txtPosition.Text) : 0; return catenewsGroup; }