Ejemplo n.º 1
0
        /// <summary>
        /// Get Unit's Details
        /// </summary>
        private void GetDetails()
        {
            BusinessServices.Unit objUnit;
            DataTable             dtbUnit;
            int intOrganisationID;

            //1. Get Unit details
            objUnit             = new BusinessServices.Unit();
            dtbUnit             = objUnit.GetUnit(this.m_intUnitID);
            this.txtName.Text   = dtbUnit.Rows[0]["Name"].ToString();
            this.txtUnitID.Text = this.m_intUnitID.ToString();
            if (dtbUnit.Rows[0]["Active"].ToString() == "True")
            {
                this.cboStatus.SelectedIndex = 0;
            }
            else
            {
                this.cboStatus.SelectedIndex = 1;
            }

            this.lblPathway.Text = dtbUnit.Rows[0]["Organisation"].ToString() + " > " + dtbUnit.Rows[0]["Pathway"].ToString();


            DateTime dteOriginalDateUpdated = (DateTime)dtbUnit.Rows[0]["DateUpdated"];

            this.OriginalDateUpdated = DatabaseTool.ToLongDateTimeString(dteOriginalDateUpdated);

            intOrganisationID = (int)dtbUnit.Rows[0]["OrganisationID"];

            //2. Get Sub-Units tree
            DataSet dstUnits = objUnit.GetUnitsByOrganisation(intOrganisationID, "", "", "", this.m_intUnitID);

            string strUnits = UnitTreeConvert.ConvertXml(dstUnits);

            if (strUnits == "")
            {
                this.trvSubUnits.Visible   = false;
                this.lblNoSubUnits.Visible = true;
            }
            else
            {
                this.trvSubUnits.Visible   = true;
                this.lblNoSubUnits.Visible = false;
                this.trvSubUnits.LoadXml(strUnits);
            }
        }