Exemple #1
0
        public Response EditSO(string token, [FromBody] Aden.Model.SOMastData.SalesOrder so)
        {
            Response response = new Response();

            if (string.IsNullOrEmpty(token) || !token.Equals(_token))
            {
                response.code    = "404";
                response.message = "Invild token";
            }
            else
            {
                bool status = SalesOrderHelper.EditSO(so);

                if (status)
                {
                    response.code = "200";
                }
                else
                {
                    response.code    = "500";
                    response.message = "process failed";
                }
            }
            return(response);
        }
Exemple #2
0
        public Response CreateSO(string token, [FromBody] Aden.Model.SOMastData.SalesOrder so)
        {
            Response response = new Response();

            if (string.IsNullOrEmpty(token) || !token.Equals(_token))
            {
                response.code    = "404";
                response.message = "Invild token";
            }
            else
            {
                string headGuid = SalesOrderHelper.CreateSO(so);

                if (!string.IsNullOrWhiteSpace(headGuid))
                {
                    response.code    = "200";
                    response.content = headGuid;
                }
                else
                {
                    response.code    = "500";
                    response.message = "process failed";
                }
            }
            return(response);
        }
Exemple #3
0
        public Response SOcc(string token, [FromBody] Aden.Model.SOMastData.SalesOrder so)
        {
            Response response = new Response();

            if (string.IsNullOrEmpty(token) || !token.Equals(_token))
            {
                response.code    = "404";
                response.message = "Invalid token";
            }
            else
            {
                List <Aden.Model.SOMastData.SalesOrderItem> SOcc = SalesOrderHelper.SOcc(so.companyCode, so.ownerCompanyCode, so.contract);
                if (SOcc != null)
                {
                    response.code    = "200";
                    response.content = SOcc;
                }
                else
                {
                    response.code    = "500";
                    response.message = "process failed";
                }
            }
            return(response);
        }
Exemple #4
0
        public Response GetSO(string token, string guid)
        {
            Response response = new Response();

            if (string.IsNullOrEmpty(token) || !token.Equals(_token))
            {
                response.code    = "404";
                response.message = "Invild token";
            }
            else
            {
                Aden.Model.SOMastData.SalesOrder so = SalesOrderHelper.GetSO(guid);
                response.code = "200";

                if (so != null)
                {
                    response.code    = "200";
                    response.content = so;
                }
                else
                {
                    response.code = "500";
                }
            }
            return(response);
        }
Exemple #5
0
 /// <summary>
 /// HD by Angel Jiang
 /// </summary>
 /// <param name="db"></param>
 /// <param name="invcompCode"></param>
 /// <param name="customCode"></param>
 /// <param name="contract"></param>
 /// <param name="PaymentCode"></param>
 /// <param name="sDate"></param>
 /// <param name="eDate"></param>
 /// <param name="vDate"></param>
 /// <returns></returns>
 public static List <Model.SOMastData.SalesOrder> HD(Aden.Model.SOMastData.SalesOrder so)
 {
     try
     {
         if (so == null)
         {
             throw new Exception("parameter contains null");
         }
         else
         {
             List <Model.SOMastData.SalesOrder> HD = factory.HD(so);
             return(HD);
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(new Log()
         {
             message = ex.Message
         }, "HD");
         return(null);
     }
 }