示例#1
0
        protected void btnRegister_OnClick(object sender, EventArgs e)
        {
            int   categoryId = int.Parse(Request.Form[ddlCategories.UniqueID]);
            int   cityId     = int.Parse(Request.Form[ddlCities.UniqueID]);
            Banks banktype;

            Enum.TryParse(ddlBanks.Value, out banktype);
            int id = _userServices.AddProvider(txtEmail.Value, txtPassword.Value, txtEmail.Value, txtName.Value,
                                               txtMobileNumber.Value, txtIdentityNumber.Value, cityId,
                                               categoryId, txtCompanyName.Value, banktype, txtBankAccountNumber.Value,
                                               "Providers", Khadmatcom.Data.Model.IdentityType.Provider);

            string _out = (id > 0) ? string.Empty : "حدث خطأ أثناء الإضافة...فضلا حاول لاحقا";

            if (string.IsNullOrEmpty(_out))
            {
                RedirectAndNotify(GetLocalizedUrl($"managment/providers/{id}/provider-info"), "تم الإضافة بنجاح");
            }
            else
            {
                Notify(_out, "", NotificationType.Error);
            }
        }