47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using AIMSDAL;
 | |
| using AIMSModel;
 | |
| using AIMSObjectQuery;
 | |
| using System.Collections;
 | |
| using System.Collections.Generic;
 | |
| using HelperDB;
 | |
| 
 | |
| namespace AIMSBLL
 | |
| {
 | |
|     public partial class BFeesRecord
 | |
|     {
 | |
|         public static int GetOrderNum(string FeeTypeId)
 | |
|         {
 | |
|             string docname = "";
 | |
|             if (FeeTypeId == "精神II类")
 | |
|             {
 | |
|                 docname = "第二类精神药品处方笺";
 | |
|             }
 | |
|             else if (FeeTypeId == "精神I类")
 | |
|             {
 | |
|                 docname = "第一类精神药品处方笺";
 | |
|             }
 | |
|             else if (FeeTypeId == "麻醉药")
 | |
|             {
 | |
|                 docname = "麻醉药品处方笺";
 | |
|             }
 | |
|             int num = 0;
 | |
|             string sql = "select max(OrderNo) from PrintDocument where XmlFileName='" + docname + "'";
 | |
|             string nums = DBHelper.ExecuteScalar(sql).ToString();
 | |
|             if (nums != null && nums != "")
 | |
|                 num = int.Parse(nums);
 | |
|             if (num == 0 && FeeTypeId == "精神II类")
 | |
|                 num = 10000;
 | |
|             else if (num == 0 && FeeTypeId == "精神I类")
 | |
|                 num = 10000;
 | |
|             else if (num == 0 && FeeTypeId == "麻醉药")
 | |
|                 num = 10000;
 | |
|             else if (num < 10000)
 | |
|                 num = 10000;
 | |
|             num++;
 | |
|             return num;
 | |
| 
 | |
|         }
 | |
|     }
 | |
| }
 |