Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="offset">记录开始位置</param>
        /// <param name="limit">每页记录条数</param>
        /// <returns></returns>
        public static DataSet GetBriefList1(int offset, int limit, string sort = "RegTime", string order = "desc", string search = "")
        {
            string deorder   = order.ToLower() == "desc" ? "asc" : "desc";
            int    endRecord = offset + limit;
            string sql       = "SELECT * FROM RTKUserInfo w1,( SELECT TOP " + limit + " w.ID FROM( SELECT TOP  " + endRecord + "* FROM RTKUserInfo where UserName like '%" + search + "%' ORDER BY @sort @order) w ORDER BY w.@sort @deorder) w2 WHERE w1.ID = w2.ID ORDER BY w1.@sort @order";

            sql = sql.Replace("@sort", sort);
            sql = sql.Replace("@order", order);
            sql = sql.Replace("@deorder", deorder);
            return(DBHelperSQL.GetDataSet(sql, connectionString));
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="offset">记录开始位置</param>
        /// <param name="limit">每页记录条数</param>
        /// <returns></returns>
        public static DataSet GetBriefList1(int offset, int limit, string sort = "SubmitTime", string order = "desc", string search = "", string strwhere = "1=1")
        {
            string deorder   = order.ToLower() == "desc" ? "asc" : "desc";
            int    endRecord = offset + limit;
            string sql       = "SELECT * FROM InvoiceList w1,( SELECT TOP " + limit + " w.ID FROM( SELECT TOP  " + endRecord + "* FROM InvoiceList where OrderNumber like '%" + search + "%' and " + strwhere + " ORDER BY @sort @order) w ORDER BY w.@sort @deorder) w2 WHERE w1.ID = w2.ID ORDER BY w1.@sort @order";

            sql = sql.Replace("@sort", sort);
            sql = sql.Replace("@order", order);
            sql = sql.Replace("@deorder", deorder);
            return(DBHelperSQL.GetDataSet(sql, connectionString));
        }
Exemplo n.º 3
0
        public static DataSet GetList1(string username)
        {
            string sql = @"select * from RTKUserStatus where UserName in(
                            SELECT r2.UserName
                            FROM[dbo].[RegisterUser]
                                    r1, RTKUserInfo r2
                            WHERE r1.UserName = r2.RegisterUserName
                                AND r2.RegisterUserName ='******')";

            return(DBHelperSQL.GetDataSet(sql, connectionString));
        }
Exemplo n.º 4
0
Arquivo: News.cs Projeto: yxw027/CORS
        /// <summary>
        /// 获得新闻列表
        /// </summary>
        /// <param name="offset">记录开始位置</param>
        /// <param name="limit">每页记录条数</param>
        /// <returns></returns>
        public static DataSet GetBriefList(int offset, int limit)
        {
            int    endRecord = offset + limit;
            string sql       = "SELECT w1.ID,w1.Title,w1.Time,w1.Pageview,w1.Author FROM News w1,( SELECT TOP " + limit + " w.ID FROM( SELECT TOP  " + endRecord + " ID,Title,Time,Pageview,Author FROM News ORDER BY ID ASC) w ORDER BY w.ID DESC) w2 WHERE w1.ID = w2.ID ORDER BY w1.ID ASC";

            //SqlParameter Limit = new SqlParameter("@limit", SqlDbType.NVarChar, 500); Limit.Value = limit;
            //SqlParameter EndRecord = new SqlParameter("@endRecord", SqlDbType.DateTime);
            //EndRecord.Value = endRecord;
            //return DBHelperSQL.GetDataSet(sql, new SqlParameter[] { Limit, EndRecord });
            return(DBHelperSQL.GetDataSet(sql, connectionString));
        }
Exemplo n.º 5
0
        public static DataSet GetList1(string strWhere)
        {
            string strSql = "select Top 3000* from RTKUserPosiRec where ";

            if (strWhere.Trim() != "")
            {
                strSql += strWhere;
            }
            DataSet dd = DBHelperSQL.GetDataSet(strSql, connectionString);

            return(DBHelperSQL.GetDataSet(strSql, connectionString));
        }
