public void _SetForm() { if (Code > 0) { //ArchiveCode DataTable Dt = WebClassLibrary.JWebDataBase.GetDataTable(@"select * from [EntPicGalleryLvl1] where Code = " + Code); if (Dt != null) { if (Dt.Rows.Count > 0) { txtTitle.Text = Dt.Rows[0]["Name"].ToString(); ArchivedDocuments.JArchiveDocument archive = new ArchivedDocuments.JArchiveDocument(ArchivedDocuments.JConstantArchiveSubjects.ImagesArchiveCode.GetHashCode(), ArchivedDocuments.JConstantArchivePalces.GeneralArchive.GetHashCode()); archive.GetData(Convert.ToInt32(Dt.Rows[0]["ArchiveCode"].ToString())); try { DataTable DtA = archive.Retrieve("AndroidElahiye", 123456); if (DtA.Rows.Count > 0) { ClassLibrary.JFile image = archive._RetrieveContent(Convert.ToInt32(archive.ArchiveCode)); PicStr = "<img src='data:image/jpg;base64," + Convert.ToBase64String(WebClassLibrary.JDataManager.ReadToEnd(image.Stream)) + "' style='max-width:500px'/>"; } } catch { } } } } }
public bool Save() { Entertainment.JNews News = new Entertainment.JNews(); News.GetData(Code); News.Code = Code; News.Title = txtTitle.Text; News.Body = txtBody.Text; if (Code > 0) { News.Date = News.Date; } else { News.Date = DateTime.Now; } if (FileUpload.HasFile) { int ArchiveCode = 0; string[] segments = FileUpload.FileName.Split(new char[] { '.' }); string fileExt = segments[segments.Length - 1]; ArchivedDocuments.JArchiveDocument archive = new ArchivedDocuments.JArchiveDocument(ArchivedDocuments.JConstantArchiveSubjects.ImagesArchiveCode.GetHashCode(), ArchivedDocuments.JConstantArchivePalces.GeneralArchive.GetHashCode()); ClassLibrary.JFile jFile = new ClassLibrary.JFile(); jFile.Content = FileUpload.FileBytes; jFile.FileName = FileUpload.FileName; jFile.Extension = ".jpg"; jFile.FileText = jFile.FileName; ArchiveCode = archive.ArchiveDocument(jFile, "AndroidElahiye", WebClassLibrary.SessionManager.Current.MainFrame.CurrentUserCode, "EntNewsPic", true); News.ArchiveCode = ArchiveCode; } if (Code > 0) { return(News.Update()); } else { return(News.Insert() > 0 ? true : false); } }
public bool Save() { ClassLibrary.JDataBase Db = new ClassLibrary.JDataBase(); int CuArchiveCode = 0; if (FileUpload.HasFile) { int ArchiveCode = 0; string[] segments = FileUpload.FileName.Split(new char[] { '.' }); string fileExt = segments[segments.Length - 1]; ArchivedDocuments.JArchiveDocument archive = new ArchivedDocuments.JArchiveDocument(ArchivedDocuments.JConstantArchiveSubjects.ImagesArchiveCode.GetHashCode(), ArchivedDocuments.JConstantArchivePalces.GeneralArchive.GetHashCode()); ClassLibrary.JFile jFile = new ClassLibrary.JFile(); jFile.Content = FileUpload.FileBytes; jFile.FileName = FileUpload.FileName; jFile.Extension = ".jpg"; jFile.FileText = jFile.FileName; ArchiveCode = archive.ArchiveDocument(jFile, "AndroidElahiye", WebClassLibrary.SessionManager.Current.MainFrame.CurrentUserCode, "EntPicGalleryLvl1", true); CuArchiveCode = ArchiveCode; } if (Code > 0) { Db.setQuery(@"update EntPicGalleryLvl1 set Name = N'" + txtTitle.Text + "' ,ArchiveCode=" + CuArchiveCode + " where Code = " + Code); } else { Db.setQuery(@"INSERT INTO [EntPicGalleryLvl1] ([Name],[ArchiveCode]) VALUES (N'" + txtTitle.Text + @"'," + CuArchiveCode.ToString() + ") "); } if (Db.Query_Execute() >= 0) { return(true); } else { return(false); } }
public void _SetForm() { if (Code > 0) { System.Data.DataTable Dt = WebClassLibrary.JWebDataBase.GetDataTable(@"SELECT [Code] ,[ProjectName] ,[Metraj] ,[TedadeVahed] ,[TedadKhab] ,[ShomareVahed] ,[Tabaghe] ,[Emkanat] ,[Gheymat],ArchiveCode FROM [dbo].[Android_Apartments] where Code = " + Code); if (Dt != null) { if (Dt.Rows.Count > 0) { txtEmkanat.Text = Dt.Rows[0]["Emkanat"].ToString(); txtGheymat.Text = Dt.Rows[0]["Gheymat"].ToString(); txtMetraj.Text = Dt.Rows[0]["Metraj"].ToString(); txtShomareVahed.Text = Dt.Rows[0]["ShomareVahed"].ToString(); txtTabaghe.Text = Dt.Rows[0]["Tabaghe"].ToString(); txtTedadKhab.Text = Dt.Rows[0]["TedadKhab"].ToString(); txtTedadVahed.Text = Dt.Rows[0]["TedadeVahed"].ToString(); txtTitle.Text = Dt.Rows[0]["ProjectName"].ToString(); ArchivedDocuments.JArchiveDocument archive = new ArchivedDocuments.JArchiveDocument(ArchivedDocuments.JConstantArchiveSubjects.ImagesArchiveCode.GetHashCode(), ArchivedDocuments.JConstantArchivePalces.GeneralArchive.GetHashCode()); archive.GetData(Convert.ToInt32(Dt.Rows[0]["ArchiveCode"].ToString())); try { System.Data.DataTable DtA = archive.Retrieve("AndroidElahiye", 123456); if (DtA.Rows.Count > 0) { ClassLibrary.JFile image = archive._RetrieveContent(Convert.ToInt32(archive.ArchiveCode)); PicStr = "<img src='data:image/jpg;base64," + Convert.ToBase64String(WebClassLibrary.JDataManager.ReadToEnd(image.Stream)) + "' style='max-width:500px'/>"; } } catch { } } } } }
public void _SetForm() { if (Code > 0) { Entertainment.JAboutUs AboutUs = new Entertainment.JAboutUs(); AboutUs.GetData(Code); txtText.Text = AboutUs.Text; ArchivedDocuments.JArchiveDocument archive = new ArchivedDocuments.JArchiveDocument(ArchivedDocuments.JConstantArchiveSubjects.ImagesArchiveCode.GetHashCode(), ArchivedDocuments.JConstantArchivePalces.GeneralArchive.GetHashCode()); archive.GetData(AboutUs.ArchiveCode); try { DataTable Dt = archive.Retrieve("AndroidElahiye", 123456); if (Dt.Rows.Count > 0) { ClassLibrary.JFile image = archive._RetrieveContent(Convert.ToInt32(archive.ArchiveCode)); PicStr = "<img src='data:image/jpg;base64," + Convert.ToBase64String(WebClassLibrary.JDataManager.ReadToEnd(image.Stream)) + "' style='max-width:500px'/>"; } } catch { } } }
public bool Save() { if (FileUpload.HasFile) { Entertainment.JPicGallery PicGallery = new Entertainment.JPicGallery(); PicGallery.Code = Code; PicGallery.Text = txtText.Text; PicGallery.ClassName = "AndroidElahiye"; int ArchiveCode = 0; string[] segments = FileUpload.FileName.Split(new char[] { '.' }); string fileExt = segments[segments.Length - 1]; ArchivedDocuments.JArchiveDocument archive = new ArchivedDocuments.JArchiveDocument(ArchivedDocuments.JConstantArchiveSubjects.ImagesArchiveCode.GetHashCode(), ArchivedDocuments.JConstantArchivePalces.GeneralArchive.GetHashCode()); ClassLibrary.JFile jFile = new ClassLibrary.JFile(); jFile.Content = FileUpload.FileBytes; jFile.FileName = FileUpload.FileName; jFile.Extension = ".jpg"; jFile.FileText = jFile.FileName; ArchiveCode = archive.ArchiveDocument(jFile, "AndroidElahiye", 123456, "EntPicGalleryPic", true); PicGallery.ArchiveCode = ArchiveCode; if (Code > 0) { return(PicGallery.Update()); } else { return(PicGallery.Insert() > 0 ? true : false); } } else { return(false); } }
public bool Save() { ClassLibrary.JDataBase Db = new ClassLibrary.JDataBase(); int CuArchiveCode = 0; if (FileUpload.HasFile) { int ArchiveCode = 0; string[] segments = FileUpload.FileName.Split(new char[] { '.' }); string fileExt = segments[segments.Length - 1]; ArchivedDocuments.JArchiveDocument archive = new ArchivedDocuments.JArchiveDocument(ArchivedDocuments.JConstantArchiveSubjects.ImagesArchiveCode.GetHashCode(), ArchivedDocuments.JConstantArchivePalces.GeneralArchive.GetHashCode()); ClassLibrary.JFile jFile = new ClassLibrary.JFile(); jFile.Content = FileUpload.FileBytes; jFile.FileName = FileUpload.FileName; jFile.Extension = ".jpg"; jFile.FileText = jFile.FileName; ArchiveCode = archive.ArchiveDocument(jFile, "AndroidElahiye", WebClassLibrary.SessionManager.Current.MainFrame.CurrentUserCode, "EntProjects", true); CuArchiveCode = ArchiveCode; } if (Code > 0) { Db.setQuery(@"Update [dbo].[Android_Apartments] Set [ProjectName] = N'" + txtTitle.Text + @"' , [Metraj] = N'" + txtMetraj.Text + @"' , [TedadeVahed] = N'" + txtTedadVahed.Text + @"' , [TedadKhab] = N'" + txtTedadKhab.Text + @"' , [ShomareVahed] = N'" + txtShomareVahed.Text + @"' , [Tabaghe] = N'" + txtTabaghe.Text + @"' , [Emkanat] = N'" + txtEmkanat.Text + @"' , [Gheymat] = N'" + txtGheymat.Text + @"' ,ArchiveCode=" + CuArchiveCode + @" where Code = " + Code); } else { Db.setQuery(@"INSERT INTO [dbo].[Android_Apartments] ([ProjectName] ,[Metraj] ,[TedadeVahed] ,[TedadKhab] ,[ShomareVahed] ,[Tabaghe] ,[Emkanat] ,[Gheymat],ArchiveCode) VALUES (N'" + txtTitle.Text + @"' ,N'" + txtMetraj.Text + @"' ,N'" + txtTedadVahed.Text + @"' ,N'" + txtTedadKhab.Text + @"' ,N'" + txtShomareVahed.Text + @"' ,N'" + txtTabaghe.Text + @"' ,N'" + txtEmkanat.Text + @"' ,N'" + txtGheymat.Text + @"'," + CuArchiveCode + @")"); } if (Db.Query_Execute() >= 0) { return(true); } else { return(false); } }