Browse Source

处理样品测量信息界面的若干bug

CXS 4 years ago
parent
commit
3391b02fef

+ 55 - 6
OTSIncAReportApp/Control_Grids/ParticlesGridDevidePage.cs

@@ -127,10 +127,7 @@ namespace OTSIncAReportGrids
         {
             get
             {
-                if (pageSize != 0)
-                {
-                    pageCount = GetPageCount();
-                }
+                pageCount = GetPageCount();
                 return pageCount;
             }
         }
@@ -796,7 +793,7 @@ namespace OTSIncAReportGrids
 
             ParticleData fielddata = new ParticleData(result.FilePath);
             DataTable particles = fielddata.GetInfoForPartucleDevidePage(PageIndex, pageSize, OrderFunction, condition);
-            PageSize = particles.Rows.Count;
+            //PageSize = particles.Rows.Count;
             if (particles == null)
             {
                 return;
@@ -1605,6 +1602,43 @@ namespace OTSIncAReportGrids
 
             //ls_bpex.Save("e:\\test222.jpg");
         }
+        /// <summary>
+        /// 判断条件输入 前<后
+        /// </summary>
+        /// <param name="min"></param>
+        /// <param name="max"></param>
+        /// <returns></returns>
+        bool CompareInput(string min,string max)
+        {
+            int imax = 0;
+            int imin = 0;
+            double dmax = 0;
+            double dmin = 0;
+            if (int.TryParse(max, out imax))
+            {
+                dmax = (double)imax;
+            }
+            else
+            {
+                dmax = Convert.ToDouble(max);
+            }
+            if (int.TryParse(min, out imin))
+            {
+                dmin = (double)imin;
+            }
+            else
+            {
+                dmin = Convert.ToInt32(min);
+            }
+            if(dmin<=dmax)
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
 
         private void btn_Sel_Click(object sender, EventArgs e)
         {
@@ -1647,6 +1681,13 @@ namespace OTSIncAReportGrids
                 }
             }
 
+            if(!CompareInput(tBx_AreaMin.Text, Tbx_AreaMax.Text))
+            {
+                MessageBox.Show(table["str11"].ToString());
+                return;
+            }
+            
+
             if (!string.IsNullOrWhiteSpace(tbx_DmaxMin.Text))
             {
                 double dnum = 0;
@@ -1685,10 +1726,17 @@ namespace OTSIncAReportGrids
                 }
             }
 
+            if (!CompareInput(tbx_DmaxMin.Text, tbx_DmaxMax.Text))
+            {
+                MessageBox.Show(table["str11"].ToString());
+                return;
+            }
+
             if (!string.IsNullOrWhiteSpace(tbx_Type.Text))
             {
                 condition += " and TypeName Like \"%" + tbx_Type.Text + "%\" ";
             }
+
             lnkFirst_Click(null, null);
             SetDataGridViewStyle();
         }
@@ -1736,7 +1784,7 @@ namespace OTSIncAReportGrids
             txtPageNum.Text = PageIndex.ToString();
 
             SetFormCtrEnabled();
-            if (PageCount == 1)//有且仅有一页
+            if (PageCount == 0 || PageCount == 1)//有且仅有一页
             {
                 lnkFirst.Enabled = false;
                 lnkPrev.Enabled = false;
@@ -1754,6 +1802,7 @@ namespace OTSIncAReportGrids
                 lnkNext.Enabled = false;
                 lnkLast.Enabled = false;
             }
+            
         }
         private void SetFormCtrEnabled()
         {

+ 22 - 9
OTSIncAReportApp/OTSMgrInfo/frmPartSizeEditorNew.cs

@@ -59,18 +59,31 @@ namespace OTSIncAReportApp
 
             //绑定GridView
             BindGridView();
+
+            Init();
         }
 
-        #endregion
+        void Init()
+        {
+            if (Gview_LJ.RowCount >= 0)
+            {
+                str_selectID = Gview_LJ.Rows[0].Cells[0].Value.ToString();
+                tb_lj.Text = Gview_LJ.Rows[0].Cells[1].Value.ToString();//路径
+                tb_ljm.Text = Gview_LJ.Rows[0].Cells[3].Value.ToString();//粒级名
+                tb_ljz.Text = Gview_LJ.Rows[0].Cells[4].Value.ToString();//粒级值
 
-        #region 自定义方法
-        /// <summary>
-        /// 提供编号列名,获取DataTable中,编号列自增长后的ID标识
-        /// </summary>
-        /// <param name="dt"></param>
-        /// <param name="col_name"></param>
-        /// <returns></returns>
-        public int Get_MaxBH(DataTable dt, string col_name)
+            }
+        }
+            #endregion
+
+            #region 自定义方法
+            /// <summary>
+            /// 提供编号列名,获取DataTable中,编号列自增长后的ID标识
+            /// </summary>
+            /// <param name="dt"></param>
+            /// <param name="col_name"></param>
+            /// <returns></returns>
+            public int Get_MaxBH(DataTable dt, string col_name)
         {
             int rownumber = 0;
             if (dt.Rows.Count == 0)