Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="AnalysisID">    </param>
        /// <returns></returns>
        public static Entity.Monitor GetMonitorByID(int MonitorID)
        {
            Entity.Monitor        entity    = null;
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();

            try
            {
                IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.Text, "Select * from [vMonitor] where MonitorID='" + MonitorID + "'", null);
                while (dataReader.Read())
                {
                    entity               = new Entity.Monitor();
                    entity.MonitorID     = DataHelper.ParseToInt(dataReader["MonitorID"].ToString());
                    entity.PositionName  = dataReader["PositionName"].ToString();
                    entity.DateTime      = DataHelper.ParseToDate(dataReader["DateTime"].ToString());
                    entity.AnalysisManID = DataHelper.ParseToInt(dataReader["AnalysisManID"].ToString());
                    entity.RealName      = dataReader["RealName"].ToString();
                    entity.Status        = DataHelper.ParseToInt(dataReader["Status"].ToString());
                    //entity.CreateDate = DataHelper.ParseToDate(dataReader["CreateDate"].ToString());
                    //entity.CreateUser = dataReader["CreateUser"].ToString();
                    //entity.UpdateDate = DataHelper.ParseToDate(dataReader["UpdateDate"].ToString());
                    //entity.UpdateUser = dataReader["UpdateUser"].ToString();
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                db.Conn.Close();
            }
            return(entity);
        }
