Exemplo n.º 1
0
    protected void lkbUpdate_Click(object sender, EventArgs e)
    {
        List <Int64> offerIds = new List <Int64>();
        //decimal FinalCommision;
        List <Transaction_Feed> feeds = new List <Transaction_Feed>();

        foreach (GridViewRow row in gvItems.Rows)
        {
            if (((CheckBox)row.FindControl("chkRow")).Checked)
            {
                Transaction_Feed item    = new Transaction_Feed();
                Int64            offerID = Convert.ToInt32(gvItems.DataKeys[row.RowIndex].Value);
                item.OmgTransactionID = gvItems.DataKeys[row.RowIndex]["OmgTransactionID"].ToString();

                item.OmgMerchantRef = gvItems.DataKeys[row.RowIndex]["omgmerchantref"].ToString();
                item.MerchantName   = gvItems.DataKeys[row.RowIndex]["MerchantName"].ToString();
                item.UserEmail      = gvItems.DataKeys[row.RowIndex]["UserEmail"].ToString();

                if (!string.IsNullOrEmpty(((TextBox)row.FindControl("txtFinalCommision")).Text))
                {
                    item.FinalCommision = Convert.ToDecimal(((TextBox)row.FindControl("txtFinalCommision")).Text);
                }



                feeds.Add(item);
                offerIds.Add(offerID);
                if (!string.IsNullOrEmpty(item.UserEmail))
                {
                    SendEmail(item.UserEmail, item.FinalCommision.ToString(), item.OmgMerchantRef.ToString(), item.MerchantName);
                }
            }
        }

        EventHandler Insert = this.InsertCommand;

        if (Insert != null)
        {
            Transaction_FeedInsert = feeds;
            //lblMessage.Text = string.Empty;
            Insert(this, e);

            // TransFromDB();
        }

        if (offerIds.Count > 0)
        {
            EventHandler update = this.UpdateCommand;
            if (update != null)
            {
                this.Ids = offerIds;
                //lblMessage.Text = string.Empty;
                update(this, e);
                TransFromDB();
            }
        }
    }
Exemplo n.º 2
0
    void _view_DeleteCommand(object sender, EventArgs e)
    {
        try
        {
            Transaction_Feed c = new Transaction_Feed();
            _model.DBOperation(Constants.Action.Delete, c, _view.Ids);
            _view.strMessage = "Successfully Deleted!!!";
            LoadViewFromModel();

            _view.DataBind();
        }
        catch (Exception ex)
        {
            _view.strMessage = ex.Message;
        }
    }
Exemplo n.º 3
0
    void _view_InsertCommand(object sender, EventArgs e)
    {
        try
        {
            //Transaction_Feed item = new Transaction_Feed();

            foreach (Transaction_Feed _item in _view.Transaction_FeedInsert)
            {
                Transaction_Feed item = new Transaction_Feed();
                item.ClickTime        = _item.ClickTime;
                item.TransactionTime  = _item.TransactionTime;
                item.OmgTransactionID = _item.OmgTransactionID;
                item.OmgMerchantRef   = _item.OmgMerchantRef;
                item.UID              = _item.UID;
                item.UID2             = _item.UID2;
                item.MID              = _item.MID;
                item.MerchantName     = _item.MerchantName;
                item.PID              = _item.PID;
                item.Product          = _item.Product;
                item.Referrer         = _item.Referrer;
                item.SR               = _item.SR;
                item.VR               = _item.VR;
                item.NVR              = _item.NVR;
                item.Status           = _item.Status;
                item.Paid             = _item.Paid;
                item.Completed        = _item.Completed;
                item.UKey             = _item.UKey;
                item.TransactionValue = _item.TransactionValue;
                item.VoucherCode      = _item.VoucherCode;
                item.FinalCommision   = _item.FinalCommision;
                _model.DBOperation(Constants.Action.Insert, item);
            }
            _view.strMessage = "Successfully Inserted!!!";



            LoadViewFromModel();

            _view.DataBind();
        }
        catch (Exception ex)
        {
            _view.strMessage = ex.Message;
        }
    }
Exemplo n.º 4
0
    private void AssignDataToDbParameter(DataTable dt)
    {
        //Transaction_Feeds
        List <Transaction_Feed> feeds = new List <Transaction_Feed>();

        foreach (DataRow row in dt.Rows)
        {
            Transaction_Feed item = new Transaction_Feed();
            item.ClickTime = row["ClickTime"].ToString();

            item.TransactionTime  = Convert.ToDateTime(row["TransactionTime"].ToString());
            item.OmgTransactionID = row["TransactionID"].ToString();
            item.OmgMerchantRef   = row["MerchantRef"].ToString();
            if (dt.Columns.Contains("UID"))
            {
                item.UID = row["UID"].ToString();
            }
            //item.UID2 = row["UID2"].ToString();
            item.MID = row["MID"].ToString();
            //item.MerchantName = row["MerchantName"].ToString();
            item.PID      = row["PID"].ToString();
            item.Product  = row["Product"].ToString();
            item.Referrer = row["Referrer"].ToString();
            item.SR       = row["SR"].ToString();
            item.VR       = row["VR"].ToString();
            item.NVR      = row["NVR"].ToString();
            item.Status   = row["Status"].ToString();
            item.Paid     = row["Paid"].ToString();
            if (dt.Columns.Contains("Completed"))
            {
                item.Completed = row["Completed"].ToString();
            }

            item.UKey             = row["UKey"].ToString();
            item.TransactionValue = row["TransactionValue"].ToString();
            if (dt.Columns.Contains("VoucherCode"))
            {
                item.VoucherCode = row["VoucherCode"].ToString();
            }
            feeds.Add(item);
        }

        Transaction_FeedInsert = feeds;
    }
Exemplo n.º 5
0
    public void DBOperation(Constants.Action command, Transaction_Feed item = null, List <long> IDs = null)
    {
        switch (command)
        {
        case Constants.Action.Insert:
            client.InsertTransactionFeed(item);
            break;

        case Constants.Action.Delete:
            client.DeleteTransactionFeed(IDs);
            break;

        case Constants.Action.Update:
            client.UpdateTransactionFeed(IDs);
            break;

        default:
            break;
        }
    }
Exemplo n.º 6
0
    protected void lkbUpdateValidate_Click(object sender, EventArgs e)
    {
        List <Int64> offerIds = new List <Int64>();
        //decimal FinalCommision;
        List <Transaction_Feed> feeds = new List <Transaction_Feed>();

        foreach (GridViewRow row in gvItems.Rows)
        {
            if (((CheckBox)row.FindControl("chkRow")).Checked)
            {
                Transaction_Feed item    = new Transaction_Feed();
                Int64            offerID = Convert.ToInt32(gvItems.DataKeys[row.RowIndex].Value);
                offerIds.Add(offerID);
            }
        }

        clsCommonMethods obj = new clsCommonMethods();

        obj.UpdateTransactionFeed(offerIds, Convert.ToInt16(Constants.AmountStatus.Validated));
        lblMessage.Text = "Validate User amount.";
    }