Exemplo n.º 6
0
        public static Model.OrderList GetModel(int ID)
        {
            string strSql = "select * from OrderList where ID = '" + ID + "'";

            Model.OrderList model = new Model.OrderList();
            DataSet         ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.OrderNumber = Convert.ToString(ds.Tables[0].Rows[0]["OrderNumber"]);

                model.UserName             = Convert.ToString(ds.Tables[0].Rows[0]["UserName"]);
                model.SubmitTime           = Convert.ToDateTime(ds.Tables[0].Rows[0]["SubmitTime"]);
                model.OrderStatus          = Convert.ToInt32(ds.Tables[0].Rows[0]["OrderStatus"]);
                model.WorkArea             = Convert.ToString(ds.Tables[0].Rows[0]["WorkArea"]);
                model.ServerType           = Convert.ToString(ds.Tables[0].Rows[0]["ServerType"]);
                model.CoorTransEnable      = Convert.ToInt32(ds.Tables[0].Rows[0]["CoorTransEnable"]);
                model.HeightTransEnable    = Convert.ToInt32(ds.Tables[0].Rows[0]["HeightTransEnable"]);
                model.SHPTransEnable       = Convert.ToInt32(ds.Tables[0].Rows[0]["SHPTransEnable"]);
                model.DXFTransEnable       = Convert.ToInt32(ds.Tables[0].Rows[0]["DXFTransEnable"]);
                model.PPPserverEnable      = Convert.ToInt32(ds.Tables[0].Rows[0]["PPPserverEnable"]);
                model.ObsQualityEnable     = Convert.ToInt32(ds.Tables[0].Rows[0]["ObsQualityEnable"]);
                model.BaseLineEnable       = Convert.ToInt32(ds.Tables[0].Rows[0]["BaseLineEnable"]);
                model.MultiBaseLineEnable  = Convert.ToInt32(ds.Tables[0].Rows[0]["MultiBaseLineEnable"]);
                model.CoorSystemEnable     = Convert.ToInt32(ds.Tables[0].Rows[0]["CoorSystemEnable"]);
                model.RoamingServiceEnable = Convert.ToInt32(ds.Tables[0].Rows[0]["RoamingServiceEnable"]);
                model.RoamingServiceArea   = Convert.ToString(ds.Tables[0].Rows[0]["RoamingServiceArea"]);
                model.AccountNum           = Convert.ToInt32(ds.Tables[0].Rows[0]["AccountNum"]);
                model.ServiceDuration      = Convert.ToString(ds.Tables[0].Rows[0]["ServiceDuration"]);
                model.Price               = Convert.ToString(ds.Tables[0].Rows[0]["Price"]);
                model.Dealer              = Convert.ToString(ds.Tables[0].Rows[0]["Dealer"]);
                model.DealTime            = Convert.ToDateTime(ds.Tables[0].Rows[0]["DealTime"]);
                model.PayMethod           = Convert.ToInt32(ds.Tables[0].Rows[0]["PayMethod"]);
                model.TransferCertificate = Convert.ToString(ds.Tables[0].Rows[0]["TransferCertificate"]);
                model.PayTime             = Convert.ToDateTime(ds.Tables[0].Rows[0]["PayTime"]);
                model.RoamID              = Convert.ToString(ds.Tables[0].Rows[0]["RoamID"]);
                model.company             = Convert.ToString(ds.Tables[0].Rows[0]["company"]);
                model.OrderContent        = Convert.ToString(ds.Tables[0].Rows[0]["OrderContent"]);
                model.OrdeType            = Convert.ToInt32(ds.Tables[0].Rows[0]["OrdeType"]);
                model.ElevationEnable     = Convert.ToInt32(ds.Tables[0].Rows[0]["ElevationEnable"]);
                model.IsRenew             = Convert.ToString(ds.Tables[0].Rows[0]["IsRenew"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 7
0
        public static Model.InternetInformation GetModel(int ID)
        {
            string strSql = "select * from InternetInformation where ID = '" + ID + "'";

            Model.InternetInformation model = new Model.InternetInformation();
            DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.Type                   = Convert.ToString(ds.Tables[0].Rows[0]["Type"]);
                model.DataLineStartP         = Convert.ToString(ds.Tables[0].Rows[0]["DataLineStartP"]);
                model.DataLineEndP           = Convert.ToString(ds.Tables[0].Rows[0]["DataLineEndP"]);
                model.EncryptionTechnology   = Convert.ToString(ds.Tables[0].Rows[0]["EncryptionTechnology"]);
                model.BandWidth              = Convert.ToString(ds.Tables[0].Rows[0]["BandWidth"]);
                model.GreenOperator          = Convert.ToString(ds.Tables[0].Rows[0]["GreenOperator"]);
                model.TechnicalSupportStaff  = Convert.ToString(ds.Tables[0].Rows[0]["TechnicalSupportStaff"]);
                model.FDataLineType          = Convert.ToString(ds.Tables[0].Rows[0]["FDataLineType"]);
                model.FEncryptionTechnology  = Convert.ToString(ds.Tables[0].Rows[0]["FEncryptionTechnology"]);
                model.FBandWidth             = Convert.ToString(ds.Tables[0].Rows[0]["FBandWidth"]);
                model.FGreenOperator         = Convert.ToString(ds.Tables[0].Rows[0]["FGreenOperator"]);
                model.FTechnicalSupportStaff = Convert.ToString(ds.Tables[0].Rows[0]["FTechnicalSupportStaff"]);
                model.ServerIP               = Convert.ToString(ds.Tables[0].Rows[0]["ServerIP"]);
                model.ServerPort             = Convert.ToString(ds.Tables[0].Rows[0]["ServerPort"]);
                model.ServerMachineName      = Convert.ToString(ds.Tables[0].Rows[0]["ServerMachineName"]);
                model.ServerLogo             = Convert.ToString(ds.Tables[0].Rows[0]["ServerLogo"]);
                model.ServerUse              = Convert.ToString(ds.Tables[0].Rows[0]["ServerUse"]);
                model.ServerRemark           = Convert.ToString(ds.Tables[0].Rows[0]["ServerRemark"]);
                model.StorageIP              = Convert.ToString(ds.Tables[0].Rows[0]["StorageIP"]);
                model.StoragePort            = Convert.ToString(ds.Tables[0].Rows[0]["StoragePort"]);
                model.StorageMachineName     = Convert.ToString(ds.Tables[0].Rows[0]["StorageMachineName"]);
                model.StorageLogo            = Convert.ToString(ds.Tables[0].Rows[0]["StorageLogo"]);
                model.StorageUse             = Convert.ToString(ds.Tables[0].Rows[0]["StorageUse"]);
                model.StorageRemark          = Convert.ToString(ds.Tables[0].Rows[0]["StorageRemark"]);
                model.EquipmentID            = Convert.ToString(ds.Tables[0].Rows[0]["EquipmentID"]);
                model.EquipConfig            = Convert.ToString(ds.Tables[0].Rows[0]["EquipConfig"]);
                model.Topological            = Convert.ToString(ds.Tables[0].Rows[0]["Topological"]);
                model.RouterConfig           = Convert.ToString(ds.Tables[0].Rows[0]["RouterConfig"]);



                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 从数据库中提取出真参数,用于何冰写的坐标转换程序
        /// </summary>
        /// <param name="YSZBXM"></param>
        /// <param name="MDZBXM"></param>
        /// <returns></returns>
        public static Model.OCoorSysPars GetHBModel(string YSZBXM, string MDZBXM)
        {
            string strSql = "select * from CoorSysPars where YSZBXM ='" + YSZBXM + "' and MDZBXM='" + MDZBXM + "'";

            Model.OCoorSysPars model = new Model.OCoorSysPars();
            DataSet            ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.YSZBXM        = Convert.ToString(ds.Tables[0].Rows[0]["YSZBXM"]);
                model.MDZBXM        = Convert.ToString(ds.Tables[0].Rows[0]["MDZBXM"]);
                model.X             = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["X"].ToString()));
                model.Y             = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["Y"].ToString()));
                model.Z             = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["Z"].ToString()));
                model.aa            = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["aa"].ToString()));
                model.bb            = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["bb"].ToString()));
                model.cc            = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["cc"].ToString()));
                model.m             = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["m"].ToString()));
                model.X             = Math.Round(model.X - 243243.24, 4);
                model.Y             = Math.Round(model.Y - 1983435.23, 4);
                model.Z             = Math.Round(model.Z + 1233234.12, 4);
                model.aa            = Math.Round(model.aa - 76755.99, 8);
                model.bb            = Math.Round(model.bb + 4564543.78, 8);
                model.cc            = Math.Round(model.cc + 321907.65, 8);
                model.m             = Math.Round(model.m - 432487.123, 11);
                model.YSMajorAxis   = Convert.ToDouble(ds.Tables[0].Rows[0]["YSMajorAxis"]);
                model.YSe2          = Convert.ToDouble(ds.Tables[0].Rows[0]["YSe2"]);
                model.MDMajorAxis   = Convert.ToDouble(ds.Tables[0].Rows[0]["MDMajorAxis"]);
                model.MDe2          = Convert.ToDouble(ds.Tables[0].Rows[0]["MDe2"]);
                model.YSRemarkName  = Convert.ToString(ds.Tables[0].Rows[0]["YSRemarkName"]);
                model.MDRemarkName  = Convert.ToString(ds.Tables[0].Rows[0]["MDRemarkName"]);
                model.YSDAlpha      = Convert.ToDouble(ds.Tables[0].Rows[0]["YSDAlpha"]);
                model.YSDAlpha      = 1 / model.YSDAlpha;
                model.MDDAlpha      = Convert.ToDouble(ds.Tables[0].Rows[0]["MDDAlpha"]);
                model.MDDAlpha      = 1 / model.MDDAlpha;
                model.CMeridian     = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["CMeridian"].ToString()));
                model.ProjElevation = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["ProjElevation"].ToString()));
                model.OriginNorth   = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["OriginNorth"].ToString()));
                model.OriginEast    = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["OriginEast"].ToString()));
                model.AreaID        = Convert.ToInt32(ds.Tables[0].Rows[0]["AreaID"].ToString());
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 9
0
        public static DataSet GetBriefList(int offset, int limit, string sort = "ReviceTime", string order = "desc", string Information = "")
        {
            string deorder   = order.ToLower() == "desc" ? "asc" : "desc";
            int    endRecord = offset + limit;
            string sql       = "SELECT * FROM EquipReviceRecord w1,( SELECT TOP @limit w.ID FROM( SELECT TOP  @endRecord * FROM EquipReviceRecord where Information like '%@search%' ORDER BY @sort @order) w ORDER BY w.@sort @deorder) w2 WHERE w1.ID = w2.ID  ORDER BY w1.@sort @order";

            sql = sql.Replace("@limit", limit.ToString());
            sql = sql.Replace("@sort", sort);
            sql = sql.Replace("@endRecord", endRecord.ToString());
            sql = sql.Replace("@order", order);
            sql = sql.Replace("@deorder", deorder);
            sql = sql.Replace("@search", Information);
            DataSet ds = DBHelperSQL.GetDataSet(sql, connectionString);

            return(ds);
        }
