Ejemplo n.º 1
0
    protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        if (e.CommandName == "IsActive")
        {
            objSubscribe = new tblSubscribe();
            if (objSubscribe.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())))
            {
                if (objSubscribe.AppIsActive == true)
                {
                    objSubscribe.AppIsActive = false;
                }
                else if (objSubscribe.AppIsActive == false)
                {
                    objSubscribe.AppIsActive = true;
                }
                objSubscribe.Save();
                LoadDataGrid(false, false);
            }
            objSubscribe = null;
        }

    }
Ejemplo n.º 2
0
    public bool SaveSubscriber()
    {
        objCommon = new clsCommon();
        if (objCommon.IsRecordExists("tblSubscribe", tblSubscribe.ColumnNames.AppEmail, tblSubscribe.ColumnNames.AppSubscribeID, txtUserEmail.Text))
        {
            DisplayInfoSubScribe.ShowMessage("Email address already exist", Enums.MessageType.Error);
            return(false);
        }
        objCommon = null;
        tblSubscribe objNewsLetterSubScriber = new tblSubscribe();

        objNewsLetterSubScriber.AddNew();
        objNewsLetterSubScriber.AppEmail = txtUserEmail.Text.Trim();

        objNewsLetterSubScriber.AppIsActive = true;

        objNewsLetterSubScriber.AppCreatedDate = GetDateTime();
        objNewsLetterSubScriber.Save();
        SendMail(objNewsLetterSubScriber.s_AppSubscribeID);


        objNewsLetterSubScriber = null;
        return(true);
    }