| | |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Net; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace Gs.DevApp.DevFrm.Sys |
| | |
| | | e.Graphics.DrawString(str, f, Brushes.Gray, r); |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 查询事件 |
| | | /// </summary> |
| | |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) |
| | | { |
| | | getPageList(1, UtilityHelper.GetPageSize()); |
| | | getPageList(1, UtilityHelper.GetPageSize()); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | private void getPageList(int curPage, int pageSize) |
| | | { |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | _sbSqlWhere.Append(" and a.CATEGORY=1 and a.UP_GUID is not null"); |
| | | PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "a.idx", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | | { |
| | | string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json); |
| | | string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPageHelp", json); |
| | | ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn); |
| | | if (dd.rtnCode > 0) |
| | | { |
| | |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void repositoryItemButtonEdit3_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gridView1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | var dr = gridView1.GetDataRow(rowhandle); |
| | | var mxGuid = dr["guid"].ToString(); |
| | | Gs.DevApp.UserControl.ShowUp frm = new Gs.DevApp.UserControl.ShowUp(mxGuid); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation("上传成功!"); |
| | | getPageList(1, UtilityHelper.GetPageSize()); |
| | | }; |
| | | frm.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gridView1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | try |
| | | { |
| | | var dr = gridView1.GetDataRow(rowhandle); |
| | | var urlPath = dr["urlPath"].ToString(); |
| | | Gs.DevApp.UserControl.ShowFile frm = new ShowFile(urlPath); |
| | | frm.ShowDialog(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | | { |
| | | var rowhandle = gridView1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | try |
| | | { |
| | | var dr = gridView1.GetDataRow(rowhandle); |
| | | var urlPath = dr["urlPath"].ToString(); |
| | | using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | { |
| | | folderBrowserDialog.Description = "选择导出文件的保存路径"; |
| | | DialogResult dialogResult = folderBrowserDialog.ShowDialog(); |
| | | if (dialogResult == DialogResult.OK) |
| | | { |
| | | string _folder = folderBrowserDialog.SelectedPath; |
| | | string _folderName = _folder + "\\" + urlPath; |
| | | string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + "upload/" + urlPath; |
| | | using (WebClient client = new WebClient()) |
| | | { |
| | | client.DownloadFile(_url, _folderName); |
| | | } |
| | | ToolBox.MsgHelper.ShowInformation("下载成功!"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |