private void showMarketingAgentData()
    {
        MarketingAgent marketingAgent = new MarketingAgent();

        marketingAgent            = MarketingAgentManager.GetMarketingAgentByMarketingAgentID(Int32.Parse(Request.QueryString["ID"]));
        txtMarketingAgenName.Text = marketingAgent.MarketingAgenName.ToString();
    }
Exemplo n.º 2
0
 public static MarketingAgent GetMarketingAgentByMarketingAgentID(int MarketingAgentID)
 {
     MarketingAgent marketingAgent = new MarketingAgent();
     SqlMarketingAgentProvider sqlMarketingAgentProvider = new SqlMarketingAgentProvider();
     marketingAgent = sqlMarketingAgentProvider.GetMarketingAgentByMarketingAgentID(MarketingAgentID);
     return marketingAgent;
 }
Exemplo n.º 3
0
    public static MarketingAgent GetMarketingAgentByMarketingAgentID(int MarketingAgentID)
    {
        MarketingAgent            marketingAgent            = new MarketingAgent();
        SqlMarketingAgentProvider sqlMarketingAgentProvider = new SqlMarketingAgentProvider();

        marketingAgent = sqlMarketingAgentProvider.GetMarketingAgentByMarketingAgentID(MarketingAgentID);
        return(marketingAgent);
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        MarketingAgent marketingAgent = new MarketingAgent();

        marketingAgent.MarketingAgentID  = int.Parse(Request.QueryString["ID"].ToString());
        marketingAgent.MarketingAgenName = txtMarketingAgenName.Text;
        bool resutl = MarketingAgentManager.UpdateMarketingAgent(marketingAgent);

        Response.Redirect("AdminDisplayMarketingAgent.aspx");
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        MarketingAgent marketingAgent = new MarketingAgent();

//	marketingAgent.MarketingAgentID=  int.Parse(ddlMarketingAgentID.SelectedValue);
        marketingAgent.MarketingAgenName = txtMarketingAgenName.Text;
        int resutl = MarketingAgentManager.InsertMarketingAgent(marketingAgent);

        Response.Redirect("AdminDisplayMarketingAgent.aspx");
    }
Exemplo n.º 6
0
    public bool UpdateMarketingAgent(MarketingAgent marketingAgent)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateMarketingAgent", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MarketingAgentID", SqlDbType.Int).Value       = marketingAgent.MarketingAgentID;
            cmd.Parameters.Add("@MarketingAgenName", SqlDbType.NVarChar).Value = marketingAgent.MarketingAgenName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
Exemplo n.º 7
0
    public int InsertMarketingAgent(MarketingAgent marketingAgent)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertMarketingAgent", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MarketingAgentID", SqlDbType.Int).Direction   = ParameterDirection.Output;
            cmd.Parameters.Add("@MarketingAgenName", SqlDbType.NVarChar).Value = marketingAgent.MarketingAgenName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["@MarketingAgentID"].Value);
        }
    }
Exemplo n.º 8
0
    public MarketingAgent GetMarketingAgentFromReader(IDataReader reader)
    {
        try
        {
            MarketingAgent marketingAgent = new MarketingAgent
                                            (

                DataAccessObject.IsNULL <int>(reader["MarketingAgentID"]),
                DataAccessObject.IsNULL <string>(reader["MarketingAgenName"])
                                            );
            return(marketingAgent);
        }
        catch (Exception ex)
        {
            return(null);
        }
    }
Exemplo n.º 9
0
 public static bool UpdateMarketingAgent(MarketingAgent marketingAgent)
 {
     SqlMarketingAgentProvider sqlMarketingAgentProvider = new SqlMarketingAgentProvider();
     return sqlMarketingAgentProvider.UpdateMarketingAgent(marketingAgent);
 }
Exemplo n.º 10
0
 public static int InsertMarketingAgent(MarketingAgent marketingAgent)
 {
     SqlMarketingAgentProvider sqlMarketingAgentProvider = new SqlMarketingAgentProvider();
     return sqlMarketingAgentProvider.InsertMarketingAgent(marketingAgent);
 }
Exemplo n.º 11
0
    public MarketingAgent GetMarketingAgentFromReader(IDataReader reader)
    {
        try
        {
            MarketingAgent marketingAgent = new MarketingAgent
                (

                     DataAccessObject.IsNULL<int>(reader["MarketingAgentID"]),
                     DataAccessObject.IsNULL<string>(reader["MarketingAgenName"])
                );
             return marketingAgent;
        }
        catch(Exception ex)
        {
            return null;
        }
    }
Exemplo n.º 12
0
    public bool UpdateMarketingAgent(MarketingAgent marketingAgent)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateMarketingAgent", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MarketingAgentID", SqlDbType.Int).Value = marketingAgent.MarketingAgentID;
            cmd.Parameters.Add("@MarketingAgenName", SqlDbType.NVarChar).Value = marketingAgent.MarketingAgenName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Exemplo n.º 13
0
    public int InsertMarketingAgent(MarketingAgent marketingAgent)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertMarketingAgent", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MarketingAgentID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@MarketingAgenName", SqlDbType.NVarChar).Value = marketingAgent.MarketingAgenName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return (int)cmd.Parameters["@MarketingAgentID"].Value;
        }
    }
Exemplo n.º 14
0
    public static bool UpdateMarketingAgent(MarketingAgent marketingAgent)
    {
        SqlMarketingAgentProvider sqlMarketingAgentProvider = new SqlMarketingAgentProvider();

        return(sqlMarketingAgentProvider.UpdateMarketingAgent(marketingAgent));
    }
Exemplo n.º 15
0
    public static int InsertMarketingAgent(MarketingAgent marketingAgent)
    {
        SqlMarketingAgentProvider sqlMarketingAgentProvider = new SqlMarketingAgentProvider();

        return(sqlMarketingAgentProvider.InsertMarketingAgent(marketingAgent));
    }