Ejemplo n.º 1
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public long Add(MobileSoft.Model.HSPR.Tb_HSPR_ParkingCarSignFeesDetail model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@IID",           SqlDbType.BigInt,    8),
                new SqlParameter("@CommID",        SqlDbType.Int,       4),
                new SqlParameter("@CustID",        SqlDbType.BigInt,    8),
                new SqlParameter("@RoomID",        SqlDbType.BigInt,    8),
                new SqlParameter("@CostID",        SqlDbType.BigInt,    8),
                new SqlParameter("@ReceID",        SqlDbType.BigInt,    8),
                new SqlParameter("@RecdID",        SqlDbType.BigInt,    8),
                new SqlParameter("@ParkID",        SqlDbType.BigInt,    8),
                new SqlParameter("@HandID",        SqlDbType.BigInt,    8),
                new SqlParameter("@IsHisFees",     SqlDbType.SmallInt,  2),
                new SqlParameter("@FeesStateDate", SqlDbType.DateTime),
                new SqlParameter("@FeesEndDate",   SqlDbType.DateTime),
                new SqlParameter("@ChargeAmount",  SqlDbType.Decimal, 9)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.CommID;
            parameters[2].Value     = model.CustID;
            parameters[3].Value     = model.RoomID;
            parameters[4].Value     = model.CostID;
            parameters[5].Value     = model.ReceID;
            parameters[6].Value     = model.RecdID;
            parameters[7].Value     = model.ParkID;
            parameters[8].Value     = model.HandID;
            parameters[9].Value     = model.IsHisFees;
            parameters[10].Value    = model.FeesStateDate;
            parameters[11].Value    = model.FeesEndDate;
            parameters[12].Value    = model.ChargeAmount;

            DbHelperSQL.RunProcedure("Proc_Tb_HSPR_ParkingCarSignFeesDetail_ADD", parameters, out rowsAffected);
            return((long)parameters[0].Value);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.HSPR.Tb_HSPR_ParkingCarSignFeesDetail GetModel(long IID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@IID", SqlDbType.BigInt)
            };
            parameters[0].Value = IID;

            MobileSoft.Model.HSPR.Tb_HSPR_ParkingCarSignFeesDetail model = new MobileSoft.Model.HSPR.Tb_HSPR_ParkingCarSignFeesDetail();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_HSPR_ParkingCarSignFeesDetail_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["IID"].ToString() != "")
                {
                    model.IID = long.Parse(ds.Tables[0].Rows[0]["IID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CommID"].ToString() != "")
                {
                    model.CommID = int.Parse(ds.Tables[0].Rows[0]["CommID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CustID"].ToString() != "")
                {
                    model.CustID = long.Parse(ds.Tables[0].Rows[0]["CustID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RoomID"].ToString() != "")
                {
                    model.RoomID = long.Parse(ds.Tables[0].Rows[0]["RoomID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CostID"].ToString() != "")
                {
                    model.CostID = long.Parse(ds.Tables[0].Rows[0]["CostID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ReceID"].ToString() != "")
                {
                    model.ReceID = long.Parse(ds.Tables[0].Rows[0]["ReceID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RecdID"].ToString() != "")
                {
                    model.RecdID = long.Parse(ds.Tables[0].Rows[0]["RecdID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ParkID"].ToString() != "")
                {
                    model.ParkID = long.Parse(ds.Tables[0].Rows[0]["ParkID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["HandID"].ToString() != "")
                {
                    model.HandID = long.Parse(ds.Tables[0].Rows[0]["HandID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsHisFees"].ToString() != "")
                {
                    model.IsHisFees = int.Parse(ds.Tables[0].Rows[0]["IsHisFees"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FeesStateDate"].ToString() != "")
                {
                    model.FeesStateDate = DateTime.Parse(ds.Tables[0].Rows[0]["FeesStateDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FeesEndDate"].ToString() != "")
                {
                    model.FeesEndDate = DateTime.Parse(ds.Tables[0].Rows[0]["FeesEndDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ChargeAmount"].ToString() != "")
                {
                    model.ChargeAmount = decimal.Parse(ds.Tables[0].Rows[0]["ChargeAmount"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }