private void SetActionSession(byte campaign_type, string val1, string post_id, string post_text, string post_url, string displayval1, string post_image_url)
    {
        campaign_action ca = new campaign_action();

        ca = new campaign_action();
        ca.campaign_type = campaign_type;
        if (SessionState._Campaign.actions[ca.campaign_type] != null)
        {
            ca.action_id = SessionState._Campaign.actions[ca.campaign_type].action_id;
        }
        ca.val1 = val1;
        ca.val2 = post_id;
        ca.val3 = post_text;
        ca.val4 = post_url;
        ca.val5 = post_text;
        ca.val6 = post_image_url;
        ca.displayval1 = displayval1;
        SessionState._Campaign.actions[ca.campaign_type] = ca;
    }
    private void SetActionSession(byte campaign_type, string val1, string val2, string val3, string val4, string displayval1)
    {
        campaign_action ca = new campaign_action();

        ca = new campaign_action();
        ca.campaign_type = campaign_type;
        if (SessionState._Campaign.actions[ca.campaign_type] != null)
        {
            ca.action_id = SessionState._Campaign.actions[ca.campaign_type].action_id;
        }
        ca.val1 = val1;
        ca.val2 = val2;
        ca.val3 = val3;
        ca.val4 = val4;
        ca.displayval1 = displayval1;
        SessionState._Campaign.actions[ca.campaign_type] = ca;
    }
    private void SetPanelFBSession()
    {
        campaign_action ca = new campaign_action();
        ca.campaign_type = SessionState._Campaign.campaign_objective;
        if (SessionState._Campaign.actions[ca.campaign_type] != null)
        {
            ca.action_id = SessionState._Campaign.actions[ca.campaign_type].action_id;
        }

        if (DrpPages1.Items.Count <= 0)
        {
            ca.val1 = "0";
            ca.val4 = "";
        }
        else
        {
            SqlCommand cmd = new SqlCommand("sp_select_brands_pages");
            cmd.Parameters.AddWithValue("@page_id", Convert.ToInt16(DrpPages1.SelectedValue));
            ConnObj.GetDataSet(cmd);
            if (ConnObj.IsSuccess && ConnObj.DataSet.Tables.Count > 0 && ConnObj.DataSet.Tables[0].Rows.Count > 0)
            {
                ca.val1 = Convert.ToString(DrpPages1.SelectedValue);
                ca.displayval1 = Convert.ToString(ConnObj.DataSet.Tables[0].Rows[0]["page_url"]);
                ca.val4 = Convert.ToString(ConnObj.DataSet.Tables[0].Rows[0]["page_name"]);
                lblTag1.Text = "@" + ca.val4;
            }
        }

        ca.val2 = txtHashtags4.Text.Trim();
        ca.val3 = txtDefaultText.Text.Trim();

        SessionState._Campaign.actions[ca.campaign_type] = ca;
    }
    private void SetPanel1Session()
    {
        SqlCommand cmd = new SqlCommand("sp_select_brands_pages");
        cmd.Parameters.AddWithValue("@page_id", Convert.ToInt16(DrpPages1.SelectedValue));
        ConnObj.GetDataSet(cmd);

        if (ConnObj.IsSuccess && ConnObj.DataSet.Tables.Count > 0 && ConnObj.DataSet.Tables[0].Rows.Count > 0)
        {
            campaign_action ca = new campaign_action();
            ca.campaign_type = campaign_type_1;
            if (SessionState._Campaign.actions[ca.campaign_type] != null)
            {
                ca.action_id = SessionState._Campaign.actions[ca.campaign_type].action_id;
            }
            ca.val1 = Convert.ToString(DrpPages1.SelectedValue);
            ca.val2 = Convert.ToString(ConnObj.DataSet.Tables[0].Rows[0]["sm_page_id"]);
            ca.val3 = "";
            ca.val4 = "";
            ca.displayval1 = Convert.ToString(ConnObj.DataSet.Tables[0].Rows[0]["page_url"]);
            SessionState._Campaign.actions[ca.campaign_type] = ca;
        }
    }
    private void FillControls()
    {
        GetCampaignBasicDetails();
        GetCampaignTargetDetails();

        txtCampaignName1.Text = SessionState._Campaign.campaign_name;
        txtOverallBudget.Text = Convert.ToString(SessionState._Campaign.overall_budget);
        txtMaxBrandyyPoints.Text = Convert.ToString(SessionState._Campaign.max_brandyy_points);

        txtStartDate1.Text = Convert.ToString(SessionState._Campaign.campaign_start);
        txtEndDate1.Text = Convert.ToString(SessionState._Campaign.campaign_end);

        txtRewardWhom_2.Text = Convert.ToString(SessionState._Campaign.reward_whom_2_nth);
        txtRewardWhom_3_1.Text = SessionState._Campaign.reward_whom_3_no_of;
        txtRewardWhom_3_2.Text = SessionState._Campaign.reward_whom_3_max;
        drpRewardWhnType.SelectedValue = Convert.ToString(SessionState._Campaign.reward_when_type);
        txtRewardWhenDate.Text = Convert.ToString(SessionState._Campaign.reward_when_date);

        switch (SessionState._Campaign.reward_whom)
        {
            case 1: radio1.Checked = true; break;
            case 2: radio2.Checked = true; break;
            case 3: radio3.Checked = true; break;
        }

        if (SessionState._Campaign.reward_when_type == 3)
        {
            divRewardWhenDate.Visible = true;
        }

        #region schedule dates
        if (SessionState._Campaign.schedule_type == 1)
        {
            rdScheduleDaily.Checked = true;

        }
        else
        {
            rdScheduleDateBased.Checked = true;
            divScheduleDates.Visible = true;
        }
        #endregion

        // fill action details
        SqlCommand cmd = new SqlCommand("sp_Brand_GetCampaign_Actions");
        cmd.Parameters.AddWithValue("@campaign_id", Convert.ToInt32(SessionState._Campaign.campaign_id));
        cmd.Parameters.AddWithValue("@campaign_type", 0);
        ConnObj.GetDataSet(cmd);

        SessionState._Campaign.actions = new campaign_action[Convert.ToInt16(System.Configuration.ConfigurationManager.AppSettings["campaign_type_max_cnt"])];
        if (ConnObj.IsSuccess && ConnObj.DataSet.Tables.Count > 0 && ConnObj.DataSet.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow dr in ConnObj.DataSet.Tables[0].Rows)
            {
                campaign_action ca = new campaign_action();
                ca.action_id = Convert.ToInt64(dr["action_id"]);
                ca.campaign_type = Convert.ToByte(dr["campaign_type"]);
                ca.val1 = Convert.ToString(dr["val_1"]);
                ca.val2 = Convert.ToString(dr["val_2"]);
                ca.val3 = Convert.ToString(dr["val_3"]);
                ca.val4 = Convert.ToString(dr["val_4"]);
                ca.displayval1 = "";
                SessionState._Campaign.actions[ca.campaign_type] = ca;
            }
        }
    }