Пример #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (valiate())
            {
                PriceType priceType             = PriceType.Price;
                decimal   subordinateCommission = 0;
                decimal   professionCommission  = 0;
                decimal   internalCommission    = 0;
                decimal   price = 0;
                if (radPrice.Checked)
                {
                    priceType = PriceType.Price;
                    price     = decimal.Parse(this.txtPrice.Text);
                    if (!string.IsNullOrWhiteSpace(this.txtSubordinateCommission.Text))
                    {
                        subordinateCommission = decimal.Parse(this.txtSubordinateCommission.Text);
                    }
                    if (!string.IsNullOrWhiteSpace(this.txtProfessionCommission.Text))
                    {
                        professionCommission = decimal.Parse(this.txtProfessionCommission.Text);
                    }
                    if (!string.IsNullOrWhiteSpace(this.txtInternalCommission.Text))
                    {
                        internalCommission = decimal.Parse(this.txtInternalCommission.Text);
                    }
                }
                if (radLapse.Checked)
                {
                    priceType = PriceType.Subtracting;
                    price     = decimal.Parse(this.txtLapse.Text) / 100;
                    if (!string.IsNullOrWhiteSpace(this.txtSubordinateCommission.Text))
                    {
                        subordinateCommission = decimal.Parse(this.txtSubordinateCommission.Text) / 100;
                    }
                    if (!string.IsNullOrWhiteSpace(this.txtProfessionCommission.Text))
                    {
                        professionCommission = decimal.Parse(this.txtProfessionCommission.Text) / 100;
                    }
                    if (!string.IsNullOrWhiteSpace(this.txtInternalCommission.Text))
                    {
                        internalCommission = decimal.Parse(this.txtInternalCommission.Text) / 100;
                    }
                }

                PolicyManageService.UpdateSpecialPolicyPrice(Guid.Parse(hidIds.Value), priceType, price, subordinateCommission, internalCommission, professionCommission, this.CurrentUser.UserName);
                QuerySpecialPolicy(pager.CurrentPageIndex);
            }
            QuerySpecialPolicy(pager.CurrentPageIndex);
        }