コード例 #1
0
        // Changes by Vipin Kumar
        //public KeyValuePair<string, List<ULDMovementHistory>> GetULDMovementHistoryRecord(string recordID, int page, int pageSize, string whereCondition, string sort)
        public KeyValuePair <string, List <ULDMovementHistory> > GetULDMovementHistoryRecord(string recordID, int page, int pageSize, ULDMovement uldMovement, string sort)
        // Ends
        {
            try
            {
                //string FDt = whereCondition.Split('*')[0];
                //string TDt = whereCondition.Split('*')[1];
                //string ULDSno = whereCondition.Split('*')[2];

                //string[] Condition = Condition1.Split('=')[1].ToString();

                //whereCondition = "";

                CargoRankingEI CargoRankingEI = new CargoRankingEI();
                SqlParameter[] Parameters     =
                {
                    //  new  SqlParameter("@AirportCode", AirportCode.Split('-')[0]),
                    //new SqlParameter("@ULDSno", ULDSno) ,
                    //new SqlParameter("@FromDate", Convert.ToDateTime(FDt)),
                    new SqlParameter("@PageNo",   page),
                    new SqlParameter("@PageSize", pageSize),
                    new SqlParameter("@ULDNo",    uldMovement.ULDNo),
                    new SqlParameter("@ToDate",   uldMovement.ToDate),
                    new SqlParameter("@FromDate", uldMovement.FromDate),
                    new SqlParameter("@UserSNo",  ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString())
                };
                DataSet ds = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "UldMovement", Parameters);

                var ULDMovementHistoryList = ds.Tables[0].AsEnumerable().Select(e => new ULDMovementHistory
                {
                    Status                 = Convert.ToString(e["Status"].ToString()),
                    MovementType           = Convert.ToString(e["MovementType"].ToString()),
                    OriginAirPortCode      = Convert.ToString(e["OriginAirPortCode"].ToString()),
                    DestinationAirPortCode = Convert.ToString(e["DestinationAirPortCode"].ToString()),
                    FlightNo               = Convert.ToString(e["FlightNo"].ToString()),
                    FlightDate             = Convert.ToString(e["FlightDate"].ToString()),
                    ULDNo = Convert.ToString(e["ULDNo"].ToString()),

                    ATA = Convert.ToString(e["ATA"].ToString()),
                    ATD = Convert.ToString(e["ATD"].ToString()),
                });
                return(new KeyValuePair <string, List <ULDMovementHistory> >(ds.Tables[1].Rows[0][0].ToString(), ULDMovementHistoryList.AsQueryable().ToList()));
            }
            catch (Exception ex)// (Exception ex)
            {
                // do something for error
                DataSet dsError;
                System.Data.SqlClient.SqlParameter[] ParametersError =
                {
                    new System.Data.SqlClient.SqlParameter("@ErrorMessage", ex.Message),
                    new System.Data.SqlClient.SqlParameter("@ProcName",     "UldMovement"),
                    new System.Data.SqlClient.SqlParameter("@UserSNo",      ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString())
                };
                dsError = CargoFlash.SoftwareFactory.Data.SqlHelper.ExecuteDataset(CargoFlash.SoftwareFactory.Data.DMLConnectionString.WebConfigConnectionString, System.Data.CommandType.StoredProcedure, "ProcOfHandleErrors", ParametersError);
                throw ex;
            }
        }
