示例#1
0
        //---------------------------------------------------------------------------------------------------------
        public static DataSet GetList(ClExplanPrice c)
        {
            SqlCommand cmd = new SqlCommand("PRC_ExplanPrice_GetList", cnn);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("UserIDLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetUserID();
            cmd.Parameters.Add(new SqlParameter("IpLog", SqlDbType.NVarChar)).Value     = CSharp.PublicFunction.GetIPAddress();
            cmd.Parameters.Add(new SqlParameter("OSLog", SqlDbType.NVarChar)).Value     = CSharp.PublicFunction.GetOS();
            cmd.Parameters.Add(new SqlParameter("OSVerLog", SqlDbType.NVarChar)).Value  = CSharp.PublicFunction.GetBrowser() + CSharp.PublicFunction.GetBrowserVersion();
            cmd.Parameters.Add(new SqlParameter("URLLog", SqlDbType.NVarChar)).Value    = CSharp.PublicFunction.GetURL();

            cmd.Parameters.Add(new SqlParameter("ExplanPriceID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.ExplanPriceID);
            cmd.Parameters.Add(new SqlParameter("ExplanID", SqlDbType.Int)).Value      = Securenamespace.SecureData.CheckSecurity(c.ExplanID);
            cmd.Parameters.Add(new SqlParameter("PriceExplan", SqlDbType.Int)).Value   = Securenamespace.SecureData.CheckSecurity(c.PriceExplan);
            cmd.Parameters.Add(new SqlParameter("RepeatExplan", SqlDbType.Int)).Value  = Securenamespace.SecureData.CheckSecurity(c.RepeatExplan);
            cmd.Parameters.Add(new SqlParameter("AgreementID", SqlDbType.Int)).Value   = Securenamespace.SecureData.CheckSecurity(c.AgreementID);


            SqlParameter prmResult = new SqlParameter("Result", SqlDbType.Int);

            prmResult.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(prmResult);
            DataSet        ds = new DataSet();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            try
            {
                cnn.Open();
                da.Fill(ds);
                return(ds);
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                cnn.Close();
            }
        }
示例#2
0
        public static int insert(ClExplanPrice c)

        {
            SqlCommand cmd = new SqlCommand("PRC_ExplanPrice_Insert", cnn);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("UserIDLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetUserID();
            cmd.Parameters.Add(new SqlParameter("IpLog", SqlDbType.NVarChar)).Value     = CSharp.PublicFunction.GetIPAddress();
            cmd.Parameters.Add(new SqlParameter("OSLog", SqlDbType.NVarChar)).Value     = CSharp.PublicFunction.GetOS();
            cmd.Parameters.Add(new SqlParameter("OSVerLog", SqlDbType.NVarChar)).Value  = CSharp.PublicFunction.GetBrowser() + CSharp.PublicFunction.GetBrowserVersion();
            cmd.Parameters.Add(new SqlParameter("URLLog", SqlDbType.NVarChar)).Value    = CSharp.PublicFunction.GetURL();


            cmd.Parameters.Add(new SqlParameter("ExplanID", SqlDbType.Int)).Value     = Securenamespace.SecureData.CheckSecurity(c.ExplanID);
            cmd.Parameters.Add(new SqlParameter("PriceExplan", SqlDbType.Int)).Value  = Securenamespace.SecureData.CheckSecurity(c.PriceExplan);
            cmd.Parameters.Add(new SqlParameter("RepeatExplan", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.RepeatExplan);
            cmd.Parameters.Add(new SqlParameter("AgreementID", SqlDbType.Int)).Value  = Securenamespace.SecureData.CheckSecurity(c.AgreementID);


            SqlParameter prmResult = new SqlParameter("Result", SqlDbType.Int);

            prmResult.Direction = ParameterDirection.Output;
            cmd.Parameters.Add(prmResult);
            try
            {
                cnn.Open();
                cmd.ExecuteNonQuery();
                return(Convert.ToInt32(prmResult.Value));
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                cnn.Close();
            }
        }