Ejemplo n.º 1
0
        protected void btnSaveClick(object sender, EventArgs e)
        {
            MsgErr(true);

            try
            {
                var PaymentMethodsList = new List <int>();
                foreach (ListViewItem item in lvPaymentMethods.Items)
                {
                    int id;
                    if (((CheckBox)item.FindControl("ckbActive")).Checked && Int32.TryParse(((HiddenField)item.FindControl("hfPaymentId")).Value, out id))
                    {
                        PaymentMethodsList.Add(id);
                    }
                }

                GiftCertificateService.SaveCertificatePaymentMethods(PaymentMethodsList);

                var TaxesList = new List <int>();
                foreach (ListViewItem item in lvTaxes.Items)
                {
                    int id;
                    if (((CheckBox)item.FindControl("ckbActive")).Checked && Int32.TryParse(((HiddenField)item.FindControl("hfTaxId")).Value, out id))
                    {
                        TaxesList.Add(id);
                    }
                }
                TaxServices.SaveCertificateTaxes(TaxesList);

                MsgErr(Resources.Resource.Admin_Certificates_Save, true);
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                MsgErr("Error: " + ex.Message, false);
            }
        }