Example #1
0
        public dynamic GenerateDoUrl(ReqDoUrl data)
        {
            dynamic response = null;

            try
            {
                var res = SODAL.ValidateDODetails(data);
                //00 = Success,01 = Not found SalesOrders or CustomerCode
                if (res.Code == "00")
                {
                    response = new RspDoUrl();
                    var    reqParams  = GenerateReqparams(data);
                    string hashParams = Utility.HashData(Guid.NewGuid().ToString());

                    SODAL.InsLogReq(reqParams, hashParams);

                    hashParams       = HttpUtility.UrlEncode(hashParams);
                    response.pageUrl = SysDAL.GetConfig("1002") + hashParams;
                }
                else
                {
                    response                = new ErrorAuthen();
                    response.status         = new StatusError();
                    response.status.code    = res.Code;
                    response.status.message = res.Msg;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(response);
        }
Example #2
0
        public ResponseInfo <ResponseUrl> GenerateSoUrl(RequestUrl data)
        {
            ResponseInfo <ResponseUrl> response = new ResponseInfo <ResponseUrl>();

            try
            {
                var res = SODAL.ValidateSODetails(data);
                response.ResponseCode = res.Code;
                response.ResponseMsg  = res.Msg;
                //00 = Success,01 = Not found SalesOrders or CustomerCode
                if (response.ResponseCode == "00")
                {
                    var    reqParams  = GenerateReqparams(data);
                    string hashParams = Utility.HashData(Guid.NewGuid().ToString());

                    SODAL.InsLogReq(reqParams, hashParams);

                    hashParams                    = HttpUtility.UrlEncode(hashParams);
                    response.ResponseData         = new ResponseUrl();
                    response.ResponseData.pageUrl = System.Configuration.ConfigurationManager.AppSettings["MasterURL"].ToString() + hashParams;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(response);
        }