zoukankan      html  css  js  c++  java
  • Grid的check

    private bool CheckInputOfEdit1()
    {
    // 開始ログを出力する
    GetLogger().LogMethodBegin("OS0304.CheckInputOfEdit");

    //背景色設定
    this.inputColorCheck();

    foreach (DataGridViewRow row in this.dgvD_Haisya.Rows)
    {

    // 受入日

    if (null == row.Cells["dgvc_UKEDATE"].Value
    || ValidationUtil.IsEmpty(row.Cells["dgvc_UKEDATE"].Value.ToString()))
    {
    this.dgvD_Haisya.SelectionChanged -= new System.EventHandler(this.dgvD_Haisya_SelectionChanged);
    row.Selected = true;
    this.dgvD_Haisya.SelectionChanged += new System.EventHandler(this.dgvD_Haisya_SelectionChanged);

    FormControlUtil.SetControlBackColor(this.dtpS_UKE_DATE, false);
    ShowMsgById(MessageIdDef.COM_00010, "受入日");
    this.ActiveControl = this.dtpS_UKE_DATE;

    // 終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }

    //事業所コード

    if (null == row.Cells["dgvc_JIGYOUSYOCD"].Value
    || ValidationUtil.IsEmpty(row.Cells["dgvc_JIGYOUSYOCD"].Value.ToString()))
    {
    row.Selected = true;
    FormControlUtil.SetControlBackColor(this.cmbS_JIGYOUSYO_CD, false);
    ShowMsgById(MessageIdDef.COM_00010, "事業所");
    this.ActiveControl = this.cmbS_JIGYOUSYO_CD;

    //終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }

    //取引先(バイオマス業者)

    if (null == row.Cells["dgvC_TORIHIKISAKIRK"].Value
    || ValidationUtil.IsEmpty(row.Cells["dgvC_TORIHIKISAKIRK"].Value.ToString()))
    {
    row.Selected = true;
    FormControlUtil.SetControlBackColor(this.cmbE_TORIHIKISAKI_BIO_CD, false);
    ShowMsgById(MessageIdDef.COM_00010, "取引先(バイオマス業者)");
    this.ActiveControl = this.cmbE_TORIHIKISAKI_BIO_CD;

    //終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }

    //時間帯

    if (null == row.Cells["dgvC_JIKANTAI"].Value
    || ValidationUtil.IsEmpty(row.Cells["dgvC_JIKANTAI"].Value.ToString()))
    {
    row.Selected = true;
    FormControlUtil.SetControlBackColor(this.decE_JIKAN_TAI, false);
    ShowMsgById(MessageIdDef.COM_00010, "時間帯");
    this.ActiveControl = this.decE_JIKAN_TAI;

    //終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }

    // 時間帯半角数字チェック

    if (null != row.Cells["dgvC_JIKANTAI"].Value
    && !ValidationUtil.IsEmpty(row.Cells["dgvC_JIKANTAI"].Value.ToString())
    && !ValidationUtil.IsNumbericFormat(row.Cells["dgvC_JIKANTAI"].Value.ToString(), 2, 1))
    {
    row.Selected = true;
    FormControlUtil.SetControlBackColor(this.decE_JIKAN_TAI, false);
    ShowMsgById(MessageIdDef.COM_00030, "時間帯", "半角数字");
    this.ActiveControl = this.decE_JIKAN_TAI;

    //終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }

    // 時間帯 範囲チェック

    if (null != row.Cells["dgvC_JIKANTAI"].Value
    && !ValidationUtil.IsEmpty(this.decE_JIKAN_TAI.Text)
    && (Convert.ToDecimal(this.decE_JIKAN_TAI.Text) < 0
    || Convert.ToDecimal(this.decE_JIKAN_TAI.Text) > 23))
    {
    row.Selected = true;
    FormControlUtil.SetControlBackColor(this.decE_JIKAN_TAI, false);
    ShowMsgById(MessageIdDef.COM_00050, "時間帯", "0", "23");
    this.ActiveControl = this.decE_JIKAN_TAI;

    // 終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }

    // 数量
    if (null == row.Cells["dgvC_SURYO"].Value
    || ValidationUtil.IsEmpty(row.Cells["dgvC_SURYO"].Value.ToString()))
    {
    row.Selected = true;
    FormControlUtil.SetControlBackColor(this.decE_SURYO, false);
    ShowMsgById(MessageIdDef.COM_00010, "数量");
    this.ActiveControl = this.decE_SURYO;

    // 終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }

    //数量(t) 半角数字チェック

    if (null != row.Cells["dgvC_SURYO"].Value
    && !ValidationUtil.IsEmpty(row.Cells["dgvC_SURYO"].Value.ToString())
    && !ValidationUtil.IsNumbericFormat(row.Cells["dgvC_SURYO"].Value.ToString(), 3, 3))
    {
    row.Selected = true;
    FormControlUtil.SetControlBackColor(this.decE_SURYO, false);
    ShowMsgById(MessageIdDef.COM_00030, "数量(t", "半角数字");
    this.ActiveControl = this.decE_SURYO;

    // 終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }


    //数量(t) 0以上チェック

    if (null != row.Cells["dgvC_SURYO"].Value
    && !ValidationUtil.IsEmpty(row.Cells["dgvC_SURYO"].Value.ToString())
    && Convert.ToDecimal(row.Cells["dgvC_SURYO"].Value) <= 0)
    {
    row.Selected = true;
    FormControlUtil.SetControlBackColor(this.decE_SURYO, false);
    ShowMsgById(MessageIdDef.COM_00030, "数量(t)", "0以上");
    this.ActiveControl = this.decE_SURYO;

    // 終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.ValidateGridView");
    return false;
    }
    }

    //終了ログを出力する
    GetLogger().LogMethodEnd("OS0304.CheckInputOfEdit");

    return true ;
    }

  • 相关阅读:
    C# dataGridView控件某单元格,间隔地变换背景色
    VS2005 DataGridView 和 GirdView 横向大比拼
    WinForm 修改Internet选项安全属性 。。。。。。。。。。
    [C#]使用HttpWebRequest请求远端服务器时如何加载SSL证书
    C# 采集 :设计一个可超时的阻塞方法
    c# 程序只能运行一次(多次运行只能打开同一个程序) 并激活第一个实例,使其获得焦点,并在最前端显示.
    windows下的正则式工具介绍之一:RegexBuddy
    delegate 与异步调用。。。。。。。。。。。
    C# 轻松实现水印: 利用原图和水印图的重叠 !!!!
    DataGridView常用属性 《一》
  • 原文地址:https://www.cnblogs.com/yutt/p/7210836.html
Copyright © 2011-2022 走看看