private void SavePackage()
        {
            packagesManager = new PackagesManager(this);
            package = new Package();
            originalPackage = new Package();

            if (!String.IsNullOrEmpty(Request["PackageId"]))
            {
                originalPackage = packagesManager.GetPackages(Convert.ToInt32(Request["PackageId"]));
                package.CopyPropertiesFrom(originalPackage);
            }

            package.Name = txtName.Text;
            package.NumberItems = Convert.ToInt32(txtNumberItems.Text);
            package.NumberUsers = Convert.ToInt32(txtNumberUsers.Text);
            package.Price = Convert.ToDecimal(ucCurrFieldPrice.CurrencyValue);
            package.ProductPrice = ucCurrFieldProductPrice.CurrencyValue;
            package.SetupFee = ucCurrFieldSetupFee.CurrencyValue;
            package.UserPerHourPrice = ucCurrFieldValueByHour.CurrencyValue;
            package.IsActive = chkIsActive.Checked;

            if (String.IsNullOrEmpty(Request["PackageId"]))
            {
                packagesManager.Insert(package);
                Response.Redirect("Package.aspx?PackageId=" + package.PackageId);
            }
            else
                packagesManager.Update(originalPackage, package);
        }
Exemplo n.º 2
0
 protected void grdPackageAdditional_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     PackagesManager pManager = new PackagesManager(this);
     pManager.DownGrade(Convert.ToInt32(grdPackageAdditional.DataKeys[e.RowIndex]["AddonId"]));
     grdPackageAdditional.DataBind();
     e.Cancel = true;
 }
Exemplo n.º 3
0
    protected void btnInsert_Click(object sender, ImageClickEventArgs e)
    {
        PackagesManager pManager = new PackagesManager(this);
        PackageAdditional pAdditional = new PackageAdditional();

        pAdditional.CompanyId = Company.CompanyId;
        pAdditional.PackageId = Convert.ToInt16(cboPackage.SelectedValue);
        pAdditional.EndDate = pAdditional.StartDate = DateTime.Now;
        pManager.UpGrade(pAdditional);

        grdPackageAdditional.DataBind();
        cboPackage.DataBind();
    }
        private void ShowPackage()
        {
            packagesManager = new PackagesManager(this);

            package = packagesManager.GetPackages(Convert.ToInt32(Request["PackageId"]));

            txtName.Text = package.Name;
            txtNumberItems.Text = Convert.ToString(package.NumberItems);
            txtNumberUsers.Text = Convert.ToString(package.NumberUsers);
            ucCurrFieldPrice.CurrencyValue = package.Price;
            ucCurrFieldProductPrice.CurrencyValue = package.ProductPrice;
            ucCurrFieldSetupFee.CurrencyValue = package.SetupFee;
            ucCurrFieldValueByHour.CurrencyValue = package.UserPerHourPrice;
            chkIsActive.Checked = Convert.ToBoolean(package.IsActive);
        }