Esempio n. 1
0
        /// <summary>
        /// 获取交通行程
        /// </summary>
        /// <returns></returns>
        private IList <EyouSoft.Model.PlanStructure.TravelInfo> GetTravelListForXML(string xml)
        {
            if (string.IsNullOrEmpty(xml))
            {
                return(null);
            }
            IList <EyouSoft.Model.PlanStructure.TravelInfo> list = new List <EyouSoft.Model.PlanStructure.TravelInfo>();

            EyouSoft.Model.PlanStructure.TravelInfo item = null;
            System.Xml.Linq.XElement xRoot = System.Xml.Linq.XElement.Parse(xml);
            var xRows = Utils.GetXElements(xRoot, "row");

            foreach (var xRow in xRows)
            {
                item = new EyouSoft.Model.PlanStructure.TravelInfo
                {
                    FilghtNum     = Utils.GetXAttributeValue(xRow, "FilghtNum"),
                    FlightCompany = (EyouSoft.Model.EnumType.PlanStructure.FlightCompany)Convert.ToInt32(Utils.GetXAttributeValue(xRow, "FlightCompany")),
                    AirPlaneType  = Utils.GetXAttributeValue(xRow, "AirPlaneType"),
                    IntervalDays  = Convert.ToInt32(Utils.GetXAttributeValue(xRow, "IntervalDays")),
                    TravelId      = Utils.GetInt(Utils.GetXAttributeValue(xRow, "TravelId")),
                    TrafficId     = Utils.GetInt(Utils.GetXAttributeValue(xRow, "TrafficId")),
                    TrafficType   = (EyouSoft.Model.EnumType.PlanStructure.TrafficType)Convert.ToInt32(Utils.GetXAttributeValue(xRow, "TrafficType")),
                    Space         = (EyouSoft.Model.EnumType.PlanStructure.Space)Convert.ToInt32(Utils.GetXAttributeValue(xRow, "Space")),
                    SerialNum     = Convert.ToInt32(Utils.GetXAttributeValue(xRow, "SerialNum")),
                    LProvinceName = Utils.GetXAttributeValue(xRow, "LProvinceName"),
                    LCityName     = Utils.GetXAttributeValue(xRow, "LCityName"),
                    RProvinceName = Utils.GetXAttributeValue(xRow, "RProvinceName"),
                    RCityName     = Utils.GetXAttributeValue(xRow, "RCityName")
                };
                list.Add(item);
            }
            return(list);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取行程实体
        /// </summary>
        /// <param name="travelID">行程编号</param>
        /// <returns></returns>
        public EyouSoft.Model.PlanStructure.TravelInfo GettravelModel(int travelID)
        {
            EyouSoft.Model.PlanStructure.TravelInfo travelModel = null;
            DbCommand cmd = this._db.GetSqlStringCommand(SQL_TRAVEL_GETTRAVELINFO);

            this._db.AddInParameter(cmd, "TravelId", DbType.Int32, travelID);
            using (IDataReader dr = DbHelper.ExecuteReader(cmd, this._db))
            {
                while (dr.Read())
                {
                    travelModel               = new EyouSoft.Model.PlanStructure.TravelInfo();
                    travelModel.TravelId      = dr.GetInt32(dr.GetOrdinal("TravelId"));
                    travelModel.TrafficId     = dr.GetInt32(dr.GetOrdinal("TrafficId"));
                    travelModel.SerialNum     = !dr.IsDBNull(dr.GetInt32(dr.GetOrdinal("SerialNum"))) ? dr.GetInt32(dr.GetOrdinal("SerialNum")) : 0;
                    travelModel.TrafficType   = (EyouSoft.Model.EnumType.PlanStructure.TrafficType)Convert.ToInt32(dr[dr.GetOrdinal("TrafficType")].ToString());
                    travelModel.LProvince     = !dr.IsDBNull(dr.GetOrdinal("LProvince")) ? dr.GetInt32(dr.GetOrdinal("LProvince")) : 0;
                    travelModel.LCity         = !dr.IsDBNull(dr.GetOrdinal("LCity")) ? dr.GetInt32(dr.GetOrdinal("LCity")) : 0;
                    travelModel.RProvince     = dr.IsDBNull(dr.GetOrdinal("RProvince")) ? 0 : dr.GetInt32(dr.GetOrdinal("RProvince"));
                    travelModel.RCity         = !dr.IsDBNull(dr.GetOrdinal("RCity")) ? dr.GetInt32(dr.GetOrdinal("RCity")) : 0;
                    travelModel.FilghtNum     = !dr.IsDBNull(dr.GetOrdinal("FilghtNum")) ? dr.GetString(dr.GetOrdinal("FilghtNum")) : string.Empty;
                    travelModel.FlightCompany = (EyouSoft.Model.EnumType.PlanStructure.FlightCompany)Convert.ToInt32(dr[dr.GetOrdinal("FlightCompany")].ToString());
                    travelModel.LTime         = !dr.IsDBNull(dr.GetOrdinal("LTime")) ? dr.GetString(dr.GetOrdinal("LTime")) : string.Empty;
                    travelModel.RTime         = !dr.IsDBNull(dr.GetOrdinal("RTime")) ? dr.GetString(dr.GetOrdinal("RTime")) : string.Empty;
                    travelModel.IsStop        = dr.GetString(dr.GetOrdinal("IsStop")) == "1" ? false : true;
                    travelModel.AirPlaneType  = !dr.IsDBNull(dr.GetOrdinal("AirPlaneType")) ? dr.GetString(dr.GetOrdinal("AirPlaneType")) : string.Empty;
                    travelModel.IntervalDays  = !dr.IsDBNull(dr.GetInt32(dr.GetOrdinal("IntervalDays"))) ? dr.GetInt32(dr.GetOrdinal("IntervalDays")) : 0;
                    travelModel.CompanyId     = dr.GetInt32(dr.GetOrdinal("CompanyId"));
                    travelModel.Operater      = dr.GetString(dr.GetOrdinal("Operater"));
                    travelModel.OperaterID    = dr.GetInt32(dr.GetOrdinal("OperaterID"));
                    travelModel.InsueTime     = dr.GetDateTime(dr.GetOrdinal("InsueTime"));
                    travelModel.Space         = (EyouSoft.Model.EnumType.PlanStructure.Space)Convert.ToInt32(dr[dr.GetOrdinal("Space")].ToString());
                }
            }
            return(travelModel);
        }
Esempio n. 3
0
        /// <summary>
        /// 修改交通行程
        /// </summary>
        /// <param name="travelModel">行程实体</param>
        /// <returns>true:成功 false:失败</returns>
        public bool UpdatePlanTravel(EyouSoft.Model.PlanStructure.TravelInfo travelModel)
        {
            DbCommand cmd = this._db.GetStoredProcCommand("proc_Travel_Update");

            this._db.AddInParameter(cmd, "TravelId", DbType.Int32, travelModel.TravelId);
            this._db.AddInParameter(cmd, "TrafficId", DbType.Int32, travelModel.TrafficId);
            this._db.AddInParameter(cmd, "SerialNum", DbType.Int32, travelModel.SerialNum);
            this._db.AddInParameter(cmd, "TrafficType", DbType.Byte, Convert.ToInt32(travelModel.TrafficType));
            this._db.AddInParameter(cmd, "LProvince", DbType.Int32, travelModel.LProvince);
            this._db.AddInParameter(cmd, "LCity", DbType.Int32, travelModel.LCity);
            this._db.AddInParameter(cmd, "RProvince", DbType.Int32, travelModel.RProvince);
            this._db.AddInParameter(cmd, "RCity", DbType.Int32, travelModel.RCity);
            this._db.AddInParameter(cmd, "FilghtNum", DbType.String, travelModel.FilghtNum);
            this._db.AddInParameter(cmd, "FlightCompany", DbType.Byte, Convert.ToInt32(travelModel.FlightCompany));
            this._db.AddInParameter(cmd, "LTime", DbType.String, travelModel.LTime);
            this._db.AddInParameter(cmd, "RTime", DbType.String, travelModel.RTime);
            this._db.AddInParameter(cmd, "IsStop", DbType.Boolean, travelModel.IsStop == true ? 0 : 1);
            this._db.AddInParameter(cmd, "Space", DbType.Byte, Convert.ToInt32(travelModel.Space));
            this._db.AddInParameter(cmd, "AirPlaneType", DbType.String, travelModel.AirPlaneType);
            this._db.AddInParameter(cmd, "IntervalDays", DbType.Int32, travelModel.IntervalDays);
            this._db.AddInParameter(cmd, "CompanyId", DbType.Int32, travelModel.CompanyId);
            this._db.AddInParameter(cmd, "Operater", DbType.String, travelModel.Operater);
            this._db.AddInParameter(cmd, "OperaterID", DbType.Int32, travelModel.OperaterID);
            this._db.AddInParameter(cmd, "InsueTime", DbType.DateTime, travelModel.InsueTime);
            this._db.AddOutParameter(cmd, "result", DbType.Int32, 4);
            DbHelper.RunProcedureWithResult(cmd, this._db);
            return(Convert.ToInt32(this._db.GetParameterValue(cmd, "result")) > 0 ? true : false);
        }
Esempio n. 4
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        protected string PageSave()
        {
            string ret = string.Empty;

            EyouSoft.Model.PlanStructure.TravelInfo travelModel = new EyouSoft.Model.PlanStructure.TravelInfo();
            travelModel.TrafficId     = Utils.GetInt(Utils.GetQueryStringValue("tfID"));
            travelModel.AirPlaneType  = Utils.GetFormValue(this.txtAirPlaneType.UniqueID);
            travelModel.CompanyId     = this.SiteUserInfo.CompanyID;
            travelModel.FilghtNum     = Utils.GetFormValue(this.txtFlightNum.UniqueID);
            travelModel.FlightCompany = (EyouSoft.Model.EnumType.PlanStructure.FlightCompany)Utils.GetInt(Utils.GetFormValue(this.seleLineCompanyNamev.UniqueID));
            travelModel.InsueTime     = DateTime.Now;
            travelModel.IntervalDays  = Utils.GetInt(Utils.GetFormValue(this.txtIntervalDays.UniqueID));
            travelModel.IsStop        = Utils.GetFormValue("IsStop") == "0" ? true : false;
            travelModel.LCity         = ucLCity.CityId;
            travelModel.LProvince     = ucLProvince.ProvinceId;
            travelModel.LTime         = Utils.GetFormValue(this.txtLTime.UniqueID);
            travelModel.RTime         = Utils.GetFormValue(this.txtRTime.UniqueID);
            travelModel.Operater      = this.SiteUserInfo.UserName;
            travelModel.OperaterID    = this.SiteUserInfo.ID;
            travelModel.RCity         = ucRcity.CityId;
            travelModel.RProvince     = ucRprovince.ProvinceId;
            travelModel.SerialNum     = Utils.GetInt(Utils.GetFormValue(this.txtSerialNum.UniqueID));
            travelModel.TrafficType   = (EyouSoft.Model.EnumType.PlanStructure.TrafficType)Utils.GetInt(Utils.GetFormValue(this.seleTfrricType.UniqueID));
            travelModel.Space         = (EyouSoft.Model.EnumType.PlanStructure.Space)Utils.GetInt(Utils.GetFormValue(this.ddlSpace.UniqueID));
            string type = Utils.GetQueryStringValue("type");

            if (!string.IsNullOrEmpty(type))
            {
                bool retult = false;
                if (type == "add")
                {
                    retult = new EyouSoft.BLL.PlanStruture.PlanTrffic().AddPlanTravel(travelModel);
                    if (retult)
                    {
                        ret = "{\"ret\":\"1\",\"msg\":\"添加成功!\"}";
                    }
                    else
                    {
                        ret = "{\"ret\":\"0\",\"msg\":\"添加失败!\"}";
                    }
                }
                else
                {
                    travelModel.TravelId = Utils.GetInt(Utils.GetQueryStringValue("trID"));
                    retult = new EyouSoft.BLL.PlanStruture.PlanTrffic().UpdatePlanTravel(travelModel);
                    if (retult)
                    {
                        ret = "{\"ret\":\"1\",\"msg\":\"修改成功!\"}";
                    }
                    else
                    {
                        ret = "{\"ret\":\"0\",\"msg\":\"修改失败!\"}";
                    }
                }
            }
            return(ret);
        }
Esempio n. 5
0
        /// <summary>
        /// 获取交通行程
        /// </summary>
        /// <param name="PageSize">每页记录数</param>
        /// <param name="PageIndex">总页数</param>
        /// <param name="CompanyID">公司编号</param>
        /// <param name="RecordCount">总记录数</param>
        /// <param name="trfficID">交通编号</param>
        /// <returns>交通行程</returns>
        public IList <EyouSoft.Model.PlanStructure.TravelInfo> GetTravelList(int PageSize, int PageIndex, int CompanyID, ref int RecordCount, int trafficID)
        {
            IList <EyouSoft.Model.PlanStructure.TravelInfo> list = new List <EyouSoft.Model.PlanStructure.TravelInfo>();
            string        tabName    = "tbl_Travel";
            string        fields     = "tbl_Travel.TravelId,tbl_Travel.TrafficId,tbl_Travel.SerialNum,tbl_Travel.TrafficType,tbl_Travel.LProvince,tbl_Travel.LCity,tbl_Travel.RProvince,tbl_Travel.RCity,tbl_Travel.FilghtNum,tbl_Travel.FlightCompany,tbl_Travel.LTime,tbl_Travel.RTime,tbl_Travel.IsStop,tbl_Travel.[Space],tbl_Travel.AirPlaneType,tbl_Travel.IntervalDays,tbl_Travel.CompanyId,tbl_Travel.InsueTime,tbl_Travel.Operater,tbl_Travel.OperaterID,(SELECT CityName FROM tbl_CompanyCity  WHERE tbl_CompanyCity.Id=tbl_Travel.LCity AND tbl_CompanyCity.ProvinceId=tbl_Travel.LProvince) AS LCityName,(SELECT CityName FROM tbl_CompanyCity  WHERE tbl_CompanyCity.Id=tbl_Travel.RCity AND tbl_CompanyCity.ProvinceId=tbl_Travel.RProvince) AS RCityName";
            string        primaryKey = " TravelId ";
            string        orderByStr = " InsueTime DESC ";
            StringBuilder sqlWhere   = new StringBuilder();

            sqlWhere.AppendFormat(" tbl_Travel.TrafficId={0} ", trafficID);
            using (IDataReader dr = DbHelper.ExecuteReader(this._db, PageSize, PageIndex, ref RecordCount, tabName, primaryKey, fields, sqlWhere.ToString(), orderByStr))
            {
                EyouSoft.Model.PlanStructure.TravelInfo model = null;
                while (dr.Read())
                {
                    model = new EyouSoft.Model.PlanStructure.TravelInfo()
                    {
                        AirPlaneType  = !dr.IsDBNull(dr.GetOrdinal("AirPlaneType")) ? dr.GetString(dr.GetOrdinal("AirPlaneType")) : string.Empty,
                        CompanyId     = dr.GetInt32(dr.GetOrdinal("CompanyId")),
                        FilghtNum     = !dr.IsDBNull(dr.GetOrdinal("FilghtNum")) ? dr.GetString(dr.GetOrdinal("FilghtNum")) : string.Empty,
                        FlightCompany = (EyouSoft.Model.EnumType.PlanStructure.FlightCompany)Convert.ToInt32(dr[dr.GetOrdinal("FlightCompany")].ToString()),
                        InsueTime     = dr.GetDateTime(dr.GetOrdinal("InsueTime")),
                        IntervalDays  = !dr.IsDBNull(dr.GetOrdinal("IntervalDays")) ? dr.GetInt32(dr.GetOrdinal("IntervalDays")) : 0,
                        IsStop        = dr.IsDBNull(dr.GetOrdinal("IsStop")) ? false : dr.GetString(dr.GetOrdinal("IsStop")) == "0" ? true : false,
                        TravelId      = dr.GetInt32(dr.GetOrdinal("TravelId")),
                        TrafficType   = (EyouSoft.Model.EnumType.PlanStructure.TrafficType)Convert.ToInt32(dr[dr.GetOrdinal("TrafficType")].ToString()),
                        TrafficId     = Convert.ToInt32(dr["TrafficId"].ToString()),
                        LCity         = dr.GetInt32(dr.GetOrdinal("LCity")),
                        LCityName     = !dr.IsDBNull(dr.GetOrdinal("LCityName")) ? dr.GetString(dr.GetOrdinal("LCityName")) : string.Empty,
                        LProvince     = dr.GetInt32(dr.GetOrdinal("LProvince")),
                        LTime         = !dr.IsDBNull(dr.GetOrdinal("LTime")) ? dr.GetString(dr.GetOrdinal("LTime")) : string.Empty,
                        Operater      = dr.GetString(dr.GetOrdinal("Operater")),
                        OperaterID    = dr.GetInt32(dr.GetOrdinal("OperaterID")),
                        RCity         = dr.GetInt32(dr.GetOrdinal("RCity")),
                        RCityName     = !dr.IsDBNull(dr.GetOrdinal("RCityName")) ? dr.GetString(dr.GetOrdinal("RCityName")) : string.Empty,
                        RProvince     = dr.GetInt32(dr.GetOrdinal("RProvince")),
                        RTime         = !dr.IsDBNull(dr.GetOrdinal("RTime")) ? dr.GetString(dr.GetOrdinal("RTime")) : string.Empty,
                        SerialNum     = dr.GetInt32(dr.GetOrdinal("SerialNum")),
                        Space         = (EyouSoft.Model.EnumType.PlanStructure.Space)Convert.ToInt32(dr[dr.GetOrdinal("Space")].ToString())
                    };
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 6
0
        /// <summary>
        /// 修改交通行程
        /// </summary>
        /// <param name="travelModel">行程实体</param>
        /// <returns>true:成功 false:失败</returns>
        public bool UpdatePlanTravel(EyouSoft.Model.PlanStructure.TravelInfo travelModel)
        {
            if (travelModel == null)
            {
                return(false);
            }
            bool result = Idal.UpdatePlanTravel(travelModel);

            if (result)
            {
                HandleLogsBll.Add(
                    new EyouSoft.Model.CompanyStructure.SysHandleLogs()
                {
                    ModuleId     = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.机票管理_交通管理,
                    EventCode    = Model.CompanyStructure.SysHandleLogsNO.EventCode,
                    EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + Model.EnumType.CompanyStructure.SysPermissionClass.机票管理_交通管理.ToString() + "修改行程!编号为:" + travelModel.TravelId,
                    EventTitle   = "修改" + Model.EnumType.CompanyStructure.SysPermissionClass.机票管理_交通管理.ToString() + "数据"
                });
            }
            return(result);
        }