public bool SnimiPodatke()
        {
            bool uspehSnimanja = false;

            clsSportDB objSportDB = new clsSportDB(pStringKonekcije);

            clsSport objNoviSport = new clsSport();

            objNoviSport.IDSporta      = int.Parse(pIDSporta);
            objNoviSport.NazivSporta   = pNazivSporta;
            objNoviSport.DatumTreninga = pDatumTreninga;


            clsLokacija objLokacija = new clsLokacija();

            clsLokacijaDB objLokacijaDB = new clsLokacijaDB(pStringKonekcije);

            objLokacija.Sifra = pIDLokacije;
            objLokacija.Naziv = pNazivLokacije;

            objNoviSport.Lokacija = objLokacija;

            uspehSnimanja = objSportDB.SnimiNoviSport(objNoviSport);


            return(uspehSnimanja);
        }
Ejemplo n.º 2
0
        protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e)
        {
            string str = ((Label)((DropDownList)sender).Parent.FindControl("lblddlActionSportID")).Text;

            string ddlSelectedValue = ((DropDownList)sender).SelectedValue;

            if (ddlSelectedValue == "Edit")
            {
                funClearData();
                int sportID = 0;
                int.TryParse(str, out sportID);

                LinkButton btn = sender as LinkButton;

                clsSport           cs  = new clsSport();
                clsSportController csc = new clsSportController();

                DataTable dt = new DataTable();

                dt = csc.GetSportDetailBySportID(sportID);

                if (dt.Rows.Count > 0)
                {
                    hidRegID.Value           = dt.Rows[0]["SportID"].ToString();
                    txtSportName.Text        = dt.Rows[0]["SportName"].ToString();
                    txtSportDescription.Text = dt.Rows[0]["SportDesc"].ToString();

                    // main image
                    SportMainImage.ImageUrl = dt.Rows[0]["SportMainImageFile"].ToString();

                    string ufname = dt.Rows[0]["SportMainImageFile"].ToString();
                    SportMainFile.ResolveUrl("ufname");

                    txtMainImageDesc.Text = dt.Rows[0]["SportMainImageDesc"].ToString();

                    // loge iamge
                    SportLogoImage.ImageUrl = dt.Rows[0]["SportLogoImageFile"].ToString();

                    string ufnamelogo = dt.Rows[0]["SportLogoImageFile"].ToString().Replace(" ", "");
                    SportLogoFile.ResolveUrl("ufnamelogo");

                    txtLogoImageDesc.Text = dt.Rows[0]["SportLogoImageDesc"].ToString();

                    // small image
                    SportSmallImage.ImageUrl = dt.Rows[0]["SportSmallImageFile"].ToString();

                    string ufnamesmall = dt.Rows[0]["SportSmallImageFile"].ToString().Replace(" ", "");
                    SportSmallFile.ResolveUrl("ufnamesmall");

                    txtSmallImageDesc.Text = dt.Rows[0]["SportSmallImageDesc"].ToString();

                    if (dt.Rows[0]["ActiveFlagId"].ToString() == "1")
                    {
                        ChkIsActive.Checked = true;
                    }
                    else
                    {
                        ChkIsActive.Checked = false;
                    }

                    if (dt.Rows[0]["ShowFlagId"].ToString() == "1")
                    {
                        ChkIsShow.Checked = true;
                    }
                    else
                    {
                        ChkIsShow.Checked = false;
                    }

                    int revel = 0;
                    int.TryParse(hidRegID.Value, out revel);

                    pnlSportEntry.Visible  = true;
                    PnlGridSport.Visible   = false;
                    btnUpdateSport.Visible = true;
                    btnSaveSport.Visible   = false;
                }
            }
            else if (ddlSelectedValue == "Delete")
            {
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "javascript:confirm('Are You Sure? Want To Delete.');", true);

                //Page.ClientScript.RegisterStartupScript(this.GetType(), "confirm", "javascript:Confirmation();", true);

                //int competition_Id = 0;

                //int.TryParse(str, out competition_Id);

                //CompRegInfo.DeleteCompetitionReg(competition_Id);

                //FillGridView();
            }
        }