Exemplo n.º 10
0
        /// </summary>
        /// <param name="offset">记录开始位置</param>
        /// <param name="limit">每页记录条数</param>
        /// <returns></returns>
        public static DataSet GetListByPage1(int offset, int limit, string username, string sort = "StartTime", string order = "desc", string search = "")
        {
            string deorder   = order.ToLower() == "desc" ? "asc" : "desc";
            int    endRecord = offset + limit;
            string sql       = "SELECT * FROM RTKSurveyRec w1,( SELECT TOP @limit w.ID FROM( SELECT TOP  @endRecord * FROM RTKSurveyRec where @search ORDER BY @sort @order) w ORDER BY w.@sort @deorder) w2 WHERE w1.ID = w2.ID and UserName='******'  ORDER BY w1.@sort @order";

            sql = sql.Replace("@limit", limit.ToString());
            sql = sql.Replace("@sort", sort);
            sql = sql.Replace("@endRecord", endRecord.ToString());
            sql = sql.Replace("@order", order);
            sql = sql.Replace("@deorder", deorder);
            sql = sql.Replace("@search", search);
            DataSet ds = DBHelperSQL.GetDataSet(sql, connectionString);

            return(ds);
        }
Exemplo n.º 11
0
        /// </summary>
        /// <param name="offset">记录开始位置</param>
        /// <param name="limit">每页记录条数</param>
        /// <returns></returns>
        public static DataSet GetListByPage(int offset, int limit, string sort = "Time", string order = "desc", string search = "", string dType = "")
        {
            string deorder   = order.ToLower() == "desc" ? "asc" : "desc";
            int    endRecord = offset + limit;
            string sql       = "SELECT * FROM CoorTransRec w1,( SELECT TOP @limit w.ID FROM( SELECT TOP  @endRecord * FROM CoorTransRec where UserName like '%@search%' and Remark like '%@Type%' ORDER BY @sort @order) w ORDER BY w.@sort @deorder) w2 WHERE w1.ID = w2.ID  ORDER BY w1.@sort @order";

            sql = sql.Replace("@limit", limit.ToString());
            sql = sql.Replace("@sort", sort);
            sql = sql.Replace("@endRecord", endRecord.ToString());
            sql = sql.Replace("@order", order);
            sql = sql.Replace("@deorder", deorder);
            sql = sql.Replace("@search", search);
            sql = sql.Replace("@Type", dType);
            DataSet ds = DBHelperSQL.GetDataSet(sql, connectionString);

            return(ds);
        }
