Exemplo n.º 1
0
        protected void gvNonReferralReason_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            hfNonReferralReasonID.Value = e.CommandArgument.ToString();
            NonReferralReasons objNonReferralReasons = new NonReferralReasons();

            if (e.CommandName.Equals("cmdEdit"))
            {
                objNonReferralReasons = NonReferralReasonsBO.GetNonReferralReasons(Convert.ToInt32(e.CommandArgument));
                txtNonReferralReasonDesc.Text = objNonReferralReasons.NonReferralReasonDesc;
            }
            else if (e.CommandName.Equals("cmdDelete"))
            {
                int NonReferralReasonID = Convert.ToInt32(e.CommandArgument);
                objNonReferralReasons.NonReferralReasonID = NonReferralReasonID;
                objNonReferralReasons.Status = 0;
                NonReferralReasonsBO.DeleteNonReferralReasons(objNonReferralReasons);
                loadNonReferralReason();
            }
        }
Exemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            NonReferralReasons objNonReferralReasons = new NonReferralReasons();
            objNonReferralReasons.NonReferralReasonDesc = txtNonReferralReasonDesc.Text;
            objNonReferralReasons.Status = 1;

            if (!string.IsNullOrEmpty(hfNonReferralReasonID.Value.ToString()))
            {
                objNonReferralReasons.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objNonReferralReasons.UpdatedDate = DateTime.Now;
                objNonReferralReasons.NonReferralReasonID = Convert.ToInt32(hfNonReferralReasonID.Value);
                objNonReferralReasons.NonReferralReasonDesc = txtNonReferralReasonDesc.Text;
                NonReferralReasonsBO.UpdateNonReferralReasons(objNonReferralReasons);
            }
            else
            {
                objNonReferralReasons.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objNonReferralReasons.CreatedDate = DateTime.Now;
                NonReferralReasonsBO.InsertNonReferralReasons(objNonReferralReasons);
            }

            txtNonReferralReasonDesc.Text = string.Empty;
            loadNonReferralReason();
        }