public int PatientInsertion(ref ErrorLog elog, BCPropOfPatient obj)
        {
            List<SqlParameter> param = new List<SqlParameter>();
            param.Add(dbm.InParam("@patient_name", SqlDbType.VarChar, 50, obj.Pname));
            param.Add(dbm.InParam("@patient_fname", SqlDbType.VarChar, 50, obj.Pfname));
            param.Add(dbm.InParam("@patient_address", SqlDbType.VarChar, 150, obj.Paddress));
            param.Add(dbm.InParam("@patient_contactno", SqlDbType.VarChar, 50, obj.Pcontactno));
            param.Add(dbm.InParam("@patient_CNICno", SqlDbType.VarChar, 50, obj.Pcnic));
            param.Add(dbm.InParam("@patient_referencedBy", SqlDbType.VarChar, 50, obj.Prefencedby));
            param.Add(dbm.InParam("@create_date", SqlDbType.DateTime, 50, obj.CreateDate));
            param.Add(dbm.InParam("@create_user", SqlDbType.Int, 4, obj.Create_User));


            return dbm.Manage(ref elog, param, "sp_patientRegistrationInsertionn");
        }
        public int PatientInsertion(ref ErrorLog elog, BCPropOfPatient obj)
        {
            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(dbm.InParam("@patient_name", SqlDbType.VarChar, 50, obj.Pname));
            param.Add(dbm.InParam("@patient_fname", SqlDbType.VarChar, 50, obj.Pfname));
            param.Add(dbm.InParam("@patient_address", SqlDbType.VarChar, 150, obj.Paddress));
            param.Add(dbm.InParam("@patient_contactno", SqlDbType.VarChar, 50, obj.Pcontactno));
            param.Add(dbm.InParam("@patient_CNICno", SqlDbType.VarChar, 50, obj.Pcnic));
            param.Add(dbm.InParam("@patient_referencedBy", SqlDbType.VarChar, 50, obj.Prefencedby));
            param.Add(dbm.InParam("@create_date", SqlDbType.DateTime, 50, obj.CreateDate));
            param.Add(dbm.InParam("@create_user", SqlDbType.Int, 4, obj.Create_User));


            return(dbm.Manage(ref elog, param, "sp_patientRegistrationInsertionn"));
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ErrorLog elog = new ErrorLog();

            BCPropOfPatient objProp = new BCPropOfPatient();
            objProp.Pname = txtPname.Text;
            objProp.Pfname = txtPfname.Text;
            objProp.Paddress = txtPaddress.Text;
            objProp.Pcontactno = txtPcontactno.Text;
            objProp.Pcnic = txtPcnic.Text;
            objProp.Prefencedby = txtPrefencedby.Text;
            objProp.CreateDate = System.DateTime.Now;
            objProp.Create_User = 1;

            ManagementServices objService = new ManagementServices();
            int chk = objService.PatientInsertionServices(ref elog, objProp);
            if(chk==1)
            {
                MessageBox.Show("Patient Registered");
            }
        }
 public int PatientInsertionServices(ref ErrorLog elog, BCPropOfPatient objPropOfPatient)
 {
     BCPatientRegistration objPR = new BCPatientRegistration();
     return objPR.PatientInsertion(ref elog, objPropOfPatient);
 }