コード例 #1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(MobileSoft.Model.Sys.Tb_Sys_TakePicContract model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@StatID",          SqlDbType.BigInt,     8),
                new SqlParameter("@StatType",        SqlDbType.SmallInt,   2),
                new SqlParameter("@CommID",          SqlDbType.Int,        4),
                new SqlParameter("@OrganCode",       SqlDbType.NVarChar,  20),
                new SqlParameter("@StatDate",        SqlDbType.DateTime),
                new SqlParameter("@ContractCounts",  SqlDbType.Int,        4),
                new SqlParameter("@ContractCounts1", SqlDbType.Int,        4),
                new SqlParameter("@ContractCounts2", SqlDbType.Int,        4),
                new SqlParameter("@FeesContCounts",  SqlDbType.Int,        4),
                new SqlParameter("@FeesContCounts1", SqlDbType.Int,        4),
                new SqlParameter("@FeesContCounts2", SqlDbType.Int,        4),
                new SqlParameter("@FeesContCounts3", SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.StatID;
            parameters[1].Value  = model.StatType;
            parameters[2].Value  = model.CommID;
            parameters[3].Value  = model.OrganCode;
            parameters[4].Value  = model.StatDate;
            parameters[5].Value  = model.ContractCounts;
            parameters[6].Value  = model.ContractCounts1;
            parameters[7].Value  = model.ContractCounts2;
            parameters[8].Value  = model.FeesContCounts;
            parameters[9].Value  = model.FeesContCounts1;
            parameters[10].Value = model.FeesContCounts2;
            parameters[11].Value = model.FeesContCounts3;

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

            MobileSoft.Model.Sys.Tb_Sys_TakePicContract model = new MobileSoft.Model.Sys.Tb_Sys_TakePicContract();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_Sys_TakePicContract_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());
                }
                if (ds.Tables[0].Rows[0]["StatType"].ToString() != "")
                {
                    model.StatType = int.Parse(ds.Tables[0].Rows[0]["StatType"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CommID"].ToString() != "")
                {
                    model.CommID = int.Parse(ds.Tables[0].Rows[0]["CommID"].ToString());
                }
                model.OrganCode = ds.Tables[0].Rows[0]["OrganCode"].ToString();
                if (ds.Tables[0].Rows[0]["StatDate"].ToString() != "")
                {
                    model.StatDate = DateTime.Parse(ds.Tables[0].Rows[0]["StatDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ContractCounts"].ToString() != "")
                {
                    model.ContractCounts = int.Parse(ds.Tables[0].Rows[0]["ContractCounts"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ContractCounts1"].ToString() != "")
                {
                    model.ContractCounts1 = int.Parse(ds.Tables[0].Rows[0]["ContractCounts1"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ContractCounts2"].ToString() != "")
                {
                    model.ContractCounts2 = int.Parse(ds.Tables[0].Rows[0]["ContractCounts2"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FeesContCounts"].ToString() != "")
                {
                    model.FeesContCounts = int.Parse(ds.Tables[0].Rows[0]["FeesContCounts"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FeesContCounts1"].ToString() != "")
                {
                    model.FeesContCounts1 = int.Parse(ds.Tables[0].Rows[0]["FeesContCounts1"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FeesContCounts2"].ToString() != "")
                {
                    model.FeesContCounts2 = int.Parse(ds.Tables[0].Rows[0]["FeesContCounts2"].ToString());
                }
                if (ds.Tables[0].Rows[0]["FeesContCounts3"].ToString() != "")
                {
                    model.FeesContCounts3 = int.Parse(ds.Tables[0].Rows[0]["FeesContCounts3"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }