private void _Saving(object sender, Blackbaud.AppFx.UIModeling.Core.SavingEventArgs e)
        {
            if (this.Mode == Blackbaud.AppFx.UIModeling.Core.DataFormMode.Add)                      //Check this while adding only
            {
                if (RELATIONSHIPCODEID.Value == Guid.Parse("437C723A-AA22-49B9-977E-96E389D21A6A")) //Self
                {
                    DataListLoadRequest request = new DataListLoadRequest
                    {
                        DataListID      = new Guid("5a96ea16-83bc-4dcc-a2a5-a66f4065de0a"),
                        ContextRecordID = this.ContextRecordId,
                        SecurityContext = this.GetRequestSecurityContext()
                    };
                    AppFxWebService svc   = new AppFxWebService(this.GetRequestContext());
                    var             reply = svc.DataListLoad(request);

                    foreach (DataListResultRow row in reply.Rows)
                    {
                        if (row.Values[5] != null && row.Values[5].ToLower().Equals("self"))
                        {
                            SaveFailed();
                            break;
                        }
                    }
                }
            }
        }
        private void _Saving(object sender, Blackbaud.AppFx.UIModeling.Core.SavingEventArgs e)
        {
            switch (this.FOLLOWUPSTATUSCODEID.Value.ToString())
            {
            case "4a4cd034-1fb4-4ba4-8940-08bd066baf42":
                _followupstatuscode.Value = FOLLOWUPSTATUSCODES.@Successful;
                break;

            case "10043a3f-e0d6-4e24-8a85-26a23895bd90":
                this.FOLLOWUPSTATUSCODE.Value = FOLLOWUPSTATUSCODES.@Unsuccessful;
                break;
            }

            if (this._followupcompleted.Value == false)
            {
                this.FOLLOWUPSTATUSCODEID.Value = Guid.Empty;
                this.FOLLOWUPSTATUSCODE.Value   = FOLLOWUPSTATUSCODES.@Empty;
            }
        }
 private void _Saving(object sender, Blackbaud.AppFx.UIModeling.Core.SavingEventArgs e)
 {
     if (this.RecordId != null)
     {
         SqlConnection conn = new SqlConnection(ConnectionStringHelper.GetConnectionString());
         conn.Open();
         SqlCommand cmd = new SqlCommand("select ID from USR_UMHS_DATA U WHERE U.MRN = (@MRN) and U.CONSTITUENTID <> (@ID)", conn);
         cmd.Parameters.AddWithValue("@ID", this.RecordId);
         cmd.Parameters.AddWithValue("@MRN", this.MRN.Value.ToString());
         SqlDataAdapter      da = new SqlDataAdapter(cmd);
         System.Data.DataSet ds = new System.Data.DataSet();
         da.Fill(ds);
         Object returnObjVal = cmd.ExecuteNonQuery();
         if (ds.Tables[0].Rows.Count > 0)
         {
             conn.Close();
             SaveFailed();
         }
     }
 }