Esempio n. 1
0
        public GToGEntity Get(string IssueMemoNumber)
        {
            bool isUpdated = false;

            if (!string.IsNullOrEmpty(IssueMemoNumber))
            {
                ManageGtoG manageGtoG = new ManageGtoG();
                AuditLog.WriteError("IssueMemoNumber is : " + IssueMemoNumber);
                //Check issuememo number
                var result = manageGtoG.CheckIssueMemoNumber(IssueMemoNumber);
                if (result.Item1)
                {
                    ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
                    List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                    sqlParameters.Add(new KeyValuePair <string, string>("@DocNumber", IssueMemoNumber));
                    isUpdated = manageSQLConnection.UpdateValues("UpdateGToGAck", sqlParameters);
                    return(GetMessage(IssueMemoNumber, isUpdated));
                }
                else
                {
                    return(result.Item2);
                }
            }
            else
            {
                AuditLog.WriteError("IssueMemoNumber is : " + IssueMemoNumber);
            }

            return(GetNullIssuememo(IssueMemoNumber));
        }
Esempio n. 2
0
        public GToGEntity Post(GToGParameter gtog)
        {
            bool   isUpdated = false;
            string details   = JsonConvert.SerializeObject(gtog);

            AuditLog.WriteError(details);
            if (!string.IsNullOrEmpty(gtog.IssueMemoNumber))
            {
                ManageGtoG manageGtoG = new ManageGtoG();
                //Check issuememo number
                var result = manageGtoG.CheckIssueMemoNumber(gtog.IssueMemoNumber);
                if (result.Item1)
                {
                    ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
                    List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                    sqlParameters.Add(new KeyValuePair <string, string>("@DocNumber", gtog.IssueMemoNumber));
                    isUpdated = manageSQLConnection.UpdateValues("UpdateGToGAck", sqlParameters);
                    return(GetMessage(gtog.IssueMemoNumber, isUpdated));
                }
                else
                {
                    return(result.Item2);
                }
            }
            return(GetNullIssuememo(gtog.IssueMemoNumber));
        }