private CompanyAddress GetAddress()
    {
        if (SessionManager.CurrentCompany == null)
            {
                Common.RedirectToLoginPage(this);
                return null;
        }
        CompanyAddress address = new CompanyAddress();
        if (!string.IsNullOrEmpty(Request.QueryString["AddressId"]))
        {
            address.AddressID = int.Parse(Request.QueryString["AddressId"]);
        }

        address.CompanyID = SessionManager.CurrentCompany.CompanyID;
        address.Name = txtName.Text.Trim();
        address.Co = txtCO.Text.Trim();
        address.Address = txtAddress.Text.Trim();
        address.City = txtCity.Text.Trim();
        address.ZipCode = txtZipCode.Text.Trim();
        address.VatNumber = txtVatNumber.Text.Trim();
        address.Telephone = txtTelephone.Text.Trim();
        address.Fax = txtFax.Text.Trim();
        address.Email = txtEmail.Text.Trim();

        address.IsDefault = chkDefault.Checked;
        address.FactoringCode = txtFactoringCode.Text;
        //if (!string.IsNullOrEmpty(ddlFactoringCode.SelectedValue))
        //{
        //    address.FactoringCode = int.Parse(ddlFactoringCode.SelectedValue);
        //}
        return address;
    }
Exemplo n.º 2
0
    protected void OnInvoiceCoordinateDeleteClicked(object sender, EventArgs e)
    {
        LinkButton lnkItem = (LinkButton)sender;
        int addressId = int.Parse(lnkItem.CommandArgument);
        CompanyAddress deleteItem = new CompanyAddress(addressId);
        CompanyAddressRepository repo = new CompanyAddressRepository();
        repo.Delete(deleteItem);

        BindInvoiceCoordinateGridOfCurrentCompany(null);
    }