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

📄 test_workbill.cs

📁 c#编写的汽车销售公司erp进销存系统
💻 CS
字号:
using System;
using System.Reflection;
using System.IO;
using System.Globalization; 
using System.Resources;
using CallCenter.Modules;
using CallCenter.BusinessLayer;
using CallCenter.OracleDAL;
using System.Collections;

namespace CallCenter.TestCode
{
	/// <summary>
	/// 
	/// </summary>
	public class Test_WorkBill
	{
		private static String errorfile="F:\\net_project\\callcenter\\error.log";
		private static String logfile="F:\\net_project\\callcenter\\log.log";

		public WorkBillBLL bll = new WorkBillBLL();

		public Test_WorkBill()
		{
			// 
			// TODO: 在此处添加构造函数逻辑
			//
		}

		public void test_addWorkBill()
		{
			WorkBillInfo info = new WorkBillInfo();			
			
			info.sid = "operater";
//			info.sname = "汤药东";
//			info.state = 10;
			//info.brief = "";
//			info.cid = 36;
			//info.cname = "";			
			info.ctelnumber = "5765285";
			//			info.comment = "客户评价";

			try
			{
				TextWriter log = new StreamWriter(logfile,true);
				log.WriteLine(bll.addWorkBill(info));				
				log.Close();
				//				bll.addWorkBill(info);
			}
			catch(Exception e)
			{
				TextWriter error = new StreamWriter(errorfile,true);
				error.WriteLine(e.Message.ToString());
				error.WriteLine(e.StackTrace);
				error.Close();
			}
			finally
			{
			}
		}

		public void test_updateWorkBill(int id)
		{
			WorkBillInfo info = new WorkBillInfo();			
			
			info.sid = "updateoperater";
			info.sname = "皇冠域";
			info.state = 20;
			info.brief = "快运";
			info.cid = 52;
			info.cname = "李金鱼";			
			info.ctelnumber = "2555555";
			info.comment = "客户评价";
			info.grade =10;
			info.id = id;

			try
			{
				bll.updateWorkBill(info);
			}
			catch(Exception e)
			{
				TextWriter error = new StreamWriter(errorfile,true);
				error.WriteLine(e.Message.ToString());
				error.WriteLine(e.StackTrace);
				error.Close();
			}
			finally
			{
			}
		}
		
		public void test_delWorkBill(string ids)
		{			
				
			try
			{
				bll.delWorkBill(ids);
			}
			catch(Exception e)
			{
				TextWriter error = new StreamWriter(errorfile,true);
				error.WriteLine(e.Message.ToString());
				error.WriteLine(e.StackTrace);
				error.Close();
			}
			finally
			{
			}
		}

		public void test_getWorkBillById(int id)
		{			
					
			try
			{
				TextWriter log = new StreamWriter(logfile,true);
				log.WriteLine(bll.getWorkBillById(id));
				log.Close();				
			}
			catch(Exception e)
			{
				TextWriter error = new StreamWriter(errorfile,true);
				error.WriteLine(e.Message.ToString());
				error.WriteLine(e.StackTrace);
				error.Close();
			}
			finally
			{
			}
		}

		public void test_getWorkBillByCId(int cid)
		{			
					
			try
			{
				ArrayList list = bll.getWorkBillByCid(cid);			
				IEnumerator enu = list.GetEnumerator();
				TextWriter log = new StreamWriter(logfile,true);
				while(enu.MoveNext())
				{
					log.WriteLine((WorkBillInfo)enu.Current);
				}
				log.Close();				
			}
			catch(Exception e)
			{
				TextWriter error = new StreamWriter(errorfile,true);
				error.WriteLine(e.Message.ToString());
				error.WriteLine(e.StackTrace);
				error.Close();
			}
			finally
			{
			}
		}

		public void test_saveGradeAComment(int id,int grade,string comment){
					
			try
			{
				bll.saveGradeACommnet(id,grade,comment);			
			}
			catch(Exception e)
			{
				TextWriter error = new StreamWriter(errorfile,true);
				error.WriteLine(e.Message.ToString());
				error.WriteLine(e.StackTrace);
				error.Close();
			}
			finally
			{
			}
		}

		public void test_changeWorkBillState(int id,int state){
					
			try
			{
				bll.changeWorkBillState(id,state);
			}
			catch(Exception e)
			{
				TextWriter error = new StreamWriter(errorfile,true);
				error.WriteLine(e.Message.ToString());
				error.WriteLine(e.StackTrace);
				error.Close();
			}
			finally
			{
			}
		}

		public void test_queryWorkBill()
		{			
			WorkBillInfo info = new WorkBillInfo();			
			
			info.sid = "operater1";
//			info.state = 10;
//			info.brief = "订餐";
//			info.cname = "都";			
//			info.ctelnumber = "5765285";
//			info.qbdate = "2006-06-12";
//			info.qadate ="2006-05-13";
//			info.sid = "updateoperater";
			//info.grade =20;
		
			try
			{
				ArrayList list = bll.queryWorkBill(info);
				IEnumerator enu = list.GetEnumerator();
				TextWriter log = new StreamWriter(logfile,true);
				while(enu.MoveNext())
				{
					log.WriteLine((WorkBillInfo)enu.Current);
				}
				log.Close();				
			}
			catch(Exception e)
			{
				TextWriter error = new StreamWriter(errorfile,true);
				error.WriteLine(e.Message.ToString());
				error.WriteLine(e.StackTrace);
				error.Close();
			}
			finally
			{
			}
		}
	}
}

⌨️ 快捷键说明

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