Example #1
0
 public override string ToString()
 {
     return("Request Key : " + Key
            + "\nClient ID : " + ClientId
            + "\nCreate date : " + CreateDate.ToString(format: "dd/MM/yyyy")
            + "\nEntry date : " + EntryDate.ToString(format: "dd/MM/yyyy")
            + "\nLeave date : " + LeaveDate.ToString(format: "dd/MM/yyyy")
            + "\n");
 }
Example #2
0
 /// <summary>
 /// Update the costumer file with the values from the input
 /// </summary>
 /// <param name="path"></param>
 public void UpdateCustomerFile(string path)
 {
     try
     {
         var doc = new XmlDocument();
         doc.Load(path);
         // ReSharper disable once PossibleNullReferenceException
         doc.SelectSingleNode("customer/name").InnerText = CustomerName;
         // ReSharper disable once PossibleNullReferenceException
         doc.SelectSingleNode("customer/arrive").InnerText = ArriveDate.ToString();
         // ReSharper disable once PossibleNullReferenceException
         doc.SelectSingleNode("customer/leave").InnerText = LeaveDate.ToString();
         // ReSharper disable once PossibleNullReferenceException
         doc.SelectSingleNode("customer/money").InnerText = InvoiceAmount.ToString(CultureInfo.InvariantCulture);
         doc.Save(path);
     }
     catch (Exception e)
     {
         Console.WriteLine("An Exception was thrown: " + e.Message);
     }
 }
Example #3
0
        ///// <summary>
        ///// 操作类型
        ///// </summary>
        //public EnterOutLogType OperationType
        //{
        //    get { return _operationType; }
        //    set { _operationType = value; }
        //}
        ///// <summary>
        ///// 最后时间
        ///// </summary>
        //public DateTime LastDate
        //{
        //    get { return _lastDate; }
        //    set { _lastDate = value; }
        //}


        /// <summary>
        /// 转换成Url请求参数格式
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            //string str = "SchoolNum=" + SchoolNum + "&StudentNo=" + StudentNum + "&MsgType=" + MsgType.ToString()+"&Time=" + AddTime.ToString("yyyy-MM-dd HH:mm:ss");

            //switch (MsgType)
            //{
            //    case MsgPushType.AdminOperation:str+"&Operator=管理员"+ Operator
            //}

            //SchoolNum=&StudentNo=&MsgType=&Room=&SeatNo=&AddTime=&EndTime=&Days=VRType=&Msg=;
            string str = "SchoolNum=" + SchoolNum + "&StudentNo=" + StudentNum + "&MsgType=" + MsgType.ToString() + "&Room=" + RoomName + "&SeatNo=" + SeatNum + "&AddTime=" + AddTime.ToString("yyyy-MM-dd HH:mm:ss");

            string enddate = "";
            string days    = "";

            if (MsgType == MsgPushType.EnterBlack)
            {
                enddate = IsAutoLeaveBlack ? LeaveDate.ToString("yyyy-MM-dd HH:mm:ss") : "管理员手动释放";
                days    = IsAutoLeaveBlack ? (LeaveDate - AddTime).Days.ToString() : "N/A";
            }
            if (MsgType == MsgPushType.LeaveVrBlack)
            {
                days = (LeaveDate - AddTime).Days.ToString();
            }
            string VRType = "";

            if (MsgType == MsgPushType.EnterVR || MsgType == MsgPushType.LeaveVrBlack && VrType != ViolationRecordsType.None)
            {
                switch (VrType)
                {
                case ViolationRecordsType.BookingTimeOut:
                    VRType = "预约超时";
                    break;

                case ViolationRecordsType.CancelWaitByAdmin:
                    VRType = "被管理员取消等待";
                    break;

                case ViolationRecordsType.LeaveByAdmin:
                    VRType = "被管理员释放座位";
                    break;

                case ViolationRecordsType.LeaveNotReadCard:
                    VRType = "离开没有释放座位";
                    break;

                case ViolationRecordsType.SeatOutTime:
                    VRType = "在座超时";
                    break;

                case ViolationRecordsType.ShortLeaveByAdminOutTime:
                    VRType = "被管理员设置暂离超时";
                    break;

                case ViolationRecordsType.ShortLeaveByReaderOutTime:
                    VRType = "被其他读者设置暂离超时";
                    break;

                case ViolationRecordsType.ShortLeaveByServiceOutTime:
                    VRType = "暂离超时";
                    break;

                case ViolationRecordsType.ShortLeaveOutTime:
                    VRType = "暂离超时";
                    break;
                }
            }


            return(str + "&EndTime=" + enddate + "&Days=" + days + "VRType=" + VRType + "&Msg=" + Message);
        }
Example #4
0
 public static void Remove(LeaveDate obj)
 {
     LeaveDateManager.Remove(obj);
 }
Example #5
0
 public static void Add(LeaveDate obj)
 {
     LeaveDateManager.Add(obj);
 }