Exemple #1
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public void Add(MobileSoft.Model.HSPR.Tb_HSPR_CostStandard model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@StanID",           SqlDbType.BigInt,     8),
                new SqlParameter("@CommID",           SqlDbType.Int,        4),
                new SqlParameter("@CostID",           SqlDbType.BigInt,     8),
                new SqlParameter("@StanSign",         SqlDbType.NVarChar,  20),
                new SqlParameter("@StanName",         SqlDbType.NVarChar,  30),
                new SqlParameter("@StanExplain",      SqlDbType.NVarChar,  50),
                new SqlParameter("@StanFormula",      SqlDbType.NVarChar,  20),
                new SqlParameter("@StanAmount",       SqlDbType.Decimal,    9),
                new SqlParameter("@StanStartDate",    SqlDbType.DateTime),
                new SqlParameter("@StanEndDate",      SqlDbType.DateTime),
                new SqlParameter("@IsCondition",      SqlDbType.SmallInt,   2),
                new SqlParameter("@ConditionField",   SqlDbType.NVarChar,  20),
                new SqlParameter("@DelinRates",       SqlDbType.Decimal,    9),
                new SqlParameter("@DelinDelay",       SqlDbType.Int,        4),
                new SqlParameter("@IsDelete",         SqlDbType.SmallInt,   2),
                new SqlParameter("@IsStanRange",      SqlDbType.SmallInt,   2),
                new SqlParameter("@ChargeCycle",      SqlDbType.Int,        4),
                new SqlParameter("@ManageFeesStyle",  SqlDbType.SmallInt,   2),
                new SqlParameter("@ManageFeesAmount", SqlDbType.Decimal,    9),
                new SqlParameter("@CorpStanID",       SqlDbType.BigInt,     8),
                new SqlParameter("@CorpCostID",       SqlDbType.BigInt,     8),
                new SqlParameter("@AmountRounded",    SqlDbType.Decimal,    9),
                new SqlParameter("@Modulus",          SqlDbType.Decimal,    9),
                new SqlParameter("@DelinType",        SqlDbType.SmallInt,   2),
                new SqlParameter("@DelinDay",         SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.StanID;
            parameters[1].Value  = model.CommID;
            parameters[2].Value  = model.CostID;
            parameters[3].Value  = model.StanSign;
            parameters[4].Value  = model.StanName;
            parameters[5].Value  = model.StanExplain;
            parameters[6].Value  = model.StanFormula;
            parameters[7].Value  = model.StanAmount;
            parameters[8].Value  = model.StanStartDate;
            parameters[9].Value  = model.StanEndDate;
            parameters[10].Value = model.IsCondition;
            parameters[11].Value = model.ConditionField;
            parameters[12].Value = model.DelinRates;
            parameters[13].Value = model.DelinDelay;
            parameters[14].Value = model.IsDelete;
            parameters[15].Value = model.IsStanRange;
            parameters[16].Value = model.ChargeCycle;
            parameters[17].Value = model.ManageFeesStyle;
            parameters[18].Value = model.ManageFeesAmount;
            parameters[19].Value = model.CorpStanID;
            parameters[20].Value = model.CorpCostID;
            parameters[21].Value = model.AmountRounded;
            parameters[22].Value = model.Modulus;
            parameters[23].Value = model.DelinType;
            parameters[24].Value = model.DelinDay;

            DbHelperSQL.RunProcedure("Proc_Tb_HSPR_CostStandard_ADD", parameters, out rowsAffected);
        }
Exemple #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.HSPR.Tb_HSPR_CostStandard GetModel(long StanID)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@StanID", SqlDbType.BigInt)
            };
            parameters[0].Value = StanID;

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["StanID"].ToString() != "")
                {
                    model.StanID = long.Parse(ds.Tables[0].Rows[0]["StanID"].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]["CostID"].ToString() != "")
                {
                    model.CostID = long.Parse(ds.Tables[0].Rows[0]["CostID"].ToString());
                }
                model.StanSign    = ds.Tables[0].Rows[0]["StanSign"].ToString();
                model.StanName    = ds.Tables[0].Rows[0]["StanName"].ToString();
                model.StanExplain = ds.Tables[0].Rows[0]["StanExplain"].ToString();
                model.StanFormula = ds.Tables[0].Rows[0]["StanFormula"].ToString();
                if (ds.Tables[0].Rows[0]["StanAmount"].ToString() != "")
                {
                    model.StanAmount = decimal.Parse(ds.Tables[0].Rows[0]["StanAmount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["StanStartDate"].ToString() != "")
                {
                    model.StanStartDate = DateTime.Parse(ds.Tables[0].Rows[0]["StanStartDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["StanEndDate"].ToString() != "")
                {
                    model.StanEndDate = DateTime.Parse(ds.Tables[0].Rows[0]["StanEndDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsCondition"].ToString() != "")
                {
                    model.IsCondition = int.Parse(ds.Tables[0].Rows[0]["IsCondition"].ToString());
                }
                model.ConditionField = ds.Tables[0].Rows[0]["ConditionField"].ToString();
                if (ds.Tables[0].Rows[0]["DelinRates"].ToString() != "")
                {
                    model.DelinRates = decimal.Parse(ds.Tables[0].Rows[0]["DelinRates"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DelinDelay"].ToString() != "")
                {
                    model.DelinDelay = int.Parse(ds.Tables[0].Rows[0]["DelinDelay"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsDelete"].ToString() != "")
                {
                    model.IsDelete = int.Parse(ds.Tables[0].Rows[0]["IsDelete"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsStanRange"].ToString() != "")
                {
                    model.IsStanRange = int.Parse(ds.Tables[0].Rows[0]["IsStanRange"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ChargeCycle"].ToString() != "")
                {
                    model.ChargeCycle = int.Parse(ds.Tables[0].Rows[0]["ChargeCycle"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ManageFeesStyle"].ToString() != "")
                {
                    model.ManageFeesStyle = int.Parse(ds.Tables[0].Rows[0]["ManageFeesStyle"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ManageFeesAmount"].ToString() != "")
                {
                    model.ManageFeesAmount = decimal.Parse(ds.Tables[0].Rows[0]["ManageFeesAmount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CorpStanID"].ToString() != "")
                {
                    model.CorpStanID = long.Parse(ds.Tables[0].Rows[0]["CorpStanID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CorpCostID"].ToString() != "")
                {
                    model.CorpCostID = long.Parse(ds.Tables[0].Rows[0]["CorpCostID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AmountRounded"].ToString() != "")
                {
                    model.AmountRounded = decimal.Parse(ds.Tables[0].Rows[0]["AmountRounded"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Modulus"].ToString() != "")
                {
                    model.Modulus = decimal.Parse(ds.Tables[0].Rows[0]["Modulus"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DelinType"].ToString() != "")
                {
                    model.DelinType = int.Parse(ds.Tables[0].Rows[0]["DelinType"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DelinDay"].ToString() != "")
                {
                    model.DelinDay = int.Parse(ds.Tables[0].Rows[0]["DelinDay"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }