Ejemplo n.º 1
0
        protected void btnUnesi_onclick(object sender, EventArgs e)
        {
            //   pnMesto.Visible = true;
            btnUnesi.Enabled = false;


            BioEnWcf.IWcfBioEn client = new BioEnWcf.WcfBioEnClient();

            BioEnWcf.dsUlaz ulaz = new BioEnWcf.dsUlaz();
            // BioEnWcf.dsUlaz.dtdboRow red2 = ulaz.dtdbo.NewdtdboRow();
            BioEnWcf.dsUlaz.dtInt32Row red3 = ulaz.dtInt32.NewdtInt32Row();


            //Grid
            BioEnWcf.dsUlaz.dtdboRow red2 = ulaz.dtdbo.NewdtdboRow();
            for (int i = 0; i < this.gvU.Rows.Count; i++)
            {
                if (((DropDownList)gvU.Rows[i].FindControl("ddlOpstina")).SelectedValue == "0" || /*((TextBox)gvU.Rows[i].FindControl("lblIdMesto")).Text == "" ||*/
                    ((TextBox)gvU.Rows[i].FindControl("tbPttBroj")).Text == "" || ((TextBox)gvU.Rows[i].FindControl("tbNazivMesta")).Text == "")
                {
                    ObradaiObavestenje("Uneti: Opštinu, PttBroj, NazivMesta!");
                    return;
                }
            }

            /*  for (int i = 0; i < this.gvU.Rows.Count; i++)
             * {
             *    if (((TextBox)gvU.Rows[i].FindControl("tbCetiriZvezdice")).Text == "" &&
             *   ((TextBox)gvU.Rows[i].FindControl("tbTriZvezdice")).Text == "" &&
             *   ((TextBox)gvU.Rows[i].FindControl("tbDveZvezdice")).Text == "" &&
             *   ((TextBox)gvU.Rows[i].FindControl("tbJednaZvezdica")).Text == "")
             *    {
             *        ObradaiObavestenje("Унети бар једну врсту категорије !");
             *        return;
             *    }
             * }*/

            /*   for (int i = 0; i < this.gvSmestajneJedinice.Rows.Count; i++)
             * {
             *     if (((TextBox)gvSmestajneJedinice.Rows[i].FindControl("tbCetiriZvezdice")).Text == "")
             *         ((TextBox)gvSmestajneJedinice.Rows[i].FindControl("tbCetiriZvezdice")).Text = "0";
             *     if (((TextBox)gvSmestajneJedinice.Rows[i].FindControl("tbTriZvezdice")).Text == "")
             *         ((TextBox)gvSmestajneJedinice.Rows[i].FindControl("tbTriZvezdice")).Text = "0";
             *     if (((TextBox)gvSmestajneJedinice.Rows[i].FindControl("tbDveZvezdice")).Text == "")
             *         ((TextBox)gvSmestajneJedinice.Rows[i].FindControl("tbDveZvezdice")).Text = "0";
             *     if (((TextBox)gvSmestajneJedinice.Rows[i].FindControl("tbJednaZvezdica")).Text == "")
             *         ((TextBox)gvSmestajneJedinice.Rows[i].FindControl("tbJednaZvezdica")).Text = "0";
             * }*/
            // deo za svaki red grida gvSmestajneJedinice

            for (int i = 0; i < this.gvU.Rows.Count; i++)
            {
                red2 = ulaz.dtdbo.NewdtdboRow();

                red2.Id    = int.Parse(((Label)gvU.Rows[i].FindControl("lblIdOpstina")).Text.ToString());
                red2.id1   = int.Parse(((Label)gvU.Rows[i].FindControl("lblIdMesto")).Text.ToString()); //int.Parse(tbIDZahteva.Text);
                red2.broj  = int.Parse(((TextBox)gvU.Rows[i].FindControl("tbPttBroj")).Text);
                red2.Naziv = ((TextBox)gvU.Rows[i].FindControl("tbNazivMesta")).Text;
                //red2.CetiriZvezdice = int.Parse(((TextBox)gvU.Rows[i].FindControl("tbCetiriZvezdice")).Text);
                //red2.TriZvezdice = int.Parse(((TextBox)gvU.Rows[i].FindControl("tbTriZvezdice")).Text);
                //red2.DveZvezdice = int.Parse(((TextBox)gvU.Rows[i].FindControl("tbDveZvezdice")).Text);
                //red2.JednaZvezdica = int.Parse(((TextBox)gvU.Rows[i].FindControl("tbJednaZvezdica")).Text);
                //if (red2.BrojSmestajnihJedinica != red2.CetiriZvezdice + red2.TriZvezdice + red2.DveZvezdice + red2.JednaZvezdica)
                //{
                //    PrikaziObavestenje("Број смештајних јединица не одговара збиру свих категорија у реду" + " " + (i + 1).ToString());
                //    return;
                //}
                ulaz.dtdbo.AdddtdboRow(red2);
            }
        }
