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

📄 print_xz.cs

📁 一个用vs2003编写的客户工资管理系统客户端程序/一个用vs2003编写的客户工资管理系统客户端程序
💻 CS
字号:
using System;
using System.Data;
using System.Data.OleDb;

using Jinrm.Data;

namespace GzglClient.BLL
{
	/// <summary>
	/// Print_XZ 的摘要说明。
	/// </summary>
	public class Print_XZ
	{
		#region 基本信息
		/// <summary>
		/// 姓名A
		/// </summary>
		public string name = "";
		/// <summary>
		/// 性别B
		/// </summary>
		public string sex="";
		/// <summary>
		/// 出身年月C
		/// </summary>
		public string birth="";
		/// <summary>
		/// 身份证
		/// </summary>
		public string idcard = "";
		/// <summary>
		/// 参加工作时间D
		/// </summary>
		public string gzsj="";
		/// <summary>
		/// 工作年限E
		/// </summary>
		public string gznx="";
		/// <summary>
		/// 现身份
		/// </summary>
		public string xsf="";
		/// <summary>
		/// 现学历F
		/// </summary>
		public string xxl="";
		/// <summary>
		/// 学龄G
		/// </summary>
		public string yjxl="";
		/// <summary>
		/// 扣除工龄 93年以来不称职(不计等次)次数H
		/// </summary>
		public string kcgl="";
		/// <summary>
		/// 间断工龄A
		/// </summary>
		public string jdgl = "";
		/// <summary>
		/// 套改年限
		/// </summary>
		public string tgnx = "";
		#endregion

		#region 任职情况
		/// <summary>
		/// 工资职级(工人技术等级)I
		/// </summary>
		public string qzwjb="";
		/// <summary>
		/// 是否领导职务J
		/// </summary>
		public string qsfld=""; 
		/// <summary>
		/// 任职时间(聘任时间)K
		/// </summary>
		public string qrzsj="";
		/// <summary>
		/// 低一职任职时间L
		/// </summary>
		public string qqrzsj="";
		#endregion

		#region 前工资情况
		/// <summary>
		/// 小计M
		/// </summary>
		public string qhj="0";
		/// <summary>
		/// 职务工资(岗位工资)N
		/// </summary>
		public string qzwgz="0";
		/// <summary>
		/// 职务工资 档次
		/// </summary>
		public string qdc = "";
		/// <summary>
		/// 级别工资(技术等级工资)O
		/// </summary>
		public string qjbgz="0";
		/// <summary>
		/// 级别工资 档次
		/// </summary>
		public string qjb="";
		/// <summary>
		/// 基础工资P
		/// </summary>
		public string qjcgz="0";
		/// <summary>
		/// 工龄工资Q
		/// </summary>
		public string qglgz="0";
		/// <summary>
		/// 工人奖金R
		/// </summary>
		public string qgrjj="0";
		/// <summary>
		/// 事业津贴
		/// </summary>
		public string qsyjt="0";
		#endregion

		#region 现工资情况
		/// <summary>
		/// 小计S
		/// </summary>
		public string xhj="0";
		/// <summary>
		/// 职务工资(技术等级工资)T
		/// </summary>
		public string xzwgz="0";
		/// <summary>
		/// 级别工资(岗位工资)--级别U
		/// </summary>
		public string xjb="";
		/// <summary>
		/// 级别工资(岗位工资)--档次V
		/// </summary>
		public string xdc="";
		/// <summary>
		/// 级别工资(岗位工资)--标准W
		/// </summary>
		public string xjbdcje="0";
		/// <summary>
		/// 月增资额X
		/// </summary>
		public string yzze="0";
		/// <summary>
		/// 备注Y
		/// </summary>
		public string bz="";
		#endregion

		#region 属性
		/// <summary>
		/// 审批时间
		/// </summary>
		public string DoTime = "";
		/// <summary>
		/// 审批人员
		/// </summary>
		public string DoMan = "";

		/// <summary>
		/// 人员ID
		/// </summary>
		public string personid = "";
		public string worgbaseid = "";
		public string ywitemid = "";
		public string ywitemtype = "";
		public string orgname = "";
		public string zxsj = "";
		private DoAccess conn = new DoAccess();
		#endregion

		/// <summary>
		/// 机关打印
		/// </summary>
		public Print_XZ(){}

