Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (SessionManager.CurrentUser == null)
        {
            Common.RedirectToLoginPage(this);
            return;
        }
        else if (!IsPostBack)
        {
            FillLabelLanguage();
            ParamFunctionFamRepository repoFunc = new ParamFunctionFamRepository();
            ddlFunctionFam.DataTextField = "FonctionFamID";
            ddlFunctionFam.DataValueField = "FonctionFamID";
            ddlFunctionFam.DataSource = repoFunc.GetAllFunctionFams();
            ddlFunctionFam.DataBind();

            if (!string.IsNullOrEmpty(Request.QueryString["FunctionID"]))
            {
                int functionID = int.Parse(Request.QueryString["FunctionID"]);
                ParamFunction function = new ParamFunctionRepository().FindOne(new ParamFunction(functionID));
                ddlFunctionFam.SelectedValue = function.FunctionFamID;
                txtLabel.Text = function.Label;
            }
        }
    }
Пример #2
0
 private void BindGridData()
 {
     ParamFunctionFamRepository repo = new ParamFunctionFamRepository();
     gridFunctionFam.DataSource = repo.GetAllFunctionFams();
 }