Ejemplo n.º 2
0
        protected void MestaVratiU(int broj)
        {
            TraceLogging.TraceLogger.trace(this.GetType(), (new System.Diagnostics.StackTrace(true)).GetFrame(0).GetMethod().Name, this, "");

            BioEnWcf.IWcfBioEn client = new BioEnWcf.WcfBioEnClient();

            BioEnWcf.dsUlaz ulaz = new BioEnWcf.dsUlaz();
            //  BioEnWcf.dsUlaz.dtdboRow red1 = ulaz.dtdbo.NewdtdboRow();
            BioEnWcf.dsUlaz.dtInt32Row red2 = ulaz.dtInt32.NewdtInt32Row();



            //red1.Id = idMesto;
            //ulaz.dtdbo.AdddtdboRow(red1);


            red2.Broj = broj;
            ulaz.dtInt32.AdddtInt32Row(red2);

            BioEnWcf.MestoVrati_brojRequest  zahtev  = new BioEnWcf.MestoVrati_brojRequest(ulaz);
            BioEnWcf.MestoVrati_brojResponse odgovor = new BioEnWcf.MestoVrati_brojResponse();

            try
            {
                odgovor = client.MestoVrati_broj(zahtev);
            }
            catch (Exception ex)
            {
                ExceptionLogger.ExceptionLogger.logError(ex, this.GetType()
                                                         , (new System.Diagnostics.StackTrace(true)).GetFrame(0).GetMethod().Name, this);
                ObradaiObavestenje("Greška u proceduri kod vraćanja grida za Mesta u metodi MestoVrati_broj!  \\n\\n" + ex.Message);
                return;
            }

            try
            {
                if (odgovor.MestoVrati_brojResult.dtGreska.Rows.Count > 0)
                {
                    ObradaiObavestenje(odgovor.MestoVrati_brojResult.dtGreska.Rows[0][0].ToString());
                    return;
                }
                else
                {
                    gvU.DataSource = odgovor.MestoVrati_brojResult.dtMestoVrati_broj.Rows;
                    gvU.DataBind();


                    tbBrojMestaU.Visible = true;
                    int brojRedova = 0;
                    brojRedova         = odgovor.MestoVrati_brojResult.dtMestoVrati_broj.Rows.Count;
                    lblUkupanBroj.Text = "Ukupan broj: " + brojRedova;

                    tbBrojMestaU.Text = brojRedova.ToString();



                    /*  string IdOpstina = ((Label)gv.Rows[rowIndex].FindControl("lblIdOpstina")).Text.ToString();
                     * if (IdOpstina == "0")
                     * {
                     *    ddlOpstina.SelectedIndex = 0;
                     * }
                     * else
                     * {
                     *    ddlOpstina.SelectedValue = ((Label)gv.Rows[rowIndex].FindControl("lblIdOpstina")).Text.ToString();
                     * }*/
                }
            }
            catch (Exception ex)
            {
                ExceptionLogger.ExceptionLogger.logError(ex, this.GetType()
                                                         , (new System.Diagnostics.StackTrace(true)).GetFrame(0).GetMethod().Name, this);
                ObradaiObavestenje("Greška u proceduri kod vraćanja grida za Mesta u metodi MestoVrati_broj!  \\n\\n " + ex.Message);
                return;
            }
        }