Ejemplo n.º 1
0
        public HttpResponseMessage RejectPOData(PRHeaderModels Header)
        {
            string    errMsg  = "";
            DataSet   ds      = new DataSet();
            DataTable dt      = new DataTable();
            Result    resData = new Result();


            int id = repository.RejectPO(Header.Document_Id, Header.Document_CreateUser, ref errMsg);

            //ds.Tables.Add(dtDocumentVnos);
            if (errMsg != "")
            {
                resData.StatusCode = (int)(StatusCodes.Error);
                resData.Messages   = errMsg;
            }
            else
            {
                resData.StatusCode = (int)(StatusCodes.Succuss);
                resData.Messages   = (String)EnumString.GetStringValue(StatusCodes.Succuss);
            }

            resData.Results = ds;
            return(Request.CreateResponse(HttpStatusCode.OK, resData));
        }
Ejemplo n.º 2
0
        public HttpResponseMessage SavePRData(PRHeaderModels Header)
        {
            string    errMsg  = "";
            DataSet   ds      = new DataSet();
            DataTable dt      = new DataTable();
            Result    resData = new Result();


            int id = repository.InsertHeader(Header, ref errMsg);

            //ds.Tables.Add(dtDocumentVnos);
            if (errMsg != "" && errMsg != "ยอดรวมมากกว่างบประมาณอนุมัติของแผนกในเดือนปัจจุบัน")
            {
                resData.StatusCode = (int)(StatusCodes.Error);
                resData.Messages   = errMsg;
            }
            else
            {
                resData.StatusCode = (int)(StatusCodes.Succuss);
                resData.Messages   = (String)EnumString.GetStringValue(StatusCodes.Succuss);
            }

            resData.Results = ds;
            return(Request.CreateResponse(HttpStatusCode.OK, resData));
        }