Ejemplo n.º 1
0
        public string ApproveUserRequest(string q)
        {
            try
            {
                JObject obj = JObject.Parse(q);
                long id = long.Parse((string)obj["idStr"]);

                UserRequestModel model = new UserRequestModel();
                model.ID = id;

                IBorrowAndReturnRecordInfoDataProvider iBorrowAndReturnRecordInfoDataProviderdataProvider = new BorrowAndReturnRecordInfoDataProvider();
                IProcessRecordDataProvider iProcessRecordDataProvider = new ProcessRecordDataProvider();

                BorrowAndReturnRecordInfo borrowAndReturnRecordInfo = new BorrowAndReturnRecordInfo();
                BookModel bookModel = new BookModel();
                BookDetailInfo bookDetailInfo = new BookDetailInfo();
                ProcessRecord processInfo = model.GetEntity(this.LoginUser(), q, false, out borrowAndReturnRecordInfo, out bookDetailInfo, out bookModel);

                iProcessRecordDataProvider.Add(processInfo);
                iBorrowAndReturnRecordInfoDataProviderdataProvider.Update(borrowAndReturnRecordInfo);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
            return "true";
        }
Ejemplo n.º 2
0
        public string TakeWaitingForTake(string q)
        {
            try
            {
                long id = long.Parse(q);
                WaitingForTakeModel model = new WaitingForTakeModel();
                model.ID = id;

                IBorrowAndReturnRecordInfoDataProvider iBorrowAndReturnRecordInfoDataProviderdataProvider = new BorrowAndReturnRecordInfoDataProvider();
                IProcessRecordDataProvider iProcessRecordDataProvider = new ProcessRecordDataProvider();

                BorrowAndReturnRecordInfo borrowAndReturnRecordInfo = new BorrowAndReturnRecordInfo();
                ProcessRecord processInfo = model.GetTakeEntity(out borrowAndReturnRecordInfo, this.LoginUser());

                iProcessRecordDataProvider.Add(processInfo);
                iBorrowAndReturnRecordInfoDataProviderdataProvider.Update(borrowAndReturnRecordInfo);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
            return "true";
        }