Пример #1
0
        public bool GetAllProductGYLineList(Mes_ProductGYLineInfo model, ref List <Mes_ProductGYLineInfo> lst, ref string ErrMsg)
        {
            string strSql = string.Empty;

            //strSql = "select * from Mes_GYLine where 1=1 and isdel=1 and rownum < 100 ";
            strSql = "select * from Mes_GYLine where 1=1 and isdel=1 ";
            string strAnd = " and ";

            #region where

            strSql += strAnd;
            strSql += " isMoban = " + model.isMoban + " ";

            if (!string.IsNullOrEmpty(model.gyLineID))
            {
                strSql += strAnd;
                strSql += " gyLineID Like '" + model.gyLineID + "%' ";
            }

            if (!string.IsNullOrEmpty(model.cpCode))
            {
                strSql += strAnd;
                strSql += " cpCode Like '" + model.cpCode + "%' ";
            }

            if (!string.IsNullOrEmpty(model.cpName))
            {
                strSql += strAnd;
                strSql += " cpName Like '" + model.cpName + "%' ";
            }

            if (model.DateFrom.HasValue)
            {
                strSql += strAnd;
                strSql += " CreateTime >= " + model.DateFrom.Value.Date.ToOracleTimeString() + " ";
            }

            if (model.DateTo.HasValue)
            {
                strSql += strAnd;
                strSql += " CreateTime <= " + model.DateTo.Value.Date.AddDays(1).ToOracleTimeString() + " ";
            }

            if (!string.IsNullOrEmpty(model.Creater))
            {
                strSql += strAnd;
                strSql += " Creater Like '" + model.Creater + "%'  ";
            }

            //strSql += " order by id desc ";
            strSql += " order by gyLineID ";
            #endregion

            try
            {
                lst = new List <Mes_ProductGYLineInfo>();
                //GYD
                using (IDataReader dr = dbFactory.ExecuteReader(CommandType.Text, strSql))
                {
                    while (dr.Read())
                    {
                        Mes_ProductGYLineInfo entityGYLine = new Mes_ProductGYLineInfo();

                        entityGYLine.ID          = dr["ID"].ToInt32();
                        entityGYLine.gyLineID    = dr["gyLineID"].ToDBString();
                        entityGYLine.machineType = dr["machineType"].ToDBString();
                        entityGYLine.bbID        = dr["bbID"].ToDBString();
                        entityGYLine.gybbID      = dr["gybbID"].ToDBString();
                        entityGYLine.cpCode      = dr["cpCode"].ToDBString();
                        entityGYLine.cpName      = dr["cpName"].ToDBString();
                        entityGYLine.gyLineName  = dr["gyLineName"].ToDBString();
                        entityGYLine.isNew       = dr["isNew"].ToInt32();
                        entityGYLine.capacity    = dr["capacity"].ToDecimal();
                        entityGYLine.cptype      = dr["cptype"].ToDBString();
                        entityGYLine.Qty         = dr["Qty"].ToInt32();
                        entityGYLine.isMoban     = dr["isMoban"].ToInt32();
                        entityGYLine.remark      = dr["remark"].ToDBString();

                        entityGYLine.Creater    = dr["Creater"].ToDBString();
                        entityGYLine.CreateTime = dr["CreateTime"].ToDateTime();

                        entityGYLine.isDel = dr["isDel"].ToInt32();

                        lst.Add(entityGYLine);
                    }
                }

                if (lst.Count <= 0)
                {
                    ErrMsg = "no data!";
                    return(false);
                }

                return(true);
            }
            catch (Exception ex)
            {
                ErrMsg = ex.Message;
                return(false);
            }
        }
Пример #2
0
        public bool GetAllProductGYLineList(Mes_ProductGYLineInfo model, ref List <Mes_ProductGYLineInfo> lst, ref string ErrMsg)
        {
            Mes_ProductGY_DB mdb = new Mes_ProductGY_DB();

            return(mdb.GetAllProductGYLineList(model, ref lst, ref ErrMsg));
        }