コード例 #2
0
        public KeyValuePair <string, List <ULDInventory> > GetULDInventoryRecord(string recordID, int page, int pageSize, UldInventory model, string sort)
        {
            try
            {
                CargoRankingEI CargoRankingEI = new CargoRankingEI();

                SqlParameter[] Parameters =
                {
                    new SqlParameter("@Airline",     model.AirlineN),
                    new SqlParameter("@Type",        model.Type),
                    // new SqlParameter("@Airline",model.Air) ,
                    new SqlParameter("@Airportcode", model.Airportcode),
                    new SqlParameter("@ULDNo",       model.ULDNumber),
                    new SqlParameter("@ownercode",   model.ownercode),
                    new  SqlParameter("@Usersno",    ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString())
                };
                string proc = string.Empty;
                if (model.rpt == "1")
                {
                    proc = "GetULDInventory";
                }
                else
                {
                    proc = "GetULDInventoryDetail";
                }

                DataSet ds = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, proc, Parameters);
                var     ULDInventoryList = ds.Tables[0].AsEnumerable().Select(e => new ULDInventory
                {
                    Airline        = Convert.ToString(e["Airline"].ToString()),
                    ULDType        = Convert.ToString(e["ULDType"].ToString()),
                    ULDNo          = Convert.ToString(e["ULDNo"].ToString()),
                    Dt             = Convert.ToString(e["Dt"].ToString()),
                    FlightNo       = Convert.ToString(e["FlightNo"].ToString()),
                    FlightDate     = Convert.ToString(e["FlightDate"].ToString()),
                    CurrentCity    = Convert.ToString(e["CurrentCity"].ToString()),
                    ContentType    = Convert.ToString(e["ContentType"].ToString()),
                    CurrentAirPort = Convert.ToString(e["CurrentAirPort"].ToString())
                });
                return(new KeyValuePair <string, List <ULDInventory> >(ds.Tables[1].Rows[0][0].ToString(), ULDInventoryList.AsQueryable().ToList()));
            }

            catch (Exception ex)// (Exception ex)
            {
                DataSet dsError;
                System.Data.SqlClient.SqlParameter[] ParametersError =
                {
                    new System.Data.SqlClient.SqlParameter("@ErrorMessage", ex.Message),
                    new System.Data.SqlClient.SqlParameter("@ProcName",     "GetULDInventoryDetail"),
                    new System.Data.SqlClient.SqlParameter("@UserSNo",      ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString())
                };
                dsError = CargoFlash.SoftwareFactory.Data.SqlHelper.ExecuteDataset(CargoFlash.SoftwareFactory.Data.DMLConnectionString.WebConfigConnectionString, System.Data.CommandType.StoredProcedure, "ProcOfHandleErrors", ParametersError);
                throw ex;
            }
        }
コード例 #3
0
        public KeyValuePair <string, List <ULDHistory> > GetULDHistoryRecord(string recordID, int page, int pageSize, whereConditionULDHistory model, string sort)
        {
            try
            {
                string FDt    = model.FDate;
                string TDt    = model.TDate;
                string ULDSno = model.ULD;
                System.Web.HttpContext.Current.Session["FDT"]    = FDt;
                System.Web.HttpContext.Current.Session["TDt"]    = TDt;
                System.Web.HttpContext.Current.Session["ULDSno"] = ULDSno;

                CargoRankingEI CargoRankingEI = new CargoRankingEI();
                SqlParameter[] Parameters     =
                {
                    new SqlParameter("@ULDSno",   ULDSno),
                    new SqlParameter("@FromDate", Convert.ToDateTime(FDt)),
                    new SqlParameter("@ToDate",   Convert.ToDateTime(TDt)),
                    new  SqlParameter("@Usersno", ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString())
                };
                DataSet ds             = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetULDHistoryDetail", Parameters);
                var     ULDHistoryList = ds.Tables[0].AsEnumerable().Select(e => new ULDHistory
                {
                    StageSequence = Convert.ToString(e["StageSequence"].ToString()),
                    StageName     = Convert.ToString(e["StageName"].ToString()),
                    StageDate     = Convert.ToString(e["StageDate"].ToString()),
                    GrossWeight   = Convert.ToString(e["GrossWeight"].ToString()),
                    VolumeWeight  = Convert.ToString(e["VolumeWeight"].ToString()),
                    WaybillCount  = Convert.ToString(e["WaybillCount"].ToString()),
                    FlightNo      = Convert.ToString(e["FlightNo"].ToString()),
                    FlightDate    = Convert.ToString(e["FlightDate"].ToString()),
                    UserID        = Convert.ToString(e["UserID"].ToString()),
                    CityCode      = Convert.ToString(e["CityCode"].ToString()),
                    EventTime     = Convert.ToString(e["EventTime"].ToString()),
                    Dt            = Convert.ToString(e["Dt"].ToString()),
                });
                return(new KeyValuePair <string, List <ULDHistory> >(ds.Tables[1].Rows[0][0].ToString(), ULDHistoryList.AsQueryable().ToList()));
            }

            catch (Exception ex)// (Exception ex)
            {
                // do something for error
                DataSet dsError;
                System.Data.SqlClient.SqlParameter[] ParametersError =
                {
                    new System.Data.SqlClient.SqlParameter("@ErrorMessage", ex.Message),
                    new System.Data.SqlClient.SqlParameter("@ProcName",     "GetULDHistoryDetail"),
                    new System.Data.SqlClient.SqlParameter("@UserSNo",      ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString())
                };
                dsError = CargoFlash.SoftwareFactory.Data.SqlHelper.ExecuteDataset(CargoFlash.SoftwareFactory.Data.DMLConnectionString.WebConfigConnectionString, System.Data.CommandType.StoredProcedure, "ProcOfHandleErrors", ParametersError);
                throw ex;
            }
        }
