Exemple #1
0
    protected void btnMerchantNameAdd_Click(object sender, EventArgs e)
    {
        EventHandler Insert             = this.InsertCommand;
        List <Merchant_Commision> itemS = new List <Merchant_Commision>();

        if (Insert != null)
        {
            Merchant_Commision item = new Merchant_Commision();
            //lblMessage.Text = string.Empty;
            item.MerchantID  = Convert.ToInt32(uc_MerchantDDlList.SelectedMerchant);
            item.PID         = Convert.ToInt32(txtPID.Text.Trim());
            item.ProgramName = txtProgramName.Text;
            //MerchantLogoUrl=txtMerchantLogoUrl.Text.Trim();
            item.ProductDescription = txtProductDescription.Text.Trim();
            //Sector = txtMerchantLogoUrl.Text.Trim();
            item.PayoutType           = ddlPayoutType.SelectedIndex > 0 ? ddlPayoutType.SelectedValue.ToString() : "";
            item.CookieDuration       = txtCookieDuration.Text.Trim();
            item.DeepLinkEnabled      = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), ddlDeepLinkEnabled.SelectedValue.ToString());
            item.ProductfeedAvailable = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), ddlProductfeedAvailable.SelectedValue.ToString());
            item.UIDTracking          = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), ddlUIDTracking.SelectedValue.ToString());
            item.WebsiteUrl           = txtWebsiteUrl.Text.Trim();
            item.TrackingURL          = txtTrackingURL.Text.Trim();
            item.PriceType            = (Constants.PriceType)Enum.Parse(typeof(Constants.PriceType), ddlPriceType.SelectedValue.ToString());
            item.Status        = (Constants.Status)Enum.Parse(typeof(Constants.Status), ddlStatus.SelectedValue.ToString());
            item.UserCommision = txtUserCommision.Text;
            item.Commision     = txtCommision.Text;


            itemS.Add(item);
            this.Merchant_Commisions = itemS;
            Insert(this, e);
            BindItems();
        }
    }
Exemple #2
0
    private void AssignDataToDbParameter()
    {
        //Transaction_Feeds
        ExportToDataTable();
        List <Merchant_Commision> feeds = new List <Merchant_Commision>();

        foreach (DataRow row in MerchantDataTable.Select("ProgrammeStatus='Live'"))
        {
            if (MerchantDataTable.Columns.Contains("MerchantName"))
            {
                Merchant_Commision item = new Merchant_Commision();
                Int64 merID             = uc_MerchantDDlList.GetValueFindByText(row["MerchantName"].ToString());
                if (merID != 0)
                {
                    item.MerchantID = merID;
                    item.PID        = Convert.ToInt32(row["PID"].ToString());
                    //MerchantLogoUrl=txtMerchantLogoUrl.Text.Trim();
                    item.ProgramName        = row["ProductName"].ToString();
                    item.ProductDescription = row["ProductDescription"].ToString();
                    //Sector = txtMerchantLogoUrl.Text.Trim();
                    item.PayoutType           = row["PayoutType"].ToString();
                    item.CookieDuration       = row["CookieDuration"].ToString();
                    item.DeepLinkEnabled      = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), row["DeepLinkEnabled"].ToString());
                    item.ProductfeedAvailable = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), row["ProductFeedAvailable"].ToString());
                    item.UIDTracking          = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), row["UidTracking"].ToString().Replace(" ", "").ToString());
                    item.WebsiteUrl           = row["WebsiteURL"].ToString();
                    item.TrackingURL          = row["TrackingURL"].ToString();
                    item.Commision            = row["Commission"].ToString().Replace("£", "").ToString();
                    item.PriceType            = row["Commission"].ToString().Contains("%") ? Constants.PriceType.Percentage : Constants.PriceType.INR;
                    item.Status           = Constants.Status.Active;
                    item.MaximumCommision = null;
                    //item.PriceType = (Constants.PriceType)Enum.Parse(typeof(Constants.PriceType), row["MerchantLogoURL"].ToString());
                    //item.Status = (Constants.Status)Enum.Parse(typeof(Constants.Status), row["MerchantLogoURL"].ToString());


                    //item.MerchantName = row["MerchantName"].ToString();
                    //item.MerchantLogoUrl = row["MerchantLogoURL"].ToString();
                    //item.ProgramName = row["ProductName"].ToString();
                    //item.ProductDescription = row["ProductDescription"].ToString();
                    //item.PID = Convert.ToInt32(row["PID"].ToString());
                    //item.Sector = row["Sector"].ToString();
                    //item.CountryCode = row["CountryCode"].ToString();
                    //item.PayoutType = row["PayoutType"].ToString();
                    //item.CookieDuration = row["CookieDuration"].ToString();
                    //item.ProductfeedAvailable = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), row["ProductFeedAvailable"].ToString().Replace(" ", "").ToString());
                    //item.DeepLinkEnabled = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), row["DeepLinkEnabled"].ToString().Replace(" ", "").ToString());
                    //item.UIDTracking = (Constants.YesNo)Enum.Parse(typeof(Constants.YesNo), row["UidTracking"].ToString().Replace(" ", "").ToString());
                    //item.Status = Convert.ToInt32((Constants.Status)Enum.Parse(typeof(Constants.Status), row["ProgrammeStatus"].ToString().Replace(" ", "").ToString()));
                    //item.WebsiteUrl = row["WebsiteURL"].ToString();
                    //item.Commision = row["Commission"].ToString();
                    //item.TrackingURL = row["TrackingURL"].ToString();

                    feeds.Add(item);
                }
            }
        }

        Merchant_Commisions = feeds;
    }
