protected void BtnRequest_Clich(object sender, EventArgs e)

{

  lblMsg.Text= " " ;

  lblfmsg.Text= " " ;

TxtEmpID.Text=Coeno.Utility.String.CleanUpInput(TxtEmpID.Text);            --Coeno.Utility命名空间,String类名,CleanUpInput方法名

TxtVocMemo.Text = Coeno.Utility.String.CleanUpInput(TxtVocMemo.Text);

  if (TxtVocMemo.Text.Length>100)

  {

    lblMsg.Text= " 原因不能大于100个字符!!" ;

         lblMsg.ForeColor=System.Drawing.Color.Red ;                              --字体颜色

    lblfmsg.Text= " 原因不能大于100个字符" ;

    lblfmsg.ForeColor = System.Drawing.Color.Red ;

    return ;

  }

TxtEmpID.Text = Coeno.Utility.String.CleanUpInput(TxtEmpID.Text.Trim().ToUpper());
        TxtAgeEmpID.Text = Coeno.Utility.String.CleanUpInput(TxtAgeEmpID.Text.Trim().ToUpper());

#region 對於頁面必要欄位是否填寫正確的檢查

  if ( string.IsNullOrEmpty(TxtFormID.Text))

  {

      lblMsg.Text= " 请先申请一张新表单编号!!" ;

         lblMsg.ForeColor=System.Drawing.Color.Red ;                              --字体颜色

    lblfmsg.Text= " 请先申请一张新表单编号!!" ;

    lblfmsg.ForeColor = System.Drawing.Color.Red ;

    return ;

     }

   if (!string.IsNullOrEmpty(TxtAgeEmpID.Text)) &&(TxtAgeEmpID.Text == TxtEmpID.Text))

{

       lblMsg.Text= " 代理人工号不可与申请者一致!!" ;

          lblMsg.ForeColor=System.Drawing.Color.Red ;                              --字体颜色

     lblfmsg.Text= " 代理人工号不可与申请者一致!!" ;

     lblfmsg.ForeColor = System.Drawing.Color.Red ;

     return ;

      }

   if (string.IsNullOrEmpty(DropDutyCode.SelectedValue))

      {  

      lblMsg.Text= " 请选择申请者正确的【上下班时间】!!" ;

lblMsg.ForeColor=System.Drawing.Color.Red ;                              --字体颜色

     lblfmsg.Text = "請選擇請假者正確的【上下班時間】!!!" ;
               lblfmsg.ForeColor = System.Drawing.Color.Red;
               return;

   }

if (string.IsNullOrEmpty(TxtTotalHour.Value)) || TxtTotalHour.Value == "0" )

    {

     lblMsg.Text= " 请正确填写申请时间信息!!" ;

        lblMsg.ForeColor=System.Drawing.Color.Red ;

        lblfmsg.Text= " 请正确填写申请时间信息!!" ;

        lblfmsg.ForeColor=System.Drawing.Color .Red ;

        Return;

     }

System.DateTime OutDatetime;

    if (string.IsNullOrEmpty(TxtVocSTime.Text))

   {

     lblMsg.Text= "开始时间不能为空!! " ;

     lblMsg.ForeColor= System.Drawing.Color.Red;

     lblfmsg.Text= "开始时间不能为空! !" ;

     lblfmsg.ForeColor = System.Drawing.Color.Red

     return;

   }

else

   {

         if (!System.DateTime.TryParse(TxtVocSTime.Text, out OutDatetime))   --输入的开始时间与系统时间格式不同

      {

        lblMsg.Text = "开始時間有效格式應為(yyyy/MM/dd)!!!" ;

lblMsg.ForeColor = System.Drawing.Color.Red;

        lblfmsg.Text = "开始時間有效格式應為(yyyy/MM/dd)!" ;

        lblfmsg.ForeColor = System.Drawing.Color.Red;

        return;

       }

          if (!IsDate(TxtVocEtime.Text))

       {

        lblMsg.Text= " 结束时间有效格式应为(yyyy/MM/dd)! ! !" ;

        lblMsg.ForeColor=System.Drawing.Color.Red;

        lblfmsg.Text= " 结束时间有效格式应为(yyyy/MM/dd)!" ;

        lblfmsg.ForeColor=System.Drawing.Color.Red ;

        Return;

       }

      }

