$(document).ready(function () {
    LoadDoctorUser();

});

function LoadDoctorUser() {
    
    if ($('#DoctorUser_Id').val() != '') {
        var DoctorID = $.trim($('#DoctorUser_Id').val());
        var DoctorData = {
            doctor_user_id: DoctorID,
            Dml_Indicator: 'VS'
        }
        $.ajax({
            async: true,
            type: 'POST',
            url: '/UserCreateView/DoctorUserView',
            contentType: 'application/json; charset=UTF-8',
            data: JSON.stringify(DoctorData),
            success: function (data) {
                var data1 = JSON.parse(data);
                console.log(data1);
                if (data1.msg == "Success") {
                    var data1 = data1.data;
                    if (jQuery.isEmptyObject((data1))) {

                        // alert(' Sorry, The values you entered are invalid.\n Please try again. ');
                    }
                    else {

                        $.each(data1, function (i, DOC) {
                            for (var i = 0; i < data.length; i++) {
                                $("#txtName").html(DOC.doctor_user_name);
                                $("#txtEmailId").html(DOC.doctor_user_email_id);
                                $("#txtMoblie").html(DOC.doctor_user_mobile_no);
                                $("#txtDesignation").html(DOC.master_service_name);
                                $("#SelRole").html(DOC.doctor_user_role_name);
                                $("#txtDepartment").html(DOC.name)
                                $("#txtsubdepartment").html(DOC.sub_cd_name)
                                $("#txtBranch").html(DOC.multibranch)
                            }
                        });
                    }
                }
                else {
                    console.log(data);
                }
            }
        });
    }
}