Exemplo n.º 2
0
        //public static DataTable QueryFinalWasteLogEx2(string StartTime, string EndTime)
        //{
        //    DataTable dt = new DataTable();
        //    DBOperatorBase db = new DataBase();
        //    IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();
        //    try
        //    {
        //        StringBuilder sb = new StringBuilder();
        //        sb.Append("Select DateTime 日期,PondName as 罐池号,WasteName as 废物名称,FromAmount as 数量,HandleManName as 处置人,ReceiverName as 签收人 from [vFinalWasteLog] where Status=2");
        //        if (!string.IsNullOrEmpty(StartTime))
        //        {
        //            sb.Append(" and DateTime>='" + StartTime + "'");
        //        }
        //        if (!string.IsNullOrEmpty(EndTime))
        //        {
        //            sb.Append(" and DateTime<='" + EndTime + "'");
        //        }
        //        sb.Append(" order by DateTime desc");
        //        IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.Text, sb.ToString(), null);
        //        dt = DAL.DataBase.GetDataTableFromIDataReader(dataReader);
        //    }
        //    catch (Exception ex)
        //    {

        //    }
        //    finally
        //    {
        //        db.Conn.Close();
        //    }
        //    return dt;
        //}



        /// <summary>
        ///
        /// </summary>
        /// <param name="DealID">    </param>
        /// <returns></returns>
        public static Entity.FinalWasteLog GetFinalWasteLog(int LogID)
        {
            Entity.FinalWasteLog  entity    = null;
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();

            try
            {
                IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.Text, "Select * from [vFinalWasteLog] where LogID='" + LogID + "'", null);
                while (dataReader.Read())
                {
                    entity           = new Entity.FinalWasteLog();
                    entity.LogID     = DataHelper.ParseToInt(dataReader["LogID"].ToString());
                    entity.LogNumber = DataHelper.ParseToInt(dataReader["LogNumber"].ToString());
                    entity.DateTime  = DataHelper.ParseToDate(dataReader["DateTime"].ToString());
                    entity.IYear     = DataHelper.ParseToInt(dataReader["IYear"].ToString());
                    entity.Number    = DataHelper.ParseToInt(dataReader["Number"].ToString());
                    entity.UserID    = DataHelper.ParseToInt(dataReader["UserID"].ToString());
                    entity.RealName  = dataReader["RealName"].ToString();
                    //entity.CreateDate = DataHelper.ParseToDate(dataReader["CreateDate"].ToString());
                    //entity.CreateUser = dataReader["CreateUser"].ToString();
                    //entity.UpdateDate = DataHelper.ParseToDate(dataReader["UpdateDate"].ToString());
                    //entity.UpdateUser = dataReader["UpdateUser"].ToString();
                    entity.Status = DataHelper.ParseToInt(dataReader["Status"].ToString());
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                db.Conn.Close();
            }
            return(entity);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="DealID">    </param>
        /// <returns></returns>
        public static Entity.WasteToProduct GetWasteToProduct(int DealID)
        {
            Entity.WasteToProduct entity    = null;
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();

            try
            {
                IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.Text, "Select * from [WasteToProduct] where DealID='" + DealID + "'", null);
                while (dataReader.Read())
                {
                    entity               = new Entity.WasteToProduct();
                    entity.DealID        = DataHelper.ParseToInt(dataReader["DealID"].ToString());
                    entity.FromPondID    = DataHelper.ParseToInt(dataReader["FromPondID"].ToString());
                    entity.FromWasteCode = dataReader["FromWasteCode"].ToString();
                    entity.DateTime      = DataHelper.ParseToDate(dataReader["DateTime"].ToString());
                    entity.FromAmount    = decimal.Parse(dataReader["FromAmount"].ToString());
                    entity.HanderManID   = DataHelper.ParseToInt(dataReader["HanderManID"].ToString());
                    entity.ReceiverID    = DataHelper.ParseToInt(dataReader["ReceiverID"].ToString());
                    //entity.CreateDate = DataHelper.ParseToDate(dataReader["CreateDate"].ToString());
                    //entity.CreateUser = dataReader["CreateUser"].ToString();
                    //entity.UpdateDate = DataHelper.ParseToDate(dataReader["UpdateDate"].ToString());
                    //entity.UpdateUser = dataReader["UpdateUser"].ToString();
                    entity.Status = DataHelper.ParseToInt(dataReader["Status"].ToString());
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                db.Conn.Close();
            }
            return(entity);
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="GUID">    </param>
        /// <returns></returns>
        public static Entity.User GetUser(string GUID)
        {
            Entity.User           entity    = null;
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();

            try
            {
                IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.Text, "Select * from [User] where GUID='" + GUID + "'", null);
                while (dataReader.Read())
                {
                    entity            = new Entity.User();
                    entity.ID         = DataHelper.ParseToInt(dataReader["ID"].ToString());
                    entity.UserName   = dataReader["UserName"].ToString();
                    entity.PassWord   = dataReader["PassWord"].ToString();
                    entity.GUID       = dataReader["GUID"].ToString();
                    entity.Department = dataReader["Department"].ToString();
                    entity.RealName   = dataReader["RealName"].ToString();
                    entity.PwdChgDate = DataHelper.ParseToDate(dataReader["PwdChgDate"].ToString());
                    //entity.CreateUser = dataReader["CreateUser"].ToString();
                    //entity.CreateDate = DataHelper.ParseToDate(dataReader["CreateDate"].ToString());
                    //entity.UpdateUser = dataReader["UpdateUser"].ToString();
                    //entity.UpdateDate = DataHelper.ParseToDate(dataReader["UpdateDate"].ToString());
                    entity.IsStop = DataHelper.ParseToBoolean(dataReader["IsStop"].ToString());
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                db.Conn.Close();
            }
            return(entity);
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="StorageID">    </param>
        /// <returns></returns>
        public static Entity.WasteStorage GetWasteStorage(int StorageID)
        {
            Entity.WasteStorage   entity    = null;
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();

            try
            {
                IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.Text, "Select * from [vWasteStorage] where StorageID='" + StorageID + "'", null);
                while (dataReader.Read())
                {
                    entity              = new Entity.WasteStorage();
                    entity.StorageID    = DataHelper.ParseToInt(dataReader["StorageID"].ToString());
                    entity.PlanNumber   = dataReader["PlanNumber"].ToString();
                    entity.PlanID       = DataHelper.ParseToInt(dataReader["PlanID"].ToString());
                    entity.BillNumber   = dataReader["BillNumber"].ToString();
                    entity.DateTime     = DataHelper.ParseToDate(dataReader["DateTime"].ToString());
                    entity.EnterpriseID = DataHelper.ParseToInt(dataReader["EnterpriseID"].ToString());
                    entity.ProduceName  = dataReader["ProduceName"].ToString();
                    entity.WasteCode    = dataReader["WasteCode"].ToString();
                    entity.WasteName    = dataReader["WasteName"].ToString();
                    entity.Amount       = decimal.Parse(dataReader["Amount"].ToString());
                    entity.DriverID     = DataHelper.ParseToInt(dataReader["DriverID"].ToString());
                    entity.RealName     = dataReader["RealName"].ToString();
                    entity.CarID        = DataHelper.ParseToInt(dataReader["CarID"].ToString());
                    entity.CarNumber    = dataReader["CarNumber"].ToString();
                    entity.PondID       = DataHelper.ParseToInt(dataReader["PondID"].ToString());
                    entity.PondName     = dataReader["PondName"].ToString();
                    entity.ReceiverID   = DataHelper.ParseToInt(dataReader["ReceiverID"].ToString());
                    entity.ReceiverName = dataReader["ReceiverName"].ToString();
                    //entity.CreateDate = DataHelper.ParseToDate(dataReader["CreateDate"].ToString());
                    //entity.CreateUser = dataReader["CreateUser"].ToString();
                    //entity.UpdateDate = DataHelper.ParseToDate(dataReader["UpdateDate"].ToString());
                    //entity.UpdateUser = dataReader["UpdateUser"].ToString();
                    entity.Status     = DataHelper.ParseToInt(dataReader["Status"].ToString());
                    entity.StatusName = dataReader["StatusName"].ToString();
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                db.Conn.Close();
            }
            return(entity);
        }
Exemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="EnterpriseID">    </param>
        /// <returns></returns>
        public static Entity.Enterprise GetEnterprise(int EnterpriseID)
        {
            Entity.Enterprise     entity    = null;
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();

            try
            {
                IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.Text, "Select * from [Enterprise] where EnterpriseID='" + EnterpriseID + "'", null);
                while (dataReader.Read())
                {
                    entity = new Entity.Enterprise();
                    entity.EnterpriseID     = DataHelper.ParseToInt(dataReader["EnterpriseID"].ToString());
                    entity.Name             = dataReader["Name"].ToString();
                    entity.LawManCode       = dataReader["LawManCode"].ToString();
                    entity.OrganizationCode = dataReader["OrganizationCode"].ToString();
                    entity.PastName         = dataReader["PastName"].ToString();
                    entity.SetUpDate        = DataHelper.ParseToDate(dataReader["SetUpDate"].ToString());
                    entity.Type             = DataHelper.ParseToInt(dataReader["Type"].ToString());
                    entity.FaxNumber        = dataReader["FaxNumber"].ToString();
                    entity.Industry         = DataHelper.ParseToInt(dataReader["Industry"].ToString());
                    entity.AreaCode         = dataReader["AreaCode"].ToString();
                    entity.PostCode         = dataReader["PostCode"].ToString();
                    entity.Address          = dataReader["Address"].ToString();
                    entity.LawMan           = dataReader["LawMan"].ToString();
                    entity.Email            = dataReader["Email"].ToString();
                    entity.Phone1           = dataReader["Phone1"].ToString();
                    entity.Telphone1        = dataReader["Telphone1"].ToString();
                    //entity.CreateDate = DataHelper.ParseToDate(dataReader["CreateDate"].ToString());
                    //entity.CreateUser = dataReader["CreateUser"].ToString();
                    //entity.UpdateDate = DataHelper.ParseToDate(dataReader["UpdateDate"].ToString());
                    //entity.UpdateUser = dataReader["UpdateUser"].ToString();
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                db.Conn.Close();
            }
            return(entity);
        }
Exemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="PlanID">    </param>
        /// <returns></returns>
        public static Entity.TransferPlan GetTransferPlan(int PlanID)
        {
            Entity.TransferPlan   entity    = null;
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();

            try
            {
                IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.Text, "Select * from [vTransferPlan] where PlanID='" + PlanID + "'", null);
                while (dataReader.Read())
                {
                    entity              = new Entity.TransferPlan();
                    entity.PlanID       = DataHelper.ParseToInt(dataReader["PlanID"].ToString());
                    entity.ContractID   = DataHelper.ParseToInt(dataReader["ContractID"].ToString());
                    entity.PlanNumber   = dataReader["PlanNumber"].ToString();
                    entity.ApprovalDate = DataHelper.ParseToDate(dataReader["ApprovalDate"].ToString());
                    entity.StartDate    = DataHelper.ParseToDate(dataReader["StartDate"].ToString());
                    entity.EndDate      = DataHelper.ParseToDate(dataReader["EndDate"].ToString());
                    entity.PlanAmount   = decimal.Parse(dataReader["PlanAmount"].ToString());
                    entity.WasteCode    = dataReader["WasteCode"].ToString();
                    entity.WasteName    = dataReader["WasteName"].ToString();
                    entity.ProduceID    = DataHelper.ParseToInt(dataReader["ProduceID"].ToString());
                    entity.ProduceName  = dataReader["ProduceName"].ToString();
                    entity.Remark       = dataReader["Remark"].ToString();
                    //entity.CreateUser = dataReader["CreateUser"].ToString();
                    //entity.CreateDate = DataHelper.ParseToDate(dataReader["CreateDate"].ToString());
                    //entity.UpdateUser = dataReader["UpdateUser"].ToString();
                    //entity.UpdateDate = DataHelper.ParseToDate(dataReader["UpdateDate"].ToString());
                    entity.StatusID = DataHelper.ParseToInt(dataReader["StatusID"].ToString());
                    entity.IYear    = DataHelper.ParseToInt(dataReader["IYear"].ToString());
                    entity.Number   = DataHelper.ParseToInt(dataReader["Number"].ToString());
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                db.Conn.Close();
            }
            return(entity);
        }
Exemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static List <Entity.User> GetAllUser()
        {
            List <Entity.User>    list      = new List <Entity.User>();
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();

            try
            {
                IDbDataParameter[] prams =
                {
                };
                IDataReader dataReader = db.ExecuteReader(Config.con, CommandType.StoredProcedure, "proc_User_GetAll", prams);
                while (dataReader.Read())
                {
                    Entity.User entity = new Entity.User();
                    entity.ID       = DataHelper.ParseToInt(dataReader["ID"].ToString());
                    entity.UserName = dataReader["UserName"].ToString();
                    entity.PassWord = dataReader["PassWord"].ToString();
                    entity.GUID     = dataReader["GUID"].ToString();
                    //entity.AreaCode = dataReader["AreaCode"].ToString();
                    //entity.AreaInCharge = dataReader["AreaInCharge"].ToString();
                    entity.RealName   = dataReader["RealName"].ToString();
                    entity.PwdChgDate = DataHelper.ParseToDate(dataReader["PwdChgDate"].ToString());
                    //entity.CreateUser = dataReader["CreateUser"].ToString();
                    //entity.CreateDate = DataHelper.ParseToDate(dataReader["CreateDate"].ToString());
                    //entity.UpdateUser = dataReader["UpdateUser"].ToString();
                    //entity.UpdateDate = DataHelper.ParseToDate(dataReader["UpdateDate"].ToString());
                    entity.IsStop = DataHelper.ParseToBoolean(dataReader["IsStop"].ToString());
                    list.Add(entity);
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                db.Conn.Close();
            }
            return(list);
        }