Exemple #3
0
    void _view_DeleteCommand(object sender, EventArgs e)
    {
        try
        {
            Merchant_Commision c = new Merchant_Commision();
            _model.DBOperation(Constants.Action.Delete, c, _view.Ids);
            _view.strMessage = "Successfully Deleted!!!";
            LoadViewFromModel();

            _view.DataBind();
        }
        catch (Exception ex)
        {
            _view.strMessage = ex.Message;
        }
    }
Exemple #4
0
    public void DBOperation(Constants.Action command, Merchant_Commision item = null, List <int> Ids = null, List <Merchant_Commision> commisions = null)
    {
        switch (command)
        {
        case Constants.Action.Insert:
            client.InsertCommision(item);
            break;

        case Constants.Action.Delete:
            client.DeleteCommisions(Ids);
            break;

        case Constants.Action.Update:
            client.UpdateCommisions(commisions);
            break;

        default:
            break;
        }
    }
Exemple #5
0
    protected void lkbUpdate_Click(object sender, EventArgs e)
    {
        List <Merchant_Commision> coms = new List <Merchant_Commision>();

        foreach (GridViewRow row in gvItemsCOM.Rows)
        {
            if (((CheckBox)row.FindControl("chkRow")).Checked)
            {
                Merchant_Commision com = new Merchant_Commision();

                com.CommisionID = Convert.ToInt32(gvItemsCOM.DataKeys[row.RowIndex].Value);
                //com.PID = Convert.ToInt32(gvItemsCOM.DataKeys[row.RowIndex].Value);
                TextBox uCom   = (TextBox)row.FindControl("txtUserCommision");
                TextBox maxCom = (TextBox)row.FindControl("txtMaxCommision");
                TextBox Commis = (TextBox)row.FindControl("txtCommision");
                TextBox pTitle = (TextBox)row.FindControl("txtTitle");
                com.ProgramName   = pTitle.Text;
                com.UserCommision = uCom.Text;
                com.Commision     = Commis.Text;
                if (!string.IsNullOrEmpty(maxCom.Text.Trim()))
                {
                    com.MaximumCommision = Convert.ToInt32(maxCom.Text.Trim());// !string.IsNullOrEmpty(maxCom.Text.Trim()) ? Convert.ToInt32(maxCom.Text.Trim()) : null;
                }
                coms.Add(com);
            }
        }

        if (coms.Count > 0)
        {
            EventHandler update = this.UpdateCommand;
            if (update != null)
            {
                this.Merchant_Commisions = coms;
                //lblMessage.Text = string.Empty;
                update(this, e);
                BindItems();
            }
        }
    }