if (string.IsNullOrEmpty(TxtVocSHour.Value))

   {

      lblMsg.Text= " 开始时间不能为空!!" ;

      lblMsg.ForeColor=System.Drawing.Color.Red ;

      lblfmsg.Text= " 开始时间不能为空!!" ;

      lblfmsg.ForeColor=System.Drawing.Color.Red ;

         Return;

      }

      if (string.IsNullOrEmpty(TxtVocSMin.Value))

   {

      lblMsg.Text= " 开始时间不能为空!!" ;

      lblMsg.ForeColor=System.Drawing.Color.Red ;

      lblfmsg.Text= " 开始时间不能为空!!" ;

      lblfmsg.ForeColor=System.Drawing.Color.Red ;

         Return;

      }

      if (gvNewBody.Rows.Count<1)

   {

      lblMsg.Text= " 请点【计算】拆分时间段!!" ;

      lblMsg.ForeColor=System.Drawing.Color.Red ;

      lblfmsg.Text= " 请点击【计算】拆分时间段!!" ;

      lblfmsg.ForeColor=System.Drawing.Color.Red ;

      return;

      }

   else

    {

      for (int t =0; t<gvNewBody.Rows.Count ; t++)

           {

        double vhou =0;

        if (!double.TryParse(( (TextBox)gvNewBody.Rows[t] .FindControl( "txtNewBodyVocaHours " ) ).Text.ToString(),out vhou  ))

        {

          lblMsg.Text= " 时数格式错误!!" ;

          lblMsg.ForeColor=System.Drawing.Color.Red ;

          lblfmsg.Text= " 时数格式错误" ;

          lblfmsg.ForeColor=System.Drawing.Color.Red ;

            return ;

        }

      }

    }

#endregion

  //检查申请时数是否符合标准

  double totalhours = 0;

  string v_msg=string.Empty ;

  if (!double.TryParse(TxtTotalHours.value,out totalhours))   --TxtTotalHours.value的值与输出的totalhours样式不同

  {

    lblMsg.Text= " 总时数格式错误" ;

      lblMsg.ForeColor= System.Drawing.Color.Red;

    lblfmsg.Text= "总时数格式错误 " ;

         lblfmsg.ForeColor=System.Drawing.Color.Red;

    return;

  }

if (!CheckSmallestUnit(totalhours,out v_msg))                                                  --判斷請假單位不为空

 {

    lblMsg.Text=v_msg;

    lblMsg.ForeColor= System.Drawing.Color.Red;

    lblfmsg.ForeColor=v_msg;

    lblfmsg.ForeColor=System.Drawing.Color.Red;

    return;

  }

}

