管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-01-11 e47a565b1e34370cd9402b88fc64cdde9ad4a019
1.JiangSu:添加删除全部接口
2.TEWin: 添加测试单元
已修改9个文件
93 ■■■■■ 文件已修改
JiangSu/Controllers/GridController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiangSu/Controllers/ImgController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiangSu/Controllers/OpController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiangSu/cs/GridDAL.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiangSu/cs/ImgDAL.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiangSu/cs/ModelDAL.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiangSu/cs/SQLiteHelper.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/FrmTool.Designer.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/FrmTool.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiangSu/Controllers/GridController.cs
@@ -97,6 +97,20 @@
            }
        }
        [HttpGet]
        public int DelAll()
        {
            try
            {
                return GridDAL.DelAll();
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return 0;
            }
        }
        [HttpPost]
        public int Insert([FromBody] Grid grid)
        {
JiangSu/Controllers/ImgController.cs
@@ -63,6 +63,20 @@
            }
        }
        [HttpGet]
        public int DelAll()
        {
            try
            {
                return ImgDAL.DelAll();
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return 0;
            }
        }
        [HttpPost]
        public int Insert([FromBody] Img img)
        {
JiangSu/Controllers/OpController.cs
@@ -55,6 +55,20 @@
            }
        }
        [HttpGet]
        public int DelAll()
        {
            try
            {
                return ModelDAL.DelAll();
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                return 0;
            }
        }
        [HttpPost]
        public int Insert([FromBody] Model model)
        {
JiangSu/cs/GridDAL.cs
@@ -51,6 +51,11 @@
            return SQLiteHelper.ExecuteNonQuery(sql);
        }
        public static int DelAll()
        {
            return SQLiteHelper.ExecuteNonQuery("delete from grid");
        }
        public static int Insert(Grid grid)
        {
            string sql = "insert into grid (json) values (@json); select last_insert_rowid();";
JiangSu/cs/ImgDAL.cs
@@ -54,6 +54,11 @@
            return SQLiteHelper.ExecuteNonQuery(sql);
        }
        public static int DelAll()
        {
            return SQLiteHelper.ExecuteNonQuery("delete from img");
        }
        public static int Insert(Img img)
        {
            string sql = "insert into img (name, path, json, x, y, z) values (@name, @path, @json, @x, @y, @z); select last_insert_rowid();";
JiangSu/cs/ModelDAL.cs
@@ -53,6 +53,11 @@
            return SQLiteHelper.ExecuteNonQuery(sql);
        }
        public static int DelAll()
        {
            return SQLiteHelper.ExecuteNonQuery("delete from model");
        }
        public static int Insert(Model model)
        {
            string sql = "insert into model (name, json) values (@name, @json); select last_insert_rowid();";
JiangSu/cs/SQLiteHelper.cs
@@ -102,7 +102,7 @@
        {
            using (SQLiteConnection conn = new SQLiteConnection(ConnectionString))
            {
                LoadDrivers(conn);
                //LoadDrivers(conn);
                using (SQLiteCommand cmd = new SQLiteCommand(cmdText, conn))
                {
TEWin/FrmTool.Designer.cs
@@ -30,14 +30,15 @@
        {
            this.txtCode = new System.Windows.Forms.TextBox();
            this.btnTest = new System.Windows.Forms.Button();
            this.cbCode = new System.Windows.Forms.ComboBox();
            this.SuspendLayout();
            // 
            // txtCode
            // 
            this.txtCode.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txtCode.Location = new System.Drawing.Point(13, 32);
            this.txtCode.Location = new System.Drawing.Point(244, 32);
            this.txtCode.Name = "txtCode";
            this.txtCode.Size = new System.Drawing.Size(391, 26);
            this.txtCode.Size = new System.Drawing.Size(160, 26);
            this.txtCode.TabIndex = 1;
            this.txtCode.Text = "0xc0";
            // 
@@ -52,11 +53,21 @@
            this.btnTest.UseVisualStyleBackColor = true;
            this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
            // 
            // cbCode
            //
            this.cbCode.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.cbCode.FormattingEnabled = true;
            this.cbCode.Location = new System.Drawing.Point(23, 34);
            this.cbCode.Name = "cbCode";
            this.cbCode.Size = new System.Drawing.Size(198, 24);
            this.cbCode.TabIndex = 2;
            //
            // FrmTool
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(504, 89);
            this.Controls.Add(this.cbCode);
            this.Controls.Add(this.btnTest);
            this.Controls.Add(this.txtCode);
            this.Name = "FrmTool";
@@ -71,5 +82,6 @@
        private System.Windows.Forms.TextBox txtCode;
        private System.Windows.Forms.Button btnTest;
        private System.Windows.Forms.ComboBox cbCode;
    }
}
TEWin/FrmTool.cs
@@ -13,10 +13,28 @@
    {
        FrmWin win;
        List<string> codes = new List<string> { "重置鼠标", "打开方案", "保存方案", "矢量数据", "影像数据", "地形数据", "模型数据(osgb)", "模型数据(obj)", "编辑对象", "点量算", "坡向分析", "线量算", "面量算", "体量算", "角量算", "空间统计", "空间分析", "剖面分析", "坡度分析", "等值线", "剖面分析", "地理场景产品组装", "传统4D产品派生", "打开fly" };
        public FrmTool(FrmWin win)
        {
            this.win = win;
            InitializeComponent();
            this.Load += FrmTool_Load;
        }
        void FrmTool_Load(object sender, EventArgs e)
        {
            cbCode.DataSource = codes;
            cbCode.SelectedIndex = 0;
            this.cbCode.SelectedIndexChanged += cbCode_SelectedIndexChanged;
        }
        private void cbCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cb = sender as ComboBox;
            int idx = cb.SelectedIndex;
            this.txtCode.Text = "0x" + (0xc0 + idx).ToString("X").ToLower();
        }
        private void btnTest_Click(object sender, EventArgs e)