Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int intErrorCnt = 0;
            string strErrMsg = "";

            if (txtMemberName.Text.Trim() == "")
            {
                intErrorCnt++;
                strErrMsg = "Membership Name should not be empty.<br />";
            }
            if (intErrorCnt == 0)
            {
                ServeAtDoorstepData.MembershipDetails objData = new MembershipDetails();
                objData.MemberShipID = Convert.ToInt32(hdnMemberId.Value.ToString());
                objData.MemberShipName = txtMemberName.Text.Trim();
                objData.MemberShipType = txtMemberType.Text.Trim();
                objData.MemberShipAmount = Convert.ToDecimal(txtAmount.Text.Trim());
                objData.MemberShipDays = Convert.ToInt32(txtDays.Text.Trim());

                objService = new ServeAtDoorstepService();
                int i = objService.AddMembership(objData);

                this.ModalPopupViewMessage.Hide();
                BindMemberGrid();
                ClearData();

            }
            else
            {
                divErrorMsg.InnerHtml = strErrMsg;
                this.ModalPopupViewMessage.Show();

            }
        }