private void GetVendorSpecification()
    {
        MedicalVendorDAL medicalVendorDal = new MedicalVendorDAL();
        var listMVSpecialization = medicalVendorDal.GetMVUserSpecialization(string.Empty, 3);
        Falcon.Entity.MedicalVendor.EMVUserSpecialization[] medicalvendorspecialization = null;

        if (listMVSpecialization != null) medicalvendorspecialization = listMVSpecialization.ToArray();

        if (medicalvendorspecialization.Length > 0)
        {
            ddlSpecialization.Items.Add(new ListItem("Select Specilization", "0"));
            for (int count = 0; count < medicalvendorspecialization.Length; count++)
            {
                ddlSpecialization.Items.Add(new ListItem(medicalvendorspecialization[count].Name, medicalvendorspecialization[count].MVUserSpecilaizationID.ToString()));

            }
        }

    }
예제 #2
0
    /// <summary>
    /// This method searches for the MVUserSpecialization by name entered.
    /// </summary>
    /// <param name="searchtext"></param>
    private void SearchMVUserSpecialization(string searchtext)
    {
        //MVUserSpecializationService service = new MVUserSpecializationService();
        //HealthYes.Web.UI.MVUserSpecializationService.EMVUserSpecialization[] mvuserspecialization;
        //mvuserspecialization = service.GetMVUserSpecializationByName(searchtext);

        EMVUserSpecialization[] mvuserspecialization = null;

        MedicalVendorDAL medicalVendorDal = new MedicalVendorDAL();
        // Mode '2' is used here to Fetch MV User specialisations acc. to a search text
        var listMVuserspecialization = medicalVendorDal.GetMVUserSpecialization(searchtext, 2);

        if (listMVuserspecialization != null)
        {
            mvuserspecialization = listMVuserspecialization.ToArray();
        }

        DataTable dtMVUserSpecialization = new DataTable();

        dtMVUserSpecialization.Columns.Add("MVUserSpecializationID", typeof(Int64));
        dtMVUserSpecialization.Columns.Add("name");
        dtMVUserSpecialization.Columns.Add("description");
        dtMVUserSpecialization.Columns.Add("Active");

        if (mvuserspecialization != null && mvuserspecialization.Length > 0)
        {
            for (int icount = 0; icount < mvuserspecialization.Length; icount++)
            {
                if (mvuserspecialization[icount].Active.ToString().Equals("True"))
                {
                    dtMVUserSpecialization.Rows.Add(new object[] { mvuserspecialization[icount].MVUserSpecilaizationID, mvuserspecialization[icount].Name, mvuserspecialization[icount].Description, "Active" });
                }
                else
                {
                    dtMVUserSpecialization.Rows.Add(new object[] { mvuserspecialization[icount].MVUserSpecilaizationID, mvuserspecialization[icount].Name, mvuserspecialization[icount].Description, "Deactivated" });
                }
            }
            errordiv.Visible = false;
        }
        else
        {
            errordiv.InnerText = "No Records Found";
            errordiv.Visible   = true;
        }
        if ((SortDirection)ViewState["SortMVUserSpecialization"] == SortDirection.Descending)
        {
            dtMVUserSpecialization.DefaultView.Sort = "name desc";
        }
        else
        {
            dtMVUserSpecialization.DefaultView.Sort = "name asc";
        }

        dtMVUserSpecialization = dtMVUserSpecialization.DefaultView.ToTable();

        grdMVUserSpecialization.DataSource = dtMVUserSpecialization;

        ViewState["DSGRID"] = dtMVUserSpecialization;

        grdMVUserSpecialization.DataBind();
        txtName.Text                   = "";
        txtDescription.Text            = "";
        hfMVUserSpecializationID.Value = "";
    }