		/// <summary>
		/// 获取属性
		/// </summary>
		/// <returns></returns>
		public bool SetProperty()
		{
			#region 
			DataSet ds = conn.GetDs("*","TaoGai_ZZ","WYWItemId ='" + this.ywitemid + "' ","");
			if(ds.Tables[0].Rows.Count == 1)
			{
				this.ywitemid = ds.Tables[0].Rows[0]["WYWItemId"].ToString();
				this.ywitemtype = ds.Tables[0].Rows[0]["YWItemType"].ToString();
				this.personid = ds.Tables[0].Rows[0]["WPersonId"].ToString();
				this.worgbaseid = ds.Tables[0].Rows[0]["WOrgBaseId"].ToString();
				this.orgname = ds.Tables[0].Rows[0]["OrgName"].ToString();

				this.xsf = ds.Tables[0].Rows[0]["XSF"].ToString();
				this.name = ds.Tables[0].Rows[0]["Name"].ToString();
				this.sex = ds.Tables[0].Rows[0]["Sex"].ToString();
				try
				{
					this.birth = Convert.ToDateTime(ds.Tables[0].Rows[0]["Birth"].ToString()).ToShortDateString();
				}
				catch{}
				try
				{
					this.gzsj = Convert.ToDateTime(ds.Tables[0].Rows[0]["Gzsj"].ToString()).ToShortDateString();
				}
				catch{}
				this.gznx = ds.Tables[0].Rows[0]["GZNX"].ToString();
				this.tgnx = ds.Tables[0].Rows[0]["tgnx"].ToString();
				this.xxl = ds.Tables[0].Rows[0]["XXL"].ToString();

				this.yjxl = ds.Tables[0].Rows[0]["YJXL"].ToString();

				//this.yjxl = (Convert.ToInt32(ds.Tables[0].Rows[0]["YJXL"].ToString())/12).ToString();
				this.kcgl = ds.Tables[0].Rows[0]["KCGL"].ToString();
				this.jdgl = ds.Tables[0].Rows[0]["JDGL"].ToString();

				this.qzwjb = ds.Tables[0].Rows[0]["qzwjb"].ToString();
				this.qsfld = ds.Tables[0].Rows[0]["qsfld"].ToString();
				try
				{
					this.qrzsj = Convert.ToDateTime(ds.Tables[0].Rows[0]["qrzsj"].ToString()).ToShortDateString();
				}
				catch{}
				try
				{
					this.qqrzsj = Convert.ToDateTime(ds.Tables[0].Rows[0]["qqrzsj"].ToString()).ToShortDateString();
				}
				catch{}
				this.qhj = ds.Tables[0].Rows[0]["qhj"].ToString();
				this.qzwgz = ds.Tables[0].Rows[0]["qzwgz"].ToString();
				this.qdc = ds.Tables[0].Rows[0]["qdc"].ToString();
				this.qjbgz = ds.Tables[0].Rows[0]["qjbgz"].ToString();
				this.qjb = ds.Tables[0].Rows[0]["qjb"].ToString();
				this.qjcgz = ds.Tables[0].Rows[0]["qjcgz"].ToString();
				this.qglgz = ds.Tables[0].Rows[0]["qglgz"].ToString();
				this.qgrjj = ds.Tables[0].Rows[0]["qgrjj"].ToString();
				this.qsyjt = ds.Tables[0].Rows[0]["qsyjt"].ToString();

				this.xhj = ds.Tables[0].Rows[0]["xhj"].ToString();
				this.xzwgz = ds.Tables[0].Rows[0]["xzwgz"].ToString();
				this.xjb = ds.Tables[0].Rows[0]["xjb"].ToString();
				this.xdc = ds.Tables[0].Rows[0]["xdc"].ToString();
				this.xjbdcje = ds.Tables[0].Rows[0]["xjbdcje"].ToString();
				this.yzze = ds.Tables[0].Rows[0]["XZZE"].ToString();
				this.bz = "";
				this.zxsj = ds.Tables[0].Rows[0]["ZXSJ"].ToString();
				this.DoTime = ds.Tables[0].Rows[0]["DoTime"].ToString();
				this.DoMan = ds.Tables[0].Rows[0]["DoMan"].ToString();
			}
			return true;
			#endregion
		}

