public string GetAllStatus(GetEdiInboundOutbound model) { try { DataSet ds = null; SqlParameter[] Parameters = { new SqlParameter("@FromDate", model.FromDate), new SqlParameter("@ToDate", model.ToDate), new SqlParameter("@Carrier", model.Carrier), new SqlParameter("@Type", model.EventType), new SqlParameter("@MessageTypeCheck", model.MessageTypeCheck), new SqlParameter("@MessageType", model.MessageType), new SqlParameter("@FlightNo", model.FlightNo), new SqlParameter("@AWb", model.AWBNo), new SqlParameter("@Origin", model.CityCode), new SqlParameter("@Status", model.Status), new SqlParameter("@SenderID", model.SenderID) // new SqlParameter("@WhereCondition", CargoFlash.Cargo.Business.Common.Base64ToString(whereCondition)), // new SqlParameter("@UserSNo", (((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo).ToString()) }; ds = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "uspGetEdiInboundOutboundStatus", Parameters); // ds = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "uspGetEdiInboundOutboundStatus1", Parameters); return(CargoFlash.Cargo.Business.Common.CompleteDStoJSONOnlyString(ds)); } catch (Exception ex)// { throw ex; } }
public KeyValuePair <string, List <EdiInboundAndOutboundResult> > GetEdiInboundOutbound(string recid, int pageNo, int pageSize, GetEdiInboundOutbound model, string sort)//(DateTime FromDate, DateTime ToDate, string Carrier, string Type, string MessageType, string FlightNo, string AWbNo, string Airport, string Status) { try { SqlParameter[] Parameters = { new SqlParameter("@FromDate", model.FromDate), new SqlParameter("@ToDate", model.ToDate), new SqlParameter("@Carrier", model.Carrier), new SqlParameter("@Type", model.EventType), new SqlParameter("@MessageTypeCheck", model.MessageTypeCheck), new SqlParameter("@MessageType", model.MessageType), new SqlParameter("@FlightNo", model.FlightNo), new SqlParameter("@FlightDate", model.FlightDate), new SqlParameter("@AWb", model.AWBNo), new SqlParameter("@Origin", model.CityCode), new SqlParameter("@Status", model.Status), new SqlParameter("@SenderID", model.SenderID), new SqlParameter("@PageNo", pageNo), new SqlParameter("@PageSize", pageSize), new SqlParameter("@MessageFormat", model.MessageFormat), // new SqlParameter("@WhereCondition", whereCondition), // new SqlParameter("@WhereCondition", CargoFlash.Cargo.Business.Common.Base64ToString(whereCondition)), new SqlParameter("@OrderBy", sort), new System.Data.SqlClient.SqlParameter("@UserSNo", (((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo).ToString()), new SqlParameter("@Reportfilter", model.Reportfilter) }; DataSet ds = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetEdiInboundOutbound", Parameters); // DataSet ds = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetEdiInboundOutbound_Fortest1", Parameters); var ediInboundOutbound = ds.Tables[0].AsEnumerable().Select(e => new EdiInboundAndOutboundResult { SNo = Convert.ToInt32(e["SNo"]), ActualMessage = e["ActualMessage"].ToString(), AWBNo = e["AWBNo"].ToString(), Carrier = e["Carrier"].ToString(), CityCode = e["CityCode"].ToString(), CitySNo = e["CitySNo"].ToString(), EventDate = e["EventDate"] == DBNull.Value ? "" : Convert.ToDateTime(e["EventDate"].ToString()).ToString("dd-MMM-yyyy HH:mm:ss"), EventType = e["EventType"].ToString(), FlightDate = e["FlightDate"] == DBNull.Value ? "" : Convert.ToDateTime(e["FlightDate"].ToString()).ToString("dd-MMM-yyyy"), FlightNo = e["FlightNo"].ToString(), MessageType = e["MessageType"].ToString(), Reason = e["Reason"].ToString(), SenderID = e["SenderID"].ToString().Replace(',', ' '), Status = e["Status"].ToString(), MessageVersion = e["MessageVersion"].ToString(), ProcessedAt = e["ProcessedAt"] == DBNull.Value ? "" : Convert.ToDateTime(e["ProcessedAt"].ToString()).ToString("dd-MMM-yyyy HH:mm:ss"), }); return(new KeyValuePair <string, List <EdiInboundAndOutboundResult> >(ds.Tables[1].Rows[0][0].ToString(), ediInboundOutbound.AsQueryable().ToList())); } catch (Exception ex)// { throw ex; } }