コード例 #4
0
        public List <CargoRankingEI> SearchData(CargoRankingEI obj)
        {
            try
            {
                List <CargoRankingEI> lst = new List <CargoRankingEI>();


                SqlParameter[] Parameters = { new SqlParameter("@FromDt",    Convert.ToDateTime(obj.FromDate)),
                                              new SqlParameter("@ToDt",      Convert.ToDateTime(obj.ToDate)),
                                              new  SqlParameter("@Usersno",  ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString()),
                                              new SqlParameter("@CargoType", obj.CargoType),
                                              new SqlParameter("@Filter",    obj.Filter) };



                string  procname = "GetCommodityCargoRanking";
                DataSet ds       = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, procname, Parameters);
                if (ds != null && ds.Tables.Count > 0)
                {
                    lst = ds.Tables[0].AsEnumerable().Select(e => new CargoRankingEI
                    {
                        CommodityCode        = Convert.ToString(e["CommodityCode"].ToString()),
                        CommodityDescription = Convert.ToString(e["CommodityDescription"].ToString()),
                        Export  = Convert.ToString(e["Export"].ToString()),
                        ERank   = Convert.ToString(e["ERank"].ToString()),
                        Import  = Convert.ToString(e["Import"].ToString()),
                        IRank   = Convert.ToString(e["IRank"].ToString()),
                        Transit = Convert.ToString(e["Transit"].ToString()),
                        RRank   = Convert.ToString(e["RRank"].ToString()),
                        Total   = Convert.ToString(e["Total"].ToString()),
                        Rank    = Convert.ToString(e["TRank"].ToString()),
                        Dt      = Convert.ToString(e["Dt"].ToString())
                    }).ToList();
                }
                return(lst);
            }
            catch (Exception ex)// (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
        public KeyValuePair <string, List <CargoRankingEI> > GetCargoRankingRecord(string recordID, int page, int pageSize, string whereCondition, string sort)
        {
            string FDt    = whereCondition.Split('*')[0];
            string TDt    = whereCondition.Split('*')[1];
            string Ctype  = whereCondition.Split('*')[2];
            string Filter = whereCondition.Split('*')[3];

            whereCondition = "";


            CargoRankingEI CargoRankingEI = new CargoRankingEI();

            SqlParameter[] Parameters =
            {
                new SqlParameter("@FromDt",    Convert.ToDateTime(FDt)),
                new SqlParameter("@ToDt",      Convert.ToDateTime(TDt)),
                new  SqlParameter("@Usersno",  ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString()),
                new SqlParameter("@CargoType", Ctype),
                new SqlParameter("@Filter",    Filter)
            };
            DataSet ds = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetCommodityCargoRanking", Parameters);
            var     CargoRankingEIList = ds.Tables[0].AsEnumerable().Select(e => new CargoRankingEI
            {
                CommodityCode        = Convert.ToString(e["CommodityCode"].ToString()),
                CommodityDescription = Convert.ToString(e["CommodityDescription"].ToString()),
                Export  = Convert.ToString(e["Export"].ToString()),
                ERank   = Convert.ToString(e["ERank"].ToString()),
                Import  = Convert.ToString(e["Import"].ToString()),
                IRank   = Convert.ToString(e["IRank"].ToString()),
                Transit = Convert.ToString(e["Transit"].ToString()),
                RRank   = Convert.ToString(e["RRank"].ToString()),
                Total   = Convert.ToString(e["Total"].ToString()),
                Rank    = Convert.ToString(e["TRank"].ToString()),
                Dt      = Convert.ToString(e["Dt"].ToString())
            });

            return(new KeyValuePair <string, List <CargoRankingEI> >(ds.Tables[1].Rows[0][0].ToString(), CargoRankingEIList.AsQueryable().ToList()));
        }