public dynamic GetNPCIStatus_helper(AppStatus root)
        {
            dynamic obj = new ExpandoObject();

            try
            {
                DataTable data = GetNPCIStatus_data_helper(root);
                if (data != null)
                {
                    obj.Status  = 100;
                    obj.Reason  = "Data Loaded Successfully.";
                    obj.Details = data;
                }
                else
                {
                    obj.Status = 101;
                    obj.Reason = "No Data Found";
                }
            }
            catch (Exception ex)
            {
                obj.Status = 102;
                obj.Reason = "Error Occured While Getting Data ";
            }

            return(obj);
        }
        public dynamic GetTextileData(AppStatus root)
        {
            dynamic obj = new ExpandoObject();

            try
            {
                DataTable data = GetTextileData_helper(root);
                if (data != null)
                {
                    obj.Status  = "Success";
                    obj.Reason  = "Data Loaded Successfully.";
                    obj.Details = data;
                }
                else
                {
                    obj.Status = "Failure";
                    obj.Reason = "No Data Found";
                }
            }
            catch (Exception ex)
            {
                obj.Status = "Failure";
                obj.Reason = GetException(ex.Message);
            }

            return(obj);
        }
        public DataTable GetTextileData_helper(AppStatus obj)
        {
            try
            {
                var comd = new OracleCommand();

                comd.InitialLONGFetchSize = 1000;
                comd.CommandType          = CommandType.StoredProcedure;
                comd.CommandText          = "COTTEN_PEOPLES_PSS_STATUS";
                comd.Parameters.Add("ftype", OracleDbType.Varchar2).Value      = obj.ftype;
                comd.Parameters.Add("fuid_num", OracleDbType.Varchar2).Value   = obj.fadhar_no;
                comd.Parameters.Add("P_CUR", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

                DataTable data = GetspsDataAdapter(comd);
                if (data != null && data.Rows.Count > 0)
                {
                    return(data);
                }
                else
                {
                    return(null);
                }
            }
            catch (WebException wex)
            {
                string mappath   = HttpContext.Current.Server.MapPath("TextileGetDataExceptionLogs");
                Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, "Error Textile Get Data API:" + wex.Message.ToString()));
                throw wex;
            }
        }
示例#4
0
        public IHttpActionResult GetNPCIStatus(dynamic data)
        {
            string value = token_gen.Authorize_aesdecrpty(data);

            try
            {
                //string value = JsonConvert.SerializeObject(data);
                AppStatus rootobj = JsonConvert.DeserializeObject <AppStatus>(value);
                return(Ok(heahel.GetNPCIStatus_helper(rootobj)));
            }
            catch (Exception ex)
            {
                CatchData.Status = 102;
                CatchData.Reason = "Error Occured While Getting Data ";
                return(Ok(CatchData));
            }
        }
示例#5
0
        public IHttpActionResult GetTextileData(dynamic data)
        {
            string value = token_gen.Authorize_aesdecrpty(data);

            try
            {
                //string value = token_gen.Authorize_aesdecrpty(data);
                //string value = JsonConvert.SerializeObject(data);
                AppStatus rootobj = JsonConvert.DeserializeObject <AppStatus>(value);
                return(Ok(heahel.GetTextileData(rootobj)));
            }
            catch (Exception ex)
            {
                CatchData.Status = "Failure";
                CatchData.Reason = ServicesHelper.ThirdpartyMessage;
                return(Ok(CatchData));
            }
        }