Esempio n. 1
0
        private void fillPositions()
        {
            PozicijeSelect select = new PozicijeSelect();
            PozicijeResult result = this.menager.execute(select) as PozicijeResult;

            if (result.Success)
            {
                GridViewPozicije.DataSource = result.pozicije.ToList();
                GridViewPozicije.DataBind();
            }
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     fillKuvari();
     fillMenagers();
     fillPositions();
     if (!IsPostBack)
     {
         PozicijeSelect selectPozicije = new PozicijeSelect();
         PozicijeResult result         = this.menager.execute(selectPozicije) as PozicijeResult;
         if (result.Success)
         {
             DropDownListPozicije.DataSource = result.pozicije.ToList();
             for (int i = 0; i < result.pozicije.Count; i++)
             {
                 DropDownListPozicije.DataTextField  = "NazivPozicije";
                 DropDownListPozicije.DataValueField = "idPozicije";
             }
             DropDownListPozicije.DataBind();
         }
     }
 }
Esempio n. 3
0
        protected void UpdatePositions_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            if (btn != null)
            {
                int id = Convert.ToInt32(btn.CommandArgument);
                ButtonInsertUpdatePosition.Text = "UPDATE POSITION";
                LabelPositions.Text             = "UPDATE POSITION";
                PozicijeSelect selectPositions = new PozicijeSelect {
                    pozicija = new PozicijeItem {
                        idPozicije = id
                    }
                };
                //PozicijeSelect selectPositions = new PozicijeSelect() { Id = id };
                PozicijeResult rez = (PozicijeResult)menager.execute(selectPositions);
                if (rez.Success)
                {
                    HiddenFieldPosition.Value       = rez.pozicije[0].idPozicije.ToString();
                    TextBoxPositionName.Text        = rez.pozicije[0].NazivPozicije;
                    ButtonInsertUpdatePosition.Text = "UPDATE POSITION";
                }
            }
        }