表单送件按钮代码(一)cs(C#)(未完)的更多相关文章

  1. 表单送件前的Check(二) (未完)

    #region 新增表单前的Check动作 public static void NewFormRequestCheck(string _FormID, string _VocaEmpID, stri ...

  2. Angular19 自定义表单控件

    1 需求 当开发者需要一个特定的表单控件时就需要自己开发一个和默认提供的表单控件用法相似的控件来作为表单控件:自定义的表单控件必须考虑模型和视图之间的数据怎么进行交互 2 官方文档 -> 点击前 ...

  3. Vue3组件(九)Vue + element-Plus + json = 动态渲染的表单控件

    一个成熟的表单 表单表单,你已经长大了,你要学会: 动态渲染 支持单列.双列.多列 支持调整布局 支持表单验证 支持调整排列(显示)顺序 依据组件值显示需要的组件 支持 item 扩展组件 可以自动创 ...

  4. 基于 el-form 封装一个依赖 json 动态渲染的表单控件

    nf-form 表单控件的功能 基于 el-form 封装了一个表单控件,包括表单的子控件. 既然要封装,那么就要完善一些,把能想到的功能都要实现出来,不想留遗憾. 毕竟UI库提供的功能都很强大了,不 ...

  5. html bottom html submit按钮表单控件与CSS美化

    一.html submit与bottom按钮基本语法结构 1.html submit按钮在input标签里设置type="submit"即可设置此表单控件为按钮. submit按钮 ...

  6. 文档驱动 —— 表单组件(五):基于Ant Design Vue 的表单控件的demo,再也不需要写代码了。

    源码 https://github.com/naturefwvue/nf-vue3-ant 特点 只需要更改meta,既可以切换表单 可以统一修改样式,统一升级,以最小的代价,应对UI的升级.切换,应 ...

  7. MVC树控件,mvc中应用treeview,实现复选框树的多层级表单控件

    类似于多层级的角色与权限控制功能,用MVC实现MVC树控件,mvc中应用treeview,实现复选框树的多层级表单控件.最近我们的项目中需要用到树型菜单,以前使用WebForm时,树型菜单有微软提供的 ...

  8. 基于CkEditor实现.net在线开发之路(3)常用From表单控件介绍与说明

    上一章已经简单介绍了CKEditor控件可以编写C#代码,然后可以通过ajax去调用,但是要在网页上面编写所有C#后台逻辑,肯定痛苦死了,不说实现复杂的逻辑,就算实现一个简单增删改查,都会让人头痛欲裂 ...

  9. 了解HTML表单之13个表单控件

    目录 传统控件 button select option optgroup textarea fieldset legend label 新增控件 datalist keygen output pro ...

随机推荐

  1. Prometheus基于consul自动发现监控对象 https://www.iloxp.com/archive/11/

      Prometheus 监控目标为什么要自动发现 频繁对Prometheus配置文件进行修改,无疑给运维人员带来很大的负担,还有可能直接变成一个“配置小王子”,即使是配置小王子也会存在人为失误的情况 ...

  2. AndoridSQLite数据库开发基础教程(8)

    AndoridSQLite数据库开发基础教程(8) 添加索引 索引是一种通过预先排序和对表的一个或多个列构建索引表来优化数据库查找的手段.下面为表添加索引,操作步骤如下: (1)在打开的数据库中,单击 ...

  3. typeScript模块<二>

    /*模块 1 模块的的概念 2 模块导出的几种方法 1.export 导出声明 2.export 导出语句 3.export default 4.import导入模块 3 模块化封装上一讲的DB库 * ...

  4. logrotate机制&原理

    logrotate机制&原理 centos系统中默认安装logrotate,logrotate主配置文件:/etc/logrotate.conf,其中定义了系统默认的logrotate规则,当 ...

  5. 从0开始学爬虫9之requests库的学习之环境搭建

    从0开始学爬虫9之requests库的学习之环境搭建 Requests库的环境搭建 环境:python2.7.9版本 参考文档:http://2.python-requests.org/zh_CN/l ...

  6. FastDFSClient工具类

    import org.csource.common.NameValuePair;import org.csource.fastdfs.ClientGlobal;import org.csource.f ...

  7. Qt编写气体安全管理系统12-设备双击

    一.前言 在编写这个项目的过程中,有个得到客户夸赞的小功能就是,设备按钮双击,在离线的时候是双击重连设备,在线的时候是双击弹出具体详情界面,回控设备,参数设置等.在modbus设备通信过程中,设定了超 ...

  8. Fragment already added问题的解决

      问题 当快速点击切换不同的Fragment的时候部分手机的app竟然挂了,报出了下面的错误 Fragment already added java.lang.IllegalStateExcepti ...

  9. /var/spool/postfix

    centos磁盘优化,发现/var/spool/postfix/maildrop下有大量文件. cron进程默认会将计划任务中所运行的脚本的警告.错误信息或者脚本输出信息发送给计划任务的所有者,而由于 ...

  10. C# 利用bat文件轻松创建windos 服务

    最近,一个项目需要一个后台服务,定时去读取数据,这是直接创建一个bat文件,双击执行就可以了,为了省事哦 主要分两个步奏 1.创建windows服务的应用程序.这一点不做过多讲解.网上有太多的例子 2 ...