basemothed.cs
来自「酒店管理软件,c#版本可以选择不同的模式」· CS 代码 · 共 74 行
CS
74 行
using System;
using System.Collections.Generic;
using System.Text;
namespace Hotel.Command
{
public class BaseMothed
{
public Boolean ResultIntToBool(Int32 result)
{
if (result > 0)
{ return true; }
else
{ return false; }
}
public Int32 CheckDataIsInt(object obj)
{
try
{
if (obj != null )
{
return System.Convert.ToInt32(obj.ToString());
}
else
{
return 2;
}
}
catch (Exception)
{
return 2;
}
}
public string CheckDataIsStr(object obj)
{
try
{
if (obj != null)
{
return obj.ToString();
}
else
{
return "";
}
}
catch (Exception)
{
return "";
}
}
public Boolean CheckDataIsBool(object obj)
{
if (obj != null)
{
return System.Convert.ToBoolean(obj.ToString());
}
else
{
return false;
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?