		/// <summary>
		/// 获取属性
		/// </summary>
		/// <returns></returns>
		public bool GetProperty(DataSet _ds,string _YWItemId,string _PersonId)
		{
			this.ywitemid = _YWItemId;
			if(this.ywitemid == "")
			{
				return false;
			}

			DataView dvPerson = new DataView();
			dvPerson.Table = _ds.Tables["V_Person_GZ"];//人员基本信息
			dvPerson.RowFilter = "PersonId = '" + _PersonId + "'";

			#region 基本信息
			foreach(DataRowView drv in dvPerson)
			{
				this.personid = drv["PersonId"].ToString();
				this.worgbaseid = drv["WOrgBaseId"].ToString();

				this.name = drv["Name"].ToString();
				this.sex = drv["Sex"].ToString();
				this.birth = drv["Birth"].ToString();
				this.gzsj = drv["Gzsj"].ToString();
				#region 工作年限
				int intgznx = 2006 - (Convert.ToDateTime(drv["Gzsj"].ToString()).
					AddMonths(Convert.ToInt32(drv["JDGL"].ToString()))).Year + 1;
				this.gznx = intgznx.ToString();
				#endregion

				#region 工作年限
				int inttgnx = Convert.ToDateTime("2006-07-01").Year + (Convert.ToInt32(drv["YJXL"].ToString())/12) - 
					Convert.ToInt32(drv["KCGL"].ToString()) - 
					(Convert.ToDateTime(drv["Gzsj"].ToString()).AddMonths(Convert.ToInt32(drv["JDGL"].ToString())).Year) + 1;
				tgnx = inttgnx.ToString();
				#endregion

				this.yjxl = drv["YJXL"].ToString();
				this.kcgl = drv["KCGL"].ToString();
				this.jdgl = drv["JDGL"].ToString();
			}
			#endregion

			#region 学历
			DataView dvXL = new DataView();
			dvXL.Table = _ds.Tables["V_Person_XL"];//人员基本信息
			dvXL.RowFilter = "YWItemId = '" + this.ywitemid + "'";

			foreach(DataRowView drv in dvXL)
			{
				this.xxl = drv["XL"].ToString();
			}
			#endregion

			#region 任职信息
			string temprzsj = "";
			DataView dvRZ = new DataView();
			dvRZ.Table = _ds.Tables["V_Person_RZ"];//人员基本信息
			dvRZ.RowFilter = "YWItemId = '" + this.ywitemid + "'";

			foreach(DataRowView drv in dvRZ)
			{
				if(temprzsj == "")//第一次复制
				{
					this.xsf = GetSFIdFromSF(drv["WSFId"].ToString());
					this.qzwjb = drv["ZWJB"].ToString();
					this.qsfld = drv["SFLD"].ToString();
					this.qrzsj = drv["RZSJ"].ToString();
					temprzsj = drv["RZSJ"].ToString();//现职务时间
				}
				else
				{
					this.qqrzsj = drv["RZSJ"].ToString();
				}
				
//				if(drv["WSFId"].ToString() == "")//前职务
//				{
//					this.qqrzsj = drv["RZSJ"].ToString();
//				}
//				else if(drv["WSFId"].ToString() != "")//现职务
//				{
//					this.xsf = GetSFIdFromSF(drv["WSFId"].ToString());
//					this.qzwjb = drv["ZWJB"].ToString();
//					this.qsfld = drv["SFLD"].ToString();
//					this.qrzsj = drv["RZSJ"].ToString();
//				}
			}
			#endregion

			#region 前工资情况
			DataView dvOther = new DataView();
			dvOther.Table = _ds.Tables["V_Person_Other"];//人员基本信息
			dvOther.RowFilter = "WPersonId = '" + this.personid + "'";

			foreach(DataRowView drv in dvOther)
			{
				this.qhj = drv["QGZHJ"].ToString();
				this.qzwgz = drv["QZWJBJE"].ToString();
				this.qdc = drv["QDC"].ToString();
				this.qjbgz = drv["QJBJE"].ToString();
				this.qjb = drv["QJB"].ToString();
				this.qjcgz = drv["JCGZ"].ToString();
				this.qglgz = drv["GLGZ"].ToString();
				this.qgrjj = drv["GRJJ"].ToString();
				this.qsyjt = drv["syjt"].ToString();
			}
			#endregion

			#region 现工资情况
			DataView dvGZ = new DataView();
			dvGZ.Table = _ds.Tables["V_GZ"];//人员基本信息
			dvGZ.RowFilter = "WYWItemId = '" + this.ywitemid + "'";

			foreach(DataRowView drv in dvGZ)
			{
				this.xzwgz = drv["ZZZWGZ"].ToString();
				this.xjb = drv["ZZJB"].ToString();
				this.xdc = drv["ZZDC"].ToString();
				this.xjbdcje = drv["ZZJBDCJE"].ToString();

				this.xhj = (Convert.ToDouble(xzwgz)+Convert.ToDouble(xjbdcje)).ToString();
				if(qhj != "0")
				{
					this.yzze = (Convert.ToDouble(xhj)-Convert.ToDouble(qhj)).ToString();
				}
				else
				{
					this.yzze = "0";
				}
				this.bz = "";
			}
			#endregion

			return true;
		}

