Beispiel #1
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Add(MobileSoft.Model.Sys.Tb_Sys_TakePicWork model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@StatID",            SqlDbType.BigInt,    8),
                new SqlParameter("@UserCode",          SqlDbType.NVarChar, 20),
                new SqlParameter("@InsBatchFeesCount", SqlDbType.Int,       4),
                new SqlParameter("@InsOneFeesCount",   SqlDbType.Int,       4),
                new SqlParameter("@OffsetPrecCount",   SqlDbType.Int,       4),
                new SqlParameter("@WaivCount",         SqlDbType.Int,       4),
                new SqlParameter("@ReceCount",         SqlDbType.Int,       4),
                new SqlParameter("@RefundCount",       SqlDbType.Int,       4),
                new SqlParameter("@PrecRefundCount",   SqlDbType.Int,       4),
                new SqlParameter("@LeaseContCount",    SqlDbType.Int,       4),
                new SqlParameter("@ContCount",         SqlDbType.Int,       4),
                new SqlParameter("@RoomStateCount",    SqlDbType.Int,       4),
                new SqlParameter("@AskForCount",       SqlDbType.Int,       4),
                new SqlParameter("@PurchaseCount",     SqlDbType.Int,       4),
                new SqlParameter("@InCount",           SqlDbType.Int,       4),
                new SqlParameter("@OutCount",          SqlDbType.Int,       4),
                new SqlParameter("@InventCount",       SqlDbType.Int,       4),
                new SqlParameter("@MaterialTracCount", SqlDbType.Int, 4)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.UserCode;
            parameters[2].Value     = model.InsBatchFeesCount;
            parameters[3].Value     = model.InsOneFeesCount;
            parameters[4].Value     = model.OffsetPrecCount;
            parameters[5].Value     = model.WaivCount;
            parameters[6].Value     = model.ReceCount;
            parameters[7].Value     = model.RefundCount;
            parameters[8].Value     = model.PrecRefundCount;
            parameters[9].Value     = model.LeaseContCount;
            parameters[10].Value    = model.ContCount;
            parameters[11].Value    = model.RoomStateCount;
            parameters[12].Value    = model.AskForCount;
            parameters[13].Value    = model.PurchaseCount;
            parameters[14].Value    = model.InCount;
            parameters[15].Value    = model.OutCount;
            parameters[16].Value    = model.InventCount;
            parameters[17].Value    = model.MaterialTracCount;

            DbHelperSQL.RunProcedure("Proc_Tb_Sys_TakePicWork_ADD", parameters, out rowsAffected);
            return((int)parameters[0].Value);
        }
Beispiel #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.Sys.Tb_Sys_TakePicWork GetModel(long StatID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@StatID", SqlDbType.BigInt)
            };
            parameters[0].Value = StatID;

            MobileSoft.Model.Sys.Tb_Sys_TakePicWork model = new MobileSoft.Model.Sys.Tb_Sys_TakePicWork();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_Sys_TakePicWork_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["StatID"].ToString() != "")
                {
                    model.StatID = long.Parse(ds.Tables[0].Rows[0]["StatID"].ToString());
                }
                model.UserCode = ds.Tables[0].Rows[0]["UserCode"].ToString();
                if (ds.Tables[0].Rows[0]["InsBatchFeesCount"].ToString() != "")
                {
                    model.InsBatchFeesCount = int.Parse(ds.Tables[0].Rows[0]["InsBatchFeesCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["InsOneFeesCount"].ToString() != "")
                {
                    model.InsOneFeesCount = int.Parse(ds.Tables[0].Rows[0]["InsOneFeesCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["OffsetPrecCount"].ToString() != "")
                {
                    model.OffsetPrecCount = int.Parse(ds.Tables[0].Rows[0]["OffsetPrecCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["WaivCount"].ToString() != "")
                {
                    model.WaivCount = int.Parse(ds.Tables[0].Rows[0]["WaivCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ReceCount"].ToString() != "")
                {
                    model.ReceCount = int.Parse(ds.Tables[0].Rows[0]["ReceCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RefundCount"].ToString() != "")
                {
                    model.RefundCount = int.Parse(ds.Tables[0].Rows[0]["RefundCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PrecRefundCount"].ToString() != "")
                {
                    model.PrecRefundCount = int.Parse(ds.Tables[0].Rows[0]["PrecRefundCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["LeaseContCount"].ToString() != "")
                {
                    model.LeaseContCount = int.Parse(ds.Tables[0].Rows[0]["LeaseContCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ContCount"].ToString() != "")
                {
                    model.ContCount = int.Parse(ds.Tables[0].Rows[0]["ContCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RoomStateCount"].ToString() != "")
                {
                    model.RoomStateCount = int.Parse(ds.Tables[0].Rows[0]["RoomStateCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AskForCount"].ToString() != "")
                {
                    model.AskForCount = int.Parse(ds.Tables[0].Rows[0]["AskForCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PurchaseCount"].ToString() != "")
                {
                    model.PurchaseCount = int.Parse(ds.Tables[0].Rows[0]["PurchaseCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["InCount"].ToString() != "")
                {
                    model.InCount = int.Parse(ds.Tables[0].Rows[0]["InCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["OutCount"].ToString() != "")
                {
                    model.OutCount = int.Parse(ds.Tables[0].Rows[0]["OutCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["InventCount"].ToString() != "")
                {
                    model.InventCount = int.Parse(ds.Tables[0].Rows[0]["InventCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["MaterialTracCount"].ToString() != "")
                {
                    model.MaterialTracCount = int.Parse(ds.Tables[0].Rows[0]["MaterialTracCount"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }