Exemple #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (txtBody.Text != null && txttitle.Text != null)
        {
            BLL.SuccessStory    adp = new BLL.SuccessStory();
            Common.SuccessStory inf = new Common.SuccessStory();


            DataTable dt = new BLL.SuccessStory().SelectByUserId(int.Parse(Request.Cookies["Id_User"].Value));
            if (dt.Rows.Count == 0)
            {
                inf.admin_active = false;
                inf.body         = txtBody.Text;
                inf.id_user      = int.Parse(Request.Cookies["Id_User"].Value);
                inf.title        = txttitle.Text;

                adp.Insert(inf);
            }
            else
            {
                inf.body    = txtBody.Text;
                inf.id_user = int.Parse(Request.Cookies["Id_User"].Value);
                inf.title   = txttitle.Text;
                inf.id      = int.Parse(dt.Rows[0]["id"].ToString());

                adp.Update(inf);
            }

            Response.Redirect("~/index.aspx?Type=UserProfile");
        }
    }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataTable dt = new BLL.SuccessStory().SelectByUserId(int.Parse(Request.Cookies["Id_User"].Value));
         if (dt.Rows.Count != 0)
         {
             txttitle.Text = dt.Rows[0]["title"].ToString();
             txtBody.Text  = dt.Rows[0]["body"].ToString();
         }
     }
 }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        BLL.Shoping         blfac   = new BLL.Shoping();
        BLL.user            blluser = new BLL.user();
        BLL.Product_Comment bllsup  = new BLL.Product_Comment();
        BLL.SuccessStory    bllsto  = new BLL.SuccessStory();

        lnkNotPay.Text       = string.Format("واریز نشده امروز({0})", blfac.shop_factor_select_nopeyment_today().Rows.Count);
        lnkPayToday.Text     = string.Format("واریز شده امروز({0})", blfac.shop_factor_select_peyment_today().Rows.Count);
        lnkNewUser.Text      = string.Format("کاربر جدید امروز({0})", blluser.shop_user_select_new_today().Rows.Count);
        lnkMessage.Text      = string.Format("نظرجدید({0})", bllsup.select_today().Rows.Count);
        lnkSuccessStory.Text = string.Format("داستان موفقیت({0})", bllsto.DeactiveCount());
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        BLL.SuccessStory bl = new BLL.SuccessStory();
        bool             active;
        int id;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            id     = int.Parse(((Label)GridView1.Rows[i].FindControl("lbActiveState")).Text);
            active = ((CheckBox)GridView1.Rows[i].FindControl("chkState")).Checked;

            bl.UpdateAdminActive(id, active);
        }

        fillgrid();
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id;

        if (Request.QueryString["ID_Story"] != null)
        {
            id = int.Parse(Request.QueryString["ID_Story"]);

            DataTable dt = new BLL.SuccessStory().SelectRow(id);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];

                lbBody.Text         = dr["body"].ToString();
                lbCustomerName.Text = dr["CustomerName"].ToString();
                lbVisit.Text        = dr["visit_count"].ToString();
                lbRegDate.Text      = dr["date_register"].ToString();
                lbtitle.Text        = dr["title"].ToString();

                new BLL.SuccessStory().UpdateVisitor(id);
            }
        }
    }