Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
        {
            IQCareMsgBox.Show("SessionExpired", this);
            Response.Redirect("~/frmlogin.aspx", true);
        }
        lblTitle.Text = Request.QueryString["name"];

        //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists";
        //(Master.FindControl("lblMark") as Label).Visible = false;
        //(Master.FindControl("lblheader") as Label).Text = "Satellite";
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text   = "Customize Lists";
        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = " >> Satellite";

        if (!IsPostBack)
        {
            ViewState["redirect"] = Request.QueryString["Redirect"];
            /*For Save or Update Message*/
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["Name"] = "Satellite";
            /*****/
            ViewState["ID"] = "";
            if (lblTitle.Text == "Edit")
            {
                int ID = Convert.ToInt32(Request.QueryString["SatelliteId"]);
                lblTitle.Text = "Edit Satellite/Location";
                btnSave.Text  = "Update";
                IQCareMsgBox.ShowConfirm("CustomUpdateRecord", theBuilder, btnSave);
                ISatellite SatelliteEditMgr = (ISatellite)ObjectFactory.CreateInstance("BusinessProcess.Administration.BSatellite, BusinessProcess.Administration");
                DataTable  DT = SatelliteEditMgr.GetSatellite(ID);
                ViewState["ID"]        = DT.Rows[0]["ID"].ToString();
                txtSatelliteID.Text    = DT.Rows[0]["SatelliteID"].ToString();
                txtSatelliteName.Text  = DT.Rows[0]["Name"].ToString();
                ddStatus.SelectedValue = DT.Rows[0]["DeleteFlag"].ToString();
                txtPriority.Text       = DT.Rows[0]["SRNo"].ToString();
            }
            else
            {
                td1.Visible   = false;
                td2.ColSpan   = 2;
                lblTitle.Text = "Add Satellite/Location";
                IQCareMsgBox.ShowConfirm("CustomSaveRecord", theBuilder, btnSave);
            }
        }
    }