		/// <summary>
		/// 更新套改信息
		/// </summary>
		public void UpdateTaoGai()
		{
			if (conn.CheckIsExist("TaoGai_ZZ", "WYWItemId = '"+ this.ywitemid +"'") == false)//如果不存在
			{
				conn.ExecInsert("TaoGai_ZZ","WYWItemId"," '"+ ywitemid +"' ");
			}

			conn.ExecUpdate("TaoGai_ZZ",
				"YWItemType = '"+ this.ywitemtype +//主id
				"',WPersonId = '"+ this.personid +//姓名
				"',WOrgBaseId = '"+ this.worgbaseid +//出生年月
				"',OrgName = '"+ this.orgname +//出生年月
				"',XSF = '"+ this.xsf +//单位id
				"',Name = '"+ this.name +//姓名
				"',Sex = '"+ this.sex +//性别
				"',Birth = '"+ this.birth +//出生年月
				"',GZSJ = '"+ this.gzsj +//身份证
				"',GZNX = '"+ this.gznx +//区划
				"',TGNX = '"+ this.tgnx +//区划
				"',XXL = '"+ this.xxl +//内设机构id
				"',YJXL = '"+ this.yjxl +//编制性质
				"',KCGL = '"+ this.kcgl +//编制结构
				"',JDGL = '"+ this.jdgl +//职务
				"',QZWJB = '"+ this.qzwjb +//职级
				"',QSFLD = '"+ this.qsfld +//备注
				"',QRZSJ = '"+ this.qrzsj +//用户类型
				"',QQRZSJ = '"+ this.qqrzsj +//是否启用
				"',QHJ = '"+ this.qhj +//是否启用
				"',QZWGZ = '"+ this.qzwgz +//人员排序号
				"',QDC = '"+ this.qdc +//人员排序号
				"',QJBGZ = '"+ this.qjbgz +//人员排序号
				"',QJB = '"+ this.qjb +//人员排序号
				"',QJCGZ = '"+ this.qjcgz +//人员排序号
				"',QGLGZ = '"+ this.qglgz +//人员排序号
				"',QGRJJ = '"+ this.qgrjj +//人员排序号
				"',QSYJT = '"+ this.qsyjt +//人员排序号
				"',XHJ = '"+ this.xhj +//人员排序号
				"',XZWGZ = '"+ this.xzwgz +//人员排序号
				"',XJB = '"+ this.xjb +//人员排序号
				"',XDC = '"+ this.xdc +//人员排序号
				"',XJBDCJE = '"+ this.xjbdcje +//人员排序号
				"',XZZE = '"+ this.yzze +//人员排序号
				"',BZ = '"+ this.bz +//人员排序号
				"',ZXSJ = '2006-7-1" +//人员排序号
				"',DoTime = '"+ this.DoTime +//人员排序号
				"',DoMan = '"+ this.DoMan +//人员排序号
				"'","WYWItemId = '"+ this.ywitemid +"'");
		}
		
		/// <summary>
		/// 判断不同的个人身份,转换成对应的数据库里的字段
		/// </summary>
		/// <param name="_SF">身份</param>
		/// <returns></returns>
		private string GetSFIdFromSF(string _SF)
		{
			string SFId = "";
			if(_SF =="1")
			{
				SFId = "机关单位公务员";
			}
			if(_SF =="2")
			{
				SFId = "机关单位技术工人";
			}
			if(_SF =="3")
			{
				SFId = "机关单位普通工人";
			}
			if(_SF =="4")
			{
				SFId = "事业单位管理人员";
			}
			if(_SF =="7")
			{
				SFId = "事业单位专业技术人员";
			}
			if(_SF =="5")
			{
				SFId = "事业单位技术工人";
			}
			if(_SF =="6")
			{
				SFId = "事业单位普通工人";
			}
			if(_SF =="8")
			{
				SFId = "新工作人员试用期";
			}
			if(_SF =="9")
			{
				SFId = "已有工龄人员试用期";
			}

			return SFId;
		}
	}
}

⌨️ 快捷键说明

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