⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 findinfo.cs

📁 企业管理信息化之财务管理系统
💻 CS
📖 第 1 页 / 共 3 页
字号:


		

		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据产品代码获取产品计量单位
		/// </summary>
		/// <param name="CpId">产品代号</param>
		/// <returns>成功执行时返回该产品的计量单位名,产生异常时返回"Error",参数为空时返回null</returns>
		/// **************************************************************************
		public static string FindCpjldw(string CpId)
		{
			if(CpId == null)
				return null;

			string Cpjldw;
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select J.JLDWMC From JLDW J, CPJBXX C Where J.JLDWDM = C.YJLDWDM And C.CPDM = '" + CpId + "'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				Cpjldw = cmd.ExecuteScalar().ToString();
				Connection.Close();
				return Cpjldw;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("FindCpjldw(string CpId)");
				LogService.Write ("在根据产品代码获取对应的计量单位名称时发生错误。");
				LogService.Write (e.Message);
				return "Error";
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************




		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据统计查询类别获取统计查询名称
		/// </summary>
		/// <param name="Tjcxlb">统计查询类别</param>
		/// <returns>成功执行时返回统计查询名称,产生异常时返回"Error",参数为空时返回null</returns>
		/// **************************************************************************
		public static string FindTjcxlb(string Tjcxlb)
		{
			if(Tjcxlb == null)
				return null;

			string CgjhName;
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select LBMC From ZDYCXLB Where LBDM = '" +Tjcxlb + "'";
			cmd.CommandText = sql;
			Connection.Open();
			
			try
			{
				CgjhName = cmd.ExecuteScalar().ToString();
				Connection.Close();
				return CgjhName;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("FindTjcxlb(string Tjcxlb)");
				LogService.Write ("在根据统计查询类别获取对应的统计查询名称时发生错误。");
				LogService.Write (e.Message);
				return "Error";
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************





		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据产品代码获取产品规格
		/// </summary>
		/// <param name="CpId">产品代码</param>
		/// <returns>成功执行时返回产品规格,产生异常时返回"Error",参数为空时返回null</returns>
		/// **************************************************************************
		public static string FindCPGG(string CpId)
		{
			if(CpId == null)
				return null;

			string CpName;
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CPGG From CPJBXX Where CPDM = '" + CpId + "'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				CpName = cmd.ExecuteScalar().ToString();
				Connection.Close();
				return CpName;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("FindCPGG(string CpId)");
				LogService.Write ("在根据产品代码获取对应的产品规格时发生错误。");
				LogService.Write (e.Message);
				return "Error";
			}
		}
		/// **************************************************************************
		/// END
		/// **************************************************************************
 

 
 
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据产品代码获取产品型号
		/// </summary>
		/// <param name="CpId">产品代码</param>
		/// <returns>成功执行时返回产品型号,产生异常时返回"Error",参数为空时返回null</returns>
		/// **************************************************************************
		public static string FindCPXH(string CpId)
		{
			if(CpId == null)
				return null;

			string CpName;
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();
			string sql = "Select CPXH From CPJBXX Where CPDM = '" + CpId + "'";
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				CpName = cmd.ExecuteScalar().ToString();
				Connection.Close();
				return CpName;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("FindCPXH(string CpId)");
				LogService.Write ("在根据产品代码获取对应的产品型号时发生错误。");
				LogService.Write (e.Message);
				return "Error";
			}
		}
		/// **************************************************************************
		/// END
		/// ************************************************************************** 

	
	
	
	
	
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据单据类型编号获取单据类型名称
		/// </summary>
		/// <param name="Lxbh">单据类型编号</param>
		/// <returns>成功执行时返回单据类型名称,产生异常时返回"Error",参数为空时返回null</returns>
		/// **************************************************************************
		public static string FindDjlxmc(string Lxbh)
		{
			if(Lxbh == null)
				return null;
 
			string Lxmc;
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();   
			string sql = "Select Lxmc from CW_DJLX where Lxbh = " + Lxbh;
			cmd.CommandText = sql;
			Connection.Open();
			try
			{
				Lxmc = cmd.ExecuteScalar().ToString();
				Connection.Close();
				return Lxmc;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("FindDjlxmc(string Lxbh)");
				LogService.Write ("在根据单据类型编号获取单据类型名称时发生错误。");
				LogService.Write (e.Message);
				return "Error";
			}
		}
		/// **************************************************************************
		/// END
		/// ************************************************************************** 






		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据“往来户类型“获取“往来户类型”的中文简称
		/// </summary>
		/// <param name="LX">“往来户类型”</param>
		/// <returns>“往来户类型”的中文简称</returns>
		/// **************************************************************************
		public static string FindWlhlx(string LX)
		{
			if(LX == null)
			{
				return null;
			}
			string JC = "";
			//当类型为“客户”时
			if(LX == "1")
			{
				JC = "客户";
			}
			//当类型为“供应商”时
			if(LX == "2")
			{
				JC = "供应商";
			}
			//当类型为“机构”时
			if(LX == "3")
			{
				JC = "机构";
			}
			//当类型为“人员”时
			if(LX == "4")
			{
				JC = "人员";
			} 
			return JC;
		}
		/// **************************************************************************
		/// END
		/// ************************************************************************** 






  
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据“往来户类型”来得到“往来户编号“的简称
		/// </summary>
		/// <param name="wlhlx">往来户类型</param>
		/// <param name="wlhbh">往来户编号</param>
		/// <returns>成功执行时返回"往来户编号“的简称,产生异常时返回"Error",参数为空时返回null</returns>
		/// **************************************************************************
		public static string FindWlhbh(string LX,string BH)
		{
			if(LX == null || BH == null)
				return null;
   
			string strSql = "";
			string JC;
			System.Data.SqlClient.SqlConnection Connection = new SqlConnection (com.unicafe.common.Configuration.GetDBConnectionString());
			System.Data.SqlClient.SqlCommand cmd = Connection.CreateCommand();   
			//当类型为“客户”时
			if(LX == "1")
			{
				strSql = "select KHJC from KHXX where KHDM = '"+ BH +"'";
			}
			//当类型为“供应商”时
			if(LX == "2")
			{
				strSql = "select GYSJC from GYSXX where GYSDM = '"+ BH +"'";
			}
			//当类型为“机构”时
			if(LX == "3")
			{
				strSql = "select JGJC from JGXX where JGDM = '"+ BH +"'";
			}
			//当类型为“人员”时
			if(LX == "4")
			{
				strSql = "select (EmplNameL + EmplNameF) as Name from Employees where EmplID = '"+ BH +"'";
			}
			cmd.CommandText = strSql;
			Connection.Open();
			try
			{
				JC = cmd.ExecuteScalar().ToString();
				Connection.Close();
				return JC;
			}
			catch(Exception e)
			{
				Connection.Close();
				LogService.Write ("FindWlhbh(string LX,string BH)");
				LogService.Write ("根据“往来户类型”来得到“往来户编号”的简称时发生错误。");
				LogService.Write (e.Message);
				return "Error";
			}
		}
		/// **************************************************************************
		/// END
		/// ************************************************************************** 



		
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据CW_DJLX表中的“单据类型”来显示该单据类型的中文名称
		/// </summary>
		/// <param name="Djlx">单据类型</param>  
		/// <returns>成功执行时返回"单据类型“的中文名称</returns>
		/// **************************************************************************
		public static string FindDjlxzwmc(string Djlx)
		{
			if(Djlx == null)
				return null;
      
			string MC = "";       
			if(Djlx == "1")
			{
				MC = "应收单";
			}   
			if(Djlx == "2")
			{
				MC = "收款单";
			}
			if(Djlx == "3")
			{
				MC = "应付单";
			}
			if(Djlx == "4")
			{
				MC = "付款单";
			}
			if(Djlx == "5")
			{
				MC = "预收单";
			}
			if(Djlx == "6")
			{
				MC = "预付单";
			}
			return MC;   
		}
		/// **************************************************************************
		/// END
		/// ************************************************************************** 






 
		/// **************************************************************************
		/// BEIGIN
		/// <summary>
		/// 根据CW_DJLX表中的“标记”来显示该标记的的中文名称
		/// </summary>
		/// <param name="Bj">标记</param>  
		/// <returns>成功执行时返回"标记“的中文名称</returns>
		/// **************************************************************************
		public static string FindBjmc(string Bj)
		{
			if(Bj == null)
				return null;
      
			string MC = "";       
			if(Bj == "1")
			{
				MC = "应收";
			}   
			if(Bj == "2")
			{
				MC = "应付";
			}   
			return MC;   
		}
		/// **************************************************************************
		/// END
		/// ************************************************************************** 

	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -