| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739 |
- /*******************************************************************************
- * Copyright(c) 2015 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_P_00002.cs
- * 2.功能描述:成型结算信息表
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2017/01/11 1.00 新建
- *******************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Drawing;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseControls;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.Client.Controls;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- namespace Dongke.IBOSS.PRD.Client.Public
- {
- /// <summary>
- /// 成型结算信息表
- /// </summary>
- public partial class F_P_00002 : DKFormBase
- {
- #region 功能条码
- //public const string PreMonthCN = "#前月#";
- //public const string CurMonthCN = "#当月#";
- //public const string QUITCN = "#退出#";
- //public const string NextPageCN = "#下一页#";
- //public const string PrePageCN = "#上一页#";
- //public const string NextRowCN = "#下一行#";
- //public const string PreRowCN = "#上一行#";
- //public const string CurRowCN = "#当日#";
- //public const string Month00CN = "#合计#";
- public const string PreMonth = "#PREMONTH#";
- public const string CurMonth = "#CURMONTH#";
- public const string QUIT = "#QUIT#";
- public const string NextPage = "#NEXTPAGE#";
- public const string PrePage = "#PREPAGE#";
- public const string NextRow = "#NEXTROW#";
- public const string PreRow = "#PREROW#";
- public const string CurRow = "#CURROW#";
- public const string Month00 = "#00#";
- public const string Month01 = "#01#";
- public const string Month02 = "#02#";
- public const string Month03 = "#03#";
- public const string Month04 = "#04#";
- public const string Month05 = "#05#";
- public const string Month06 = "#06#";
- public const string Month07 = "#07#";
- public const string Month08 = "#08#";
- public const string Month09 = "#09#";
- public const string Month10 = "#10#";
- public const string Month11 = "#11#";
- public const string Month12 = "#12#";
- public const string Month13 = "#13#";
- public const string Month14 = "#14#";
- public const string Month15 = "#15#";
- public const string Month16 = "#16#";
- public const string Month17 = "#17#";
- public const string Month18 = "#18#";
- public const string Month19 = "#19#";
- public const string Month20 = "#20#";
- public const string Month21 = "#21#";
- public const string Month22 = "#22#";
- public const string Month23 = "#23#";
- public const string Month24 = "#24#";
- public const string Month25 = "#25#";
- public const string Month26 = "#26#";
- public const string Month27 = "#27#";
- public const string Month28 = "#28#";
- public const string Month29 = "#29#";
- public const string Month30 = "#30#";
- public const string Month31 = "#31#";
- #endregion
- #region 成员变量
- // 窗体的单例模式
- private static F_P_00002 _instance;
- private long _showLimitTime = 0;
- private long _LimitTime = 120;
- private F_P_000021 _frmUserCode = new F_P_000021();
- private bool _isLoading = false;
- private DataSet _dataSet = null;
- #endregion
- #region 构造函数
- public F_P_00002()
- {
- InitializeComponent();
- // 窗体显示的Title
- this.Text = "成型结算";
- this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
- this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
- this.lblUserCode.Text = null;
- this.dgv0.AutoGenerateColumns = false;
- this.dgv1.AutoGenerateColumns = false;
- this.dgv2.AutoGenerateColumns = false;
- this.dgv3.AutoGenerateColumns = false;
- this.dgv4.AutoGenerateColumns = false;
- this.dgvM.AutoGenerateColumns = false;
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- //this.tsbtnAdaptive_Click(null, null);
- }
- #endregion
- #region 单例模式
- /// <summary>
- /// 单例模式,防止重复创建窗体
- /// </summary>
- public static F_P_00002 Instance
- {
- get
- {
- if (_instance == null || _instance.IsDisposed)
- {
- _instance = new F_P_00002();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件处理
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_P_00002_Load(object sender, EventArgs e)
- {
- try
- {
- string showLimitTime = System.Configuration.ConfigurationManager.AppSettings["ShowLimitTime"];
- long time = 0;
- if (!long.TryParse(showLimitTime, out time))
- {
- _LimitTime = time;
- }
- //this.BindPage();
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- private void F_P_00002_Shown(object sender, EventArgs e)
- {
- this.ResetForm();
- }
- private void F_P_00002_FormClosed(object sender, FormClosedEventArgs e)
- {
- _instance = null;
- }
- private void tsbtnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void F_P_00002_SizeChanged(object sender, EventArgs e)
- {
- this.WindowState = FormWindowState.Maximized;
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- SetShowTime(this._showLimitTime);
- this._showLimitTime--;
- }
- private void btnResetForm_Click(object sender, EventArgs e)
- {
- this.ResetForm();
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 绑定下拉列表值
- /// </summary>
- /// <returns></returns>
- private void BindPage()
- {
- //绑定数据来源下拉列表
- //ServiceResultEntity sre = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
- //{
- // return PublicModuleProxy.Service.GetRptProcedureModule(F_P_00001.AccountID);
- //}));
- //this.dropRptProcedure.DataSource = sre.Data.Tables[Constant.INT_IS_ZERO];
- //this.dropRptProcedure.ValueMember = "Rptprocedureid";
- //this.dropRptProcedure.DisplayMember = "Rptprocedurename";
- }
- /// <summary>
- /// 根据界面查询条件获取数据集
- /// </summary>
- private ServiceResultEntity GetSearchData()
- {
- try
- {
- if (string.IsNullOrWhiteSpace(this._frmUserCode.UserCode))
- {
- return null;
- }
- //if (string.IsNullOrEmpty(this.dropRptProcedure.Text))
- //{
- // return null;
- //}
- ////se.RptProcedureID = Convert.ToInt32(this.dropRptProcedure.SelectedValue);
- //DataRowView drv = this.dropRptProcedure.SelectedItem as DataRowView;
- //int? pid = null;
- //if (drv != null)
- //{
- // pid = int.Parse(drv["SProcedureid"].ToString());
- //}
- //if (!pid.HasValue)
- //{
- // return null;
- //}
- string usercode = this._frmUserCode.UserCode;
- //DateTime selectDate = this._frmUserCode.DateStart;
- DateTime selectDate = this._frmUserCode.DateMonth;
- ServiceResultEntity sre = (ServiceResultEntity)DoAsync(() =>
- {
- return PublicModuleProxy.Service.GetFP00002Data(F_P_00001.AccountID,
- usercode, selectDate);
- });
- return sre;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- private void SetShowTime(long time)
- {
- if (time == 0)
- {
- this.ResetForm();
- return;
- }
- string t = time.ToString();
- int l = t.Length;
- if (l >= 3)
- {
- pic3.Image = GetTimePic(t[0]);
- pic2.Image = GetTimePic(t[1]);
- pic1.Image = GetTimePic(t[2]);
- }
- else if (l == 2)
- {
- pic3.Image = Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_0;
- pic2.Image = GetTimePic(t[0]);
- pic1.Image = GetTimePic(t[1]);
- }
- else if (l == 1)
- {
- pic3.Image = Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_0;
- pic2.Image = Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_0;
- pic1.Image = GetTimePic(t[0]);
- }
- }
- private Bitmap GetTimePic(char num)
- {
- switch (num)
- {
- case '0':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_0;
- case '1':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_1;
- case '2':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_2;
- case '3':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_3;
- case '4':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_4;
- case '5':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_5;
- case '6':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_6;
- case '7':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_7;
- case '8':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_8;
- case '9':
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_9;
- default:
- return Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_0;
- }
- }
- private void ClearGridData()
- {
- this._isLoading = true;
- try
- {
- this.lblUserCode.Text = null;
- //this.gb0.Text = "总体信息";
- this.gbm.Text = "月度信息【 】";
- this.gb1.Text = "成检缺陷明细【 】";
- this.gb2.Text = "后道损坯明细【 】";
- this.gb3.Text = "半检不合格明细【 】";
- this.gb4.Text = "返工(合格)明细【 】";
- this.dgvM.DataSource = null;
- this.dgv0.DataSource = null;
- this.dgv1.DataSource = null;
- this.dgv2.DataSource = null;
- this.dgv3.DataSource = null;
- this.dgv4.DataSource = null;
- this._dataSet = null;
- }
- finally
- {
- this._isLoading = false;
- }
- }
- private void AutoResizeColumns()
- {
- this.dgv0.AutoResizeColumns();
- this.dgv1.AutoResizeColumns();
- this.dgv2.AutoResizeColumns();
- this.dgv3.AutoResizeColumns();
- this.dgv4.AutoResizeColumns();
- this.dgvM.AutoResizeColumns();
- }
- private void ResetSearch()
- {
- timerShow.Stop();
- this.ClearGridData();
- this.AutoResizeColumns();
- pic3.Image = Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_0;
- pic2.Image = Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_0;
- pic1.Image = Dongke.IBOSS.PRD.Client.Public.Properties.Resources.num_0;
- }
- private void ResetForm()
- {
- this.ResetSearch();
- if (this._frmUserCode.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- this.SearchData();
- }
- else
- {
- this.Close();
- }
- }
- private void SearchData()
- {
- try
- {
- this.ResetSearch();
- if (F_P_00001.AutoUp())
- {
- return;
- }
- this.gb0.Text = string.Format("总体信息【{0}】", DateTime.Now.ToString("yyyy-MM-dd"));
- this.lblUserCode.Text = this._frmUserCode.UserCode;
-
- ServiceResultEntity sre = this.GetSearchData();
- if (sre == null)
- {
- this._frmUserCode.ErrorMessges = "没有查询到任何数据";
- this.ResetForm();
- return;
- }
- if (sre.Status == Constant.ServiceResultStatus.Other)
- {
- this._frmUserCode.ErrorMessges = sre.Message + "【" + this._frmUserCode.UserCode + "】";
- this.ResetForm();
- return;
- }
- this._dataSet = sre.Data;
- if (this._dataSet != null)
- {
- this._isLoading = true;
- this.dgvM.DataSource = this._dataSet.Tables["DataM"];
- this.dgv0.DataSource = this._dataSet.Tables["DataD"];
- this._isLoading = false;
- _currentRowIndex = -1;
- this.dgvM_SelectionChanged(null, null);
- }
- else
- {
- this.ResetForm();
- return;
- }
- this.AutoResizeColumns();
- this.txtKey.Focus();
- //string showLimitTime = System.Configuration.ConfigurationManager.AppSettings["ShowLimitTime"];
- //if (!long.TryParse(showLimitTime, out _showLimitTime))
- //{
- // _showLimitTime = 120;
- //}
- _showLimitTime = _LimitTime;
- //SetShowTime(_showLimitTime);
- timerShow.Start();
- }
- catch (Exception ex)
- {
- this._isLoading = false;
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- this.ResetForm();
- }
- finally
- {
- this._isLoading = false;
- }
- }
- #endregion
- private int _currentRowIndex = -1;
- private void dgvM_SelectionChanged(object sender, EventArgs e)
- {
- if (this._isLoading || this._dataSet == null || this.dgvM.Rows.Count <= 0 || this.dgvM.CurrentRow == null)
- {
- return;
- }
- if (_currentRowIndex == this.dgvM.CurrentRow.Index)
- {
- return;
- }
- try
- {
- _currentRowIndex = this.dgvM.CurrentRow.Index;
- DataRowView drv = this.dgvM.CurrentRow.DataBoundItem as DataRowView;
- if (drv == null)
- {
- return;
- }
- string cddate = drv["cdate"] + "";
- string rowFilter = null;
- this.gbm.Text = string.Format("月度信息【{0} {1}】", cddate, drv["goodscode"]);
- //this.gb1.Text = string.Format("成检缺陷明细【{0} {1}】", cddate, drv["goodscode"]);
- //this.gb2.Text = string.Format("后道损坯明细【{0} {1}】", cddate, drv["goodscode"]);
- //this.gb3.Text = string.Format("半检不合格明细【{0} {1}】", cddate, drv["goodscode"]);
- //this.gb4.Text = string.Format("返工(合格)明细【{0} {1}】", cddate, drv["goodscode"]);
- if (cddate == "合计")
- {
- rowFilter = string.Format("goodscode = '{0}'", drv["goodscode"]);
- }
- else
- {
- rowFilter = string.Format("goodscode = '{0}' and cdate = '{1}'", drv["goodscode"], cddate);
- }
- this.dgv1.DataSource = null;
- this.dgv2.DataSource = null;
- this.dgv3.DataSource = null;
- this.dgv4.DataSource = null;
- // 成检明细
- this._dataSet.Tables["DataCC"].DefaultView.RowFilter = rowFilter;
- // 后道损明细
- this._dataSet.Tables["DataNS"].DefaultView.RowFilter = rowFilter;
- // 半检不合格明细
- this._dataSet.Tables["DataSC"].DefaultView.RowFilter = rowFilter;
- // 返工合格明细
- this._dataSet.Tables["DataRC"].DefaultView.RowFilter = rowFilter;
- this.dgv1.DataSource = this._dataSet.Tables["DataCC"];
- this.dgv2.DataSource = this._dataSet.Tables["DataNS"];
- this.dgv3.DataSource = this._dataSet.Tables["DataSC"];
- this.dgv4.DataSource = this._dataSet.Tables["DataRC"];
- this.gb1.Text = string.Format("成检缺陷明细【{0} {1}】({2})", cddate, drv["goodscode"], this.dgv1.RowCount);
- this.gb2.Text = string.Format("后道损坯明细【{0} {1}】({2})", cddate, drv["goodscode"], this.dgv2.RowCount);
- this.gb3.Text = string.Format("半检不合格明细【{0} {1}】({2})", cddate, drv["goodscode"], this.dgv3.RowCount);
- this.gb4.Text = string.Format("返工(合格)明细【{0} {1}】({2})", cddate, drv["goodscode"], this.dgv4.RowCount);
- this.AutoResizeColumns();
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- private void F_P_00002_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- this.txtKey.Focus();
- }
- }
- private void txtKey_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- string text = this.txtKey.Text.Trim().ToUpper();
- this.txtKey.Clear();
- if (text.Length < 3 || !text.StartsWith("#") || !text.EndsWith("#"))
- {
- return;
- }
- if (QUIT == text)
- {
- this.btnResetForm_Click(null, null);
- return;
- }
- if (NextPage == text)
- {
- // 下一页
- int last = -1;
- if (this.dgv0.VerticalScrollBarVisible)
- {
- last = this.dgv0.FirstDisplayedScrollingRowIndex + this.dgv0.DisplayedRowCount(false);
- if (last < this.dgv0.RowCount)
- {
- this.dgv0.FirstDisplayedScrollingRowIndex = last;
- }
- }
- if (this.dgv1.VerticalScrollBarVisible)
- {
- last = this.dgv1.FirstDisplayedScrollingRowIndex + this.dgv1.DisplayedRowCount(false);
- if (last < this.dgv1.RowCount)
- {
- this.dgv1.FirstDisplayedScrollingRowIndex = last;
- }
- }
- if (this.dgv2.VerticalScrollBarVisible)
- {
- last = this.dgv2.FirstDisplayedScrollingRowIndex + this.dgv2.DisplayedRowCount(false);
- if (last < this.dgv2.RowCount)
- {
- this.dgv2.FirstDisplayedScrollingRowIndex = last;
- }
- }
- if (this.dgv3.VerticalScrollBarVisible)
- {
- last = this.dgv3.FirstDisplayedScrollingRowIndex + this.dgv3.DisplayedRowCount(false);
- if (last < this.dgv3.RowCount)
- {
- this.dgv3.FirstDisplayedScrollingRowIndex = last;
- }
- }
- if (this.dgv4.VerticalScrollBarVisible)
- {
- last = this.dgv4.FirstDisplayedScrollingRowIndex + this.dgv4.DisplayedRowCount(false);
- if (last < this.dgv4.RowCount)
- {
- this.dgv4.FirstDisplayedScrollingRowIndex = last;
- }
- }
- if (this.dgvM.VerticalScrollBarVisible)
- {
- last = this.dgvM.FirstDisplayedScrollingRowIndex + this.dgvM.DisplayedRowCount(false);
- if (last < this.dgvM.RowCount)
- {
- this.dgvM.FirstDisplayedScrollingRowIndex = last;
- }
- }
- }
- else if (PrePage == text)
- {
- // 上一页
- int last = this.dgv0.FirstDisplayedScrollingRowIndex;
- if (last > 0)
- {
- last = last - this.dgv0.DisplayedRowCount(false);
- if (last < 0)
- {
- last = 0;
- }
- this.dgv0.FirstDisplayedScrollingRowIndex = last;
- }
- last = this.dgv1.FirstDisplayedScrollingRowIndex;
- if (last > 0)
- {
- last = last - this.dgv1.DisplayedRowCount(false);
- if (last < 0)
- {
- last = 0;
- }
- this.dgv1.FirstDisplayedScrollingRowIndex = last;
- }
- last = this.dgv2.FirstDisplayedScrollingRowIndex;
- if (last > 0)
- {
- last = last - this.dgv2.DisplayedRowCount(false);
- if (last < 0)
- {
- last = 0;
- }
- this.dgv2.FirstDisplayedScrollingRowIndex = last;
- }
- last = this.dgv3.FirstDisplayedScrollingRowIndex;
- if (last > 0)
- {
- last = last - this.dgv3.DisplayedRowCount(false);
- if (last < 0)
- {
- last = 0;
- }
- this.dgv3.FirstDisplayedScrollingRowIndex = last;
- }
- last = this.dgv4.FirstDisplayedScrollingRowIndex;
- if (last > 0)
- {
- last = last - this.dgv4.DisplayedRowCount(false);
- if (last < 0)
- {
- last = 0;
- }
- this.dgv4.FirstDisplayedScrollingRowIndex = last;
- }
- last = this.dgvM.FirstDisplayedScrollingRowIndex;
- if (last > 0)
- {
- last = last - this.dgvM.DisplayedRowCount(false);
- if (last < 0)
- {
- last = 0;
- }
- this.dgvM.FirstDisplayedScrollingRowIndex = last;
- }
- }
- else if (this.dgvM.RowCount > 0)
- {
- if (PreRow == text)
- {
- // 上一条
- int index = this._currentRowIndex - 1;
- if (index < 0)
- {
- index = this.dgvM.RowCount - 1;
- }
- this.dgvM.CurrentCell = this.dgvM.Rows[index].Cells["gmcdate"];
- this.dgvM_SelectionChanged(null, null);
- }
- else if (NextRow == text)
- {
- // 下一条
- int index = this._currentRowIndex + 1;
- if (index >= this.dgvM.RowCount)
- {
- index = 0;
- }
- this.dgvM.CurrentCell = this.dgvM.Rows[index].Cells["gmcdate"];
- this.dgvM_SelectionChanged(null, null);
- }
- else
- {
- string monthFlag = null;
- if (CurRow == text)
- {
- // 当前日期
- foreach (DataGridViewRow item in this.dgvM.Rows)
- {
- if ((item.Cells["gmcdate"].Value + "") != "合计")
- {
- monthFlag = (item.Cells["gmcdate"].Value + "");
- //this.dgvM.CurrentCell = item.Cells["gmcdate"];
- //this.dgvM_SelectionChanged(null, null);
- //this._currentRowIndex = item.Index;
- break;
- }
- }
- }
- else
- {
- monthFlag = text.Replace("#", "");
- }
- if (monthFlag == "00")
- {
- monthFlag = "合计";
- }
- int firstIndex = -1;
- foreach (DataGridViewRow item in this.dgvM.Rows)
- {
- if ((item.Cells["gmcdate"].Value + "").EndsWith(monthFlag))
- {
- if (firstIndex == -1)
- {
- firstIndex = item.Index;
- }
- if (this._currentRowIndex < item.Index)
- {
- this.dgvM.CurrentCell = item.Cells["gmcdate"];
- this.dgvM_SelectionChanged(null, null);
- //this._currentRowIndex = item.Index;
- break;
- }
- }
- else
- {
- if (firstIndex > -1)
- {
- this.dgvM.CurrentCell = this.dgvM.Rows[firstIndex].Cells["gmcdate"];
- this.dgvM_SelectionChanged(null, null);
- //this._currentRowIndex = firstIndex;
- break;
- }
- }
- }
- if (firstIndex == -1)
- {
- //this.dgvM.CurrentCell = this.dgvM.Rows[this.dgvM.RowCount - 1].Cells["gmcdate"];
- this.dgvM.CurrentCell = this.dgvM.Rows[0].Cells["gmcdate"];
- this.dgvM_SelectionChanged(null, null);
- }
- }
- }
- }
- }
- }
- }
|