protected void Page_Load(object sender, EventArgs e)
    {
        lblResult.Text = string.Empty;

        computationTypeHandler = new ComputationTypeHandler();
        if (IsPostBack == false)
        {
            BindData();
        }
    }
    protected void btnYES_Click(object sender, EventArgs e)
    {
        ComputationType computationType = new ComputationType();

        computationType.Title = txtTitle.Text;

        ComputationTypeHandler computationTypeHandler = new ComputationTypeHandler();

        if (computationTypeHandler.Insert(computationType) > 0)
        {
            Response.Redirect("Z_ComputationTypeDefault.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string computationTypeID = Request.QueryString["computationTypeID"] as string;

        if (computationTypeID == null)
        {
            Response.Redirect("Z_ComputationTypeDefault.aspx");
        }

        try
        {
            computationTypeComputationTypeID = Convert.ToInt32(computationTypeID.Trim());
            computationTypeHandler           = new ComputationTypeHandler();

            ComputationType computationType = computationTypeHandler.GetDetails(computationTypeComputationTypeID);

            lblComputationTypeID.Text = computationType.ComputationTypeID.ToString();
            lblTitle.Text             = computationType.Title.ToString();
        }
        catch (Exception)
        {
            Response.Redirect("Z_ComputationTypeDefault.aspx");
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdjutancyTypeHandler adjutancyTypeHandler = new AdjutancyTypeHandler();
        List <AdjutancyType> adjutancyTypeList    = adjutancyTypeHandler.GetListAll();
        DataTable            adjutancyTypeTable   = new DataTable();

        adjutancyTypeTable.Columns.Add("AdjutancyTypeID");
        adjutancyTypeTable.Columns.Add("Title");

        if (adjutancyTypeList != null)
        {
            foreach (AdjutancyType adjutancyType in adjutancyTypeList)
            {
                adjutancyTypeTable.Rows.Add(adjutancyType.AdjutancyTypeID, adjutancyType.Title);
            }
        }

        if (!IsPostBack)
        {
            ddlAdjutancyTypeID.DataSource     = adjutancyTypeTable;
            ddlAdjutancyTypeID.DataTextField  = "Title";
            ddlAdjutancyTypeID.DataValueField = "AdjutancyTypeID";
            ddlAdjutancyTypeID.DataBind();
        }
        ComputationTypeHandler computationTypeHandler = new ComputationTypeHandler();
        List <ComputationType> computationTypeList    = computationTypeHandler.GetListAll();
        DataTable computationTypeTable = new DataTable();

        computationTypeTable.Columns.Add("ComputationTypeID");
        computationTypeTable.Columns.Add("Title");

        if (computationTypeList != null)
        {
            foreach (ComputationType computationType in computationTypeList)
            {
                computationTypeTable.Rows.Add(computationType.ComputationTypeID, computationType.Title);
            }
        }

        if (!IsPostBack)
        {
            ddlComputationTypeID.DataSource     = computationTypeTable;
            ddlComputationTypeID.DataTextField  = "Title";
            ddlComputationTypeID.DataValueField = "ComputationTypeID";
            ddlComputationTypeID.DataBind();
        }
        MainOfficeTypeHandler mainOfficeTypeHandler = new MainOfficeTypeHandler();
        List <MainOfficeType> mainOfficeTypeList    = mainOfficeTypeHandler.GetListAll();
        DataTable             mainOfficeTypeTable   = new DataTable();

        mainOfficeTypeTable.Columns.Add("MainOfficeTypeID");
        mainOfficeTypeTable.Columns.Add("Title");

        if (mainOfficeTypeList != null)
        {
            foreach (MainOfficeType mainOfficeType in mainOfficeTypeList)
            {
                mainOfficeTypeTable.Rows.Add(mainOfficeType.MainOfficeTypeID, mainOfficeType.Title);
            }
        }

        if (!IsPostBack)
        {
            ddlMainOfficeTypeID.DataSource     = mainOfficeTypeTable;
            ddlMainOfficeTypeID.DataTextField  = "Title";
            ddlMainOfficeTypeID.DataValueField = "MainOfficeTypeID";
            ddlMainOfficeTypeID.DataBind();
        }
    }