示例#1
0
 private void SetInfo(Foresight.DataAccess.CKProductOutSumary data)
 {
     this.tdAddUserName.Value          = data.AddUserName;
     this.tdOutTime.Value              = data.OutTime > DateTime.MinValue ? data.OutTime.ToString("yyyy-MM-dd HH:mm:ss") : "";
     this.tdOrderNumber.Value          = data.OrderNumber;
     this.tdAccpetUser.Value           = data.AcceptUserID > 0 ? data.AcceptUserID.ToString() : "";
     this.tdAccpetDepartmentName.Value = data.AccpetDepartmentName;
     this.tdUseFor.Value         = data.UseFor;
     this.tdInCategory.Value     = data.InCategoryID > 0 ? data.InCategoryID.ToString() : "";
     this.tdBelongTeamName.Value = data.BelongDepartmentID > 0 ? data.BelongDepartmentID.ToString() : "";
     if (data.CKCategoryID > 0)
     {
         this.CKCategoryID = data.CKCategoryID;
         SetCKName(data.CKCategoryID);
     }
 }
        public static string GetLastestPrintNumber(string OrderTypeName, SqlHelper helper, out int OrderNumberID)
        {
            if (string.IsNullOrEmpty(OrderTypeName))
            {
                OrderTypeName = Foresight.DataAccess.OrderTypeNameDefine.productoutnumber.ToString();
            }
            Sys_OrderNumber sysOrderNumber = Sys_OrderNumber.GetSys_OrderNumberByRoomID(OrderTypeName, 0, helper);

            if (sysOrderNumber == null)
            {
                OrderNumberID = 0;
                return(string.Empty);
            }
            OrderNumberID = sysOrderNumber.ID;
            CKProductOutSumary history = CKProductOutSumary.GetLastCKProductOutSumary(OrderNumberID, helper);
            string             Part1   = string.Empty;

            Part1 += sysOrderNumber.OrderPrefix;
            if (sysOrderNumber.UseYear)
            {
                Part1 += DateTime.Now.ToString("yyyy");
            }
            if (sysOrderNumber.UseMonth)
            {
                Part1 += DateTime.Now.ToString("MM");
            }
            if (sysOrderNumber.UseDay)
            {
                Part1 += DateTime.Now.ToString("dd");
            }
            int OrderNumberCount = sysOrderNumber.OrderNumberCount <= 0 ? 3 : sysOrderNumber.OrderNumberCount;
            int number           = 1;

            if (history != null && !string.IsNullOrEmpty(history.OrderNumber))
            {
                number = PrintRoomFeeHistory.GetOrderNumberBySysOrder(history.OrderNumber, sysOrderNumber, out OrderNumberCount);
            }
            return(Part1 + number.ToString("D" + OrderNumberCount));
        }