Exemplo n.º 12
0
        public Model.WorkingArea GetModel(string AreaName)
        {
            string strSql = "select * from WorkingArea where AreaName = '" + AreaName + "'";

            Model.WorkingArea model = new Model.WorkingArea();
            DataSet           ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.AreaName = AreaName;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ID         = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);
                model.AreaString = Convert.ToString(ds.Tables[0].Rows[0]["AreaString"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 13
0
        public Model.WorkingArea GetModel(int ID)
        {
            string strSql = "select * from WorkingArea where ID = " + ID.ToString();

            Model.WorkingArea model = new Model.WorkingArea();
            DataSet           ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.AreaName   = Convert.ToString(ds.Tables[0].Rows[0]["AreaName"]);
                model.AreaString = Convert.ToString(ds.Tables[0].Rows[0]["AreaString"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 14
0
        public static Model.SourceTable GetModel(string Source)
        {
            string strSql = "select * from SourceTable where Source = '" + Source + "'";

            Model.SourceTable model = new Model.SourceTable();
            DataSet           ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.Source = Source;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ID         = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);
                model.SourceType = Convert.ToString(ds.Tables[0].Rows[0]["SourceType"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// 得到一个实体对象
        /// </summary>
        /// <param name="ToUser"></param>
        /// <returns></returns>
        public Model.UserMessage GetModel(string ToUser)
        {
            string strSql = "select * from UserMessage where ToUser = '******'";

            Model.UserMessage model = new Model.UserMessage();
            DataSet           ds    = DBHelperSQL.GetDataSet(strSql);

            model.ToUser = ToUser;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ID       = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);
                model.level    = Convert.ToInt32(ds.Tables[0].Rows[0]["level"]);
                model.Title    = Convert.ToString(ds.Tables[0].Rows[0]["Title"]);
                model.Content  = Convert.ToString(ds.Tables[0].Rows[0]["Content"]);
                model.FromUser = Convert.ToString(ds.Tables[0].Rows[0]["FromUser"]);
                model.ToUser   = Convert.ToString(ds.Tables[0].Rows[0]["ToUser"]);

                model.IsRead   = Convert.ToInt32(ds.Tables[0].Rows[0]["IsRead"]);
                model.SentTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["SentTime"]);
                if (ds.Tables[0].Rows[0]["ReadTime"] == null || ds.Tables[0].Rows[0]["ReadTime"].ToString().Trim() == "")
                {
                    model.ReadTime = DateTime.Now;
                }
                else
                {
                    model.ReadTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["ReadTime"]);
                }
                if (ds.Tables[0].Rows[0]["Remark"] == null || ds.Tables[0].Rows[0]["Remark"].ToString().Trim() == "")
                {
                    model.Remark = "";
                }
                else
                {
                    model.Remark = Convert.ToString(ds.Tables[0].Rows[0]["Remark"]);
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="offset">记录开始位置</param>
        /// <param name="limit">每页记录条数</param>
        /// <returns></returns>
        public static DataSet GetListByPage(int offset, int limit, int logType, string sort = "LogTime", string order = "desc")
        {
            string deorder   = order.ToLower() == "desc" ? "asc" : "desc";
            int    endRecord = offset + limit;
            string sql       = "SELECT * FROM SysLog w1,( SELECT TOP @limit w.ID FROM( SELECT TOP  @endRecord * FROM SysLog where LogType = @logType ORDER BY @sort @order) w ORDER BY w.@sort @deorder) w2 WHERE w1.ID = w2.ID  ORDER BY w1.@sort @order";

            sql = sql.Replace("@limit", limit.ToString());
            sql = sql.Replace("@sort", sort);
            sql = sql.Replace("@endRecord", endRecord.ToString());
            sql = sql.Replace("@order", order);
            sql = sql.Replace("@logType", logType.ToString());
            sql = sql.Replace("@deorder", deorder);
            //SqlParameter Limit = new SqlParameter("@limit", SqlDbType.NVarChar, 500); Limit.Value = limit;
            //SqlParameter EndRecord = new SqlParameter("@endRecord", SqlDbType.DateTime);
            //EndRecord.Value = endRecord;
            //return DBHelperSQL.GetDataSet(sql, new SqlParameter[] { Limit, EndRecord });
            DataSet ds = DBHelperSQL.GetDataSet(sql, connectionString);

            return(ds);
        }
Exemplo n.º 17
0
        /// <summary>
        /// 得到一个实体对象
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.SiteMonitoring GetModel(int ID)
        {
            string strSql = "select * from SiteMonitoring where ID = " + ID.ToString();

            Model.SiteMonitoring model = new Model.SiteMonitoring();
            DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.StationOName          = Convert.ToString(ds.Tables[0].Rows[0]["StationOName"]);
                model.SatelliteType         = Convert.ToString(ds.Tables[0].Rows[0]["SatelliteType"]);
                model.Numbering             = Convert.ToString(ds.Tables[0].Rows[0]["Numbering"]);
                model.Track                 = Convert.ToString(ds.Tables[0].Rows[0]["Track"]);
                model.Quantity              = Convert.ToString(ds.Tables[0].Rows[0]["Quantity"]);
                model.Angle                 = Convert.ToString(ds.Tables[0].Rows[0]["Angle"]);
                model.Time                  = Convert.ToDateTime(ds.Tables[0].Rows[0]["Time"]);
                model.Ratio                 = Convert.ToString(ds.Tables[0].Rows[0]["Ratio"]);
                model.StorageEable          = Convert.ToInt32(ds.Tables[0].Rows[0]["StorageEable"]);
                model.DesignCapacity        = Convert.ToString(ds.Tables[0].Rows[0]["DesignCapacity"]);
                model.UsedstorageSpace      = Convert.ToString(ds.Tables[0].Rows[0]["UsedstorageSpace"]);
                model.AvailablestorageSpace = Convert.ToString(ds.Tables[0].Rows[0]["AvailablestorageSpace"]);
                model.ReceiverTemperature   = Convert.ToString(ds.Tables[0].Rows[0]["ReceiverTemperature"]);
                model.ReceiverVoltage       = Convert.ToString(ds.Tables[0].Rows[0]["ReceiverVoltage"]);
                model.ReceiverElectricity   = Convert.ToString(ds.Tables[0].Rows[0]["ReceiverElectricity"]);
                model.ReceiverCPU           = Convert.ToString(ds.Tables[0].Rows[0]["ReceiverCPU"]);
                model.WeatherTemperature    = Convert.ToString(ds.Tables[0].Rows[0]["WeatherTemperature"]);
                model.WeatherVoltage        = Convert.ToString(ds.Tables[0].Rows[0]["WeatherVoltage"]);
                model.WeatherElectricity    = Convert.ToString(ds.Tables[0].Rows[0]["WeatherElectricity"]);
                model.WeatherCPU            = Convert.ToString(ds.Tables[0].Rows[0]["WeatherCPU"]);
                model.UPSTemperature        = Convert.ToString(ds.Tables[0].Rows[0]["UPSTemperature"]);
                model.UPSVoltage            = Convert.ToString(ds.Tables[0].Rows[0]["UPSVoltage"]);
                model.UPSElectricity        = Convert.ToString(ds.Tables[0].Rows[0]["UPSElectricity"]);
                model.UPSCPU                = Convert.ToString(ds.Tables[0].Rows[0]["UPSCPU"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="offset">记录开始位置</param>
        /// <param name="limit">每页记录条数</param>
        /// <returns></returns>
        public static DataSet GetListByPage(int offset, int limit)
        {
            int    endRecord = offset + limit;
            string sql       = "SELECT * FROM CoorSysPars w1,( SELECT TOP " + limit + " w.ID FROM( SELECT TOP  " + endRecord + " * FROM CoorSysPars ORDER BY ID ASC) w ORDER BY w.ID DESC) w2 WHERE w1.ID = w2.ID ORDER BY w1.ID ASC";
            //SqlParameter Limit = new SqlParameter("@limit", SqlDbType.NVarChar, 500); Limit.Value = limit;
            //SqlParameter EndRecord = new SqlParameter("@endRecord", SqlDbType.DateTime);
            //EndRecord.Value = endRecord;
            //return DBHelperSQL.GetDataSet(sql, new SqlParameter[] { Limit, EndRecord });
            DataSet ds = DBHelperSQL.GetDataSet(sql, connectionString);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                //model.YSZBXM = Convert.ToString(ds.Tables[0].Rows[0]["YSZBXM"]);
                //model.MDZBXM = Convert.ToString(ds.Tables[0].Rows[0]["MDZBXM"]);
                if (ds.Tables[0].Rows[i]["YSZBXM"].ToString() != "GD")
                {
                    continue;
                }
                ds.Tables[0].Rows[i]["X"]  = ds.Tables[0].Rows[i]["X"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["X"].ToString());
                ds.Tables[0].Rows[i]["Y"]  = ds.Tables[0].Rows[i]["Y"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["Y"].ToString());
                ds.Tables[0].Rows[i]["Z"]  = ds.Tables[0].Rows[i]["Z"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["Z"].ToString());
                ds.Tables[0].Rows[i]["aa"] = ds.Tables[0].Rows[i]["aa"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["aa"].ToString());
                ds.Tables[0].Rows[i]["bb"] = ds.Tables[0].Rows[i]["bb"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["bb"].ToString());
                ds.Tables[0].Rows[i]["cc"] = ds.Tables[0].Rows[i]["cc"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["cc"].ToString());
                ds.Tables[0].Rows[i]["m"]  = ds.Tables[0].Rows[i]["m"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["m"].ToString());
                ds.Tables[0].Rows[i]["X"]  = ds.Tables[0].Rows[i]["X"].ToString() == "" ? "" : Math.Round(Convert.ToDouble(ds.Tables[0].Rows[i]["X"]) - 243243.24, 4).ToString();
                ds.Tables[0].Rows[i]["Y"]  = ds.Tables[0].Rows[i]["X"].ToString() == "" ? "" : Math.Round(Convert.ToDouble(ds.Tables[0].Rows[i]["Y"]) - 1983435.23, 4).ToString();
                ds.Tables[0].Rows[i]["Z"]  = ds.Tables[0].Rows[i]["X"].ToString() == "" ? "" : Math.Round(Convert.ToDouble(ds.Tables[0].Rows[i]["Z"]) + 1233234.12, 4).ToString();
                ds.Tables[0].Rows[i]["aa"] = ds.Tables[0].Rows[i]["X"].ToString() == "" ? "" : Math.Round(Convert.ToDouble(ds.Tables[0].Rows[i]["aa"]) - 76755.99, 8).ToString();
                ds.Tables[0].Rows[i]["bb"] = ds.Tables[0].Rows[i]["X"].ToString() == "" ? "" : Math.Round(Convert.ToDouble(ds.Tables[0].Rows[i]["bb"]) + 4564543.78, 8).ToString();
                ds.Tables[0].Rows[i]["cc"] = ds.Tables[0].Rows[i]["X"].ToString() == "" ? "" : Math.Round(Convert.ToDouble(ds.Tables[0].Rows[i]["cc"]) + 321907.65, 8).ToString();
                ds.Tables[0].Rows[i]["m"]  = ds.Tables[0].Rows[i]["X"].ToString() == "" ? "" : Math.Round(Convert.ToDouble(ds.Tables[0].Rows[i]["m"]) - 432487.123, 11).ToString();

                ds.Tables[0].Rows[i]["CMeridian"]     = ds.Tables[0].Rows[i]["CMeridian"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["CMeridian"].ToString());
                ds.Tables[0].Rows[i]["ProjElevation"] = ds.Tables[0].Rows[i]["ProjElevation"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["ProjElevation"].ToString());
                ds.Tables[0].Rows[i]["OriginNorth"]   = ds.Tables[0].Rows[i]["OriginNorth"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["OriginNorth"].ToString());
                ds.Tables[0].Rows[i]["OriginEast"]    = ds.Tables[0].Rows[i]["OriginEast"].ToString() == "" ? "" : AES.AESDecrypt(ds.Tables[0].Rows[i]["OriginEast"].ToString());
                ds.Tables[0].Rows[i]["AreaID"]        = ds.Tables[0].Rows[i]["AreaID"].ToString() == "" ? 99999 : ds.Tables[0].Rows[i]["AreaID"];
            }
            return(ds);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 得到一个实体对象
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.SysLog GetModel(int ID)
        {
            string strSql = "select * from SysLog where ID = '" + ID + "'";

            Model.SysLog model = new Model.SysLog();
            DataSet      ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ID       = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);
                model.Remark   = Convert.ToString(ds.Tables[0].Rows[0]["Remark"]);
                model.LogTime  = Convert.ToDateTime(ds.Tables[0].Rows[0]["LogTime"]);
                model.LogType  = Convert.ToInt32(ds.Tables[0].Rows[0]["LogType"]);
                model.UserName = Convert.ToString(ds.Tables[0].Rows[0]["UserName"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 20
0
Arquivo: News.cs Projeto: FineLqy/CQ
        /// <summary>
        /// 得到一个实体对象
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.News GetModel(int ID)
        {
            string strSql = "select * from News where ID = " + ID.ToString();

            Model.News model = new Model.News();
            DataSet    ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.Title   = Convert.ToString(ds.Tables[0].Rows[0]["Title"]);
                model.Author  = Convert.ToString(ds.Tables[0].Rows[0]["Author"]);
                model.Time    = (DateTime)ds.Tables[0].Rows[0]["Time"];
                model.Details = Convert.ToString(ds.Tables[0].Rows[0]["Details"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 21
0
        public static Model.ServiceConnection GetModel(int ID)
        {
            string strSql = "select * from ServiceConnection where ID = '" + ID.ToString() + "'";

            Model.ServiceConnection model = new Model.ServiceConnection();
            DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ServiceName = Convert.ToString(ds.Tables[0].Rows[0]["ServiceName"]);
                model.ServiceIP   = Convert.ToString(ds.Tables[0].Rows[0]["ServiceIP"]);
                model.ServicePort = Convert.ToString(ds.Tables[0].Rows[0]["ServicePort"]);
                model.SourceTable = Convert.ToString(ds.Tables[0].Rows[0]["SourceTable"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 22
0
 /// <summary>
 /// 得到一个实体对象
 /// </summary>
 /// <param name="Id"></param>
 /// <returns></returns>
 public static Model.ResourcesDownload GetModel(int ID)
 {
     string strSql = "select * from ResourcesDownload where ID = " + ID.ToString();
     Model.ResourcesDownload model = new Model.ResourcesDownload();
     DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString);
     model.ID = ID;
     if (ds.Tables[0].Rows.Count > 0)
     {
         model.ResourceName = Convert.ToString(ds.Tables[0].Rows[0]["ResourceName"]);
         model.ResourcePath = Convert.ToString(ds.Tables[0].Rows[0]["ResourcePath"]);
         model.DownloadTimes = Convert.ToInt32(ds.Tables[0].Rows[0]["DownloadTimes"]);
         model.UploadUser = Convert.ToString(ds.Tables[0].Rows[0]["UploadUser"]);
         model.UploadTime = (DateTime)ds.Tables[0].Rows[0]["UploadTime"];
         model.IsDeleted = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsDeleted"]);
         model.Remark = Convert.ToString(ds.Tables[0].Rows[0]["Remark"]);
         return model;
     }
     else
     {
         return null;
     }
 }
Exemplo n.º 23
0
        public static Model.CoorSysPars GetModelFormId(int id)
        {
            string strSql = "select * from CoorSysPars where ID ='" + id + "'";

            Model.CoorSysPars model = new Model.CoorSysPars();
            DataSet           ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.YSZBXM        = Convert.ToString(ds.Tables[0].Rows[0]["YSZBXM"]);
                model.MDZBXM        = Convert.ToString(ds.Tables[0].Rows[0]["MDZBXM"]);
                model.X             = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["X"].ToString()));
                model.Y             = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["Y"].ToString()));
                model.Z             = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["Z"].ToString()));
                model.aa            = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["aa"].ToString()));
                model.bb            = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["bb"].ToString()));
                model.cc            = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["cc"].ToString()));
                model.m             = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["m"].ToString()));
                model.YSMajorAxis   = Convert.ToDouble(ds.Tables[0].Rows[0]["YSMajorAxis"]);
                model.YSe2          = Convert.ToDouble(ds.Tables[0].Rows[0]["YSe2"]);
                model.MDMajorAxis   = Convert.ToDouble(ds.Tables[0].Rows[0]["MDMajorAxis"]);
                model.MDe2          = Convert.ToDouble(ds.Tables[0].Rows[0]["MDe2"]);
                model.YSRemarkName  = Convert.ToString(ds.Tables[0].Rows[0]["YSRemarkName"]);
                model.MDRemarkName  = Convert.ToString(ds.Tables[0].Rows[0]["MDRemarkName"]);
                model.YSDAlpha      = Convert.ToDouble(ds.Tables[0].Rows[0]["YSDAlpha"]);
                model.MDDAlpha      = Convert.ToDouble(ds.Tables[0].Rows[0]["MDDAlpha"]);
                model.CMeridian     = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["CMeridian"].ToString()));
                model.ProjElevation = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["ProjElevation"].ToString()));
                model.OriginNorth   = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["OriginNorth"].ToString()));
                model.OriginEast    = Convert.ToDouble(AES.AESDecrypt(ds.Tables[0].Rows[0]["OriginEast"].ToString()));
                model.AreaID        = Convert.ToInt32(ds.Tables[0].Rows[0]["AreaID"].ToString());
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 24
0
        public static Model.ServiceConfiguration GetModel(int ID)
        {
            string strSql = "select * from ServiceConfiguration where ID = '" + ID + "'";

            Model.ServiceConfiguration model = new Model.ServiceConfiguration();
            DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ServerName         = Convert.ToString(ds.Tables[0].Rows[0]["ServerName"]);
                model.paymentMethod      = Convert.ToString(ds.Tables[0].Rows[0]["paymentMethod"]);
                model.Price              = Convert.ToSingle(ds.Tables[0].Rows[0]["Price"]);
                model.InsertDate         = Convert.ToDateTime(ds.Tables[0].Rows[0]["InsertDate"]);
                model.ProductDescription = Convert.ToString(ds.Tables[0].Rows[0]["ProductDescription"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 25
0
        public static Model.RoamingAreaManagement GetModel()
        {
            string strSql = "select top 1 * from RoamingAreaManagement order by ID desc";

            Model.RoamingAreaManagement model = new Model.RoamingAreaManagement();
            DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString);

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ID         = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);
                model.GroupName  = Convert.ToString(ds.Tables[0].Rows[0]["GroupName"]);
                model.Remark     = Convert.ToString(ds.Tables[0].Rows[0]["Remark"]);
                model.GroupRange = Convert.ToString(ds.Tables[0].Rows[0]["GroupRange"]);
                model.InsertTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["InsertTime"]);

                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// 得到一个实体对象
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.PersonInfo GetModel(string Contact)
        {
            string strSql = "select * from PersonInfo where Contact = '" + Contact + "'";

            Model.PersonInfo model = new Model.PersonInfo();
            DataSet          ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.Contact = Contact;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ID = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);
                model.ContactIDCardNumber = Convert.ToString(ds.Tables[0].Rows[0]["ContactIDCardNumber"]);
                model.ContactIDCardFile   = Convert.ToString(ds.Tables[0].Rows[0]["ContactIDCardFile"]);
                model.CertificationTime   = Convert.ToDateTime(ds.Tables[0].Rows[0]["CertificationTime"]);
                model.BelongArea          = Convert.ToString(ds.Tables[0].Rows[0]["BelongArea"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// 根据ID获取一条信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public static Model.EquipReviceRecord GetModel(int ID)
        {
            string strSql = "select * from EquipReviceRecord where ID ='" + ID + "'";

            Model.EquipReviceRecord model = new Model.EquipReviceRecord();
            DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ReviceTime   = Convert.ToDateTime(ds.Tables[0].Rows[0]["ReviceTime"]);
                model.RevicePerson = Convert.ToString(ds.Tables[0].Rows[0]["RevicePerson"]);
                model.Information  = Convert.ToString(ds.Tables[0].Rows[0]["Information"]);
                model.Contents     = Convert.ToString(ds.Tables[0].Rows[0]["Contents"]);
                model.ReviceID     = Convert.ToString(ds.Tables[0].Rows[0]["ReviceID"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 28
0
        public static Model.CompanyInfo GetModel(int ID)
        {
            string strSql = "select * from CompanyInfo where ID = '" + ID + "'";

            Model.CompanyInfo model = new Model.CompanyInfo();
            DataSet           ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.Company              = Convert.ToString(ds.Tables[0].Rows[0]["Company"]);
                model.Address              = Convert.ToString(ds.Tables[0].Rows[0]["Address"]);
                model.BelongArea           = Convert.ToString(ds.Tables[0].Rows[0]["BelongArea"]);
                model.BusinessLicense      = Convert.ToString(ds.Tables[0].Rows[0]["BusinessLicense"]);
                model.CertificationTime    = Convert.ToDateTime(ds.Tables[0].Rows[0]["CertificationTime"]);
                model.CompanyTel           = Convert.ToString(ds.Tables[0].Rows[0]["CompanyTel"]);
                model.Contact              = Convert.ToString(ds.Tables[0].Rows[0]["Contact"]);
                model.ContactIDCardFile    = Convert.ToString(ds.Tables[0].Rows[0]["ContactIDCardFile"]);
                model.ContactIDCardNumer   = Convert.ToString(ds.Tables[0].Rows[0]["ContactIDCardNumer"]);
                model.Industry             = Convert.ToString(ds.Tables[0].Rows[0]["Industry"]);
                model.LegalIDCardFile      = Convert.ToString(ds.Tables[0].Rows[0]["LegalIDCardFile"]);
                model.LegalIDCardNumber    = Convert.ToString(ds.Tables[0].Rows[0]["LegalIDCardNumber"]);
                model.LegalPerson          = Convert.ToString(ds.Tables[0].Rows[0]["LegalPerson"]);
                model.OrganizationCode     = Convert.ToString(ds.Tables[0].Rows[0]["OrganizationCode"]);
                model.PowerOfAttorney      = Convert.ToString(ds.Tables[0].Rows[0]["PowerOfAttorney"]);
                model.SurveyingFile        = Convert.ToString(ds.Tables[0].Rows[0]["SurveyingFile"]);
                model.SurveyingNumber      = Convert.ToString(ds.Tables[0].Rows[0]["SurveyingNumber"]);
                model.ServiceAgreementFile = Convert.ToString(ds.Tables[0].Rows[0]["ServiceAgreementFile"]);

                model.SurveyingQualification = Convert.ToString(ds.Tables[0].Rows[0]["SurveyingQualification"]);
                model.Balance = Convert.ToSingle(ds.Tables[0].Rows[0]["Balance"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// 得到一个实体对象根据设备名
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.StationEquip GetModel(string MachineName)
        {
            string strSql = "select * from StationEquip where MachineName = '" + MachineName + "'";

            Model.StationEquip model = new Model.StationEquip();
            DataSet            ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.MachineName = MachineName;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ID = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);
                //model.MachineName = Convert.ToString(ds.Tables[0].Rows[0]["MachineName"]);
                model.SerialNumber     = Convert.ToString(ds.Tables[0].Rows[0]["SerialNumber"]);
                model.InstallationDate = Convert.ToDateTime(ds.Tables[0].Rows[0]["InstallationDate"]);
                model.Models           = Convert.ToString(ds.Tables[0].Rows[0]["Models"]);

                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// 得到一个实体对象
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.InvoiceInfo GetModel(string Invoice)
        {
            string strSql = "select * from InvoiceInfo where Invoice = '" + Invoice + "'";

            Model.InvoiceInfo model = new Model.InvoiceInfo();
            DataSet           ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.Invoice = Invoice;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ID          = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]);
                model.TaxNum      = Convert.ToString(ds.Tables[0].Rows[0]["TaxNum"]);
                model.UnitAddress = Convert.ToString(ds.Tables[0].Rows[0]["UnitAddress"]);
                model.Tel         = Convert.ToString(ds.Tables[0].Rows[0]["Tel"]);
                model.Bank        = Convert.ToString(ds.Tables[0].Rows[0]["Bank"]);
                model.AccountNum  = Convert.ToString(ds.Tables[0].Rows[0]["AccountNum"]);
                model.UserName    = Convert.ToString(ds.Tables[0].Rows[0]["UserName"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }