Esempio n. 1
0
        public static EMPLOYEE ToEmployeeMockup(this Request.REQ_DOCUMENT request, bool isGenerateRequestor)
        {
            EMPLOYEE result = EMPLOYEE.CreateInstance();

            result.CODE = Guid.NewGuid().ToString();
            if (isGenerateRequestor)
            {
                result.NAME = string.IsNullOrEmpty(request.FILTER.REQUESTOR) ? "Ton" : request.FILTER.REQUESTOR;
            }
            else
            {
                result.NAME = string.IsNullOrEmpty(request.FILTER.PREVIOUS) ? "Ton" : request.FILTER.PREVIOUS;
            }

            result.CONTACT_NO = "081-919-1998";

            return(result);
        }
Esempio n. 2
0
        public static DOCUMENT ToDocumentMockup(this Request.REQ_DOCUMENT request, string code, DOCUMENT_TYPE docType, TRANS_TYPE transType)
        {
            PERIOD period = new PERIOD();

            period.BEGIN = string.IsNullOrEmpty(request.FILTER.BEGIN) ? $"{DateTime.Today:yyyy-MM-dd}" : request.FILTER.BEGIN;
            period.END   = string.IsNullOrEmpty(request.FILTER.END) ? $"{new DateTime(9999, 12, 31):yyyy-MM-dd}" : request.FILTER.END;

            DOCUMENT oDocument = DOCUMENT.CreateInstance();

            oDocument.CODE       = $"Document {code}";
            oDocument.DOC_TYPE   = docType;
            oDocument.TRANS_TYPE = transType;
            oDocument.PLAN_BEGIN = period.BEGIN;
            oDocument.PLAN_END   = period.END;
            oDocument.REQUESTOR  = request.ToEmployeeMockup(true);
            oDocument.STATUS     = "Waiting";
            oDocument.TRANS_DATE = oDocument.PLAN_BEGIN;
            return(oDocument);
        }