Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //(Master.FindControl("lblheader") as Label).Text = "Customise List";
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "Customise List";
        lblH2.Text = Request.QueryString["name"];

        if (lblH2.Text == "Add")
        {
            ddStatus.Visible  = false;
            lblStatus.Visible = false;
            lblH2.Text        = "Add Disease";
        }


        else if (lblH2.Text == "Edit")
        {
            lblH2.Text = "Edit Disease";
        }

        IDiseases DiseaseManager;

        if (!IsPostBack)
        {
            if (Request.QueryString["name"] == "Edit")
            {
                try
                {
                    int DiseaseId;
                    DiseaseId = Convert.ToInt32(Request.QueryString["DiseaseId"]);

                    DiseaseManager = (IDiseases)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDiseases, BusinessProcess.Administration");
                    DataSet theDS = DiseaseManager.GetDiseasesByID(DiseaseId);
                    this.txtDiseaseName.Text = theDS.Tables[0].Rows[0]["DiseaseName"].ToString();
                    if (theDS.Tables[0].Rows[0]["DeleteFlag"].ToString() == "True")
                    {
                        this.ddStatus.SelectedValue = "1";
                    }
                    else
                    {
                        this.ddStatus.SelectedValue = "0";
                    }
                    this.txtSeq.Text = theDS.Tables[0].Rows[0]["Sequence"].ToString();
                }
                catch (Exception err)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["MessageText"] = err.Message.ToString();
                    IQCareMsgBox.Show("#C1", theBuilder, this);
                    return;
                }
                finally
                {
                    DiseaseManager = null;
                }
            }
        }
    }