コード例 #1
0
        protected void GetEvent(string EventDate)
        {
            try
            {
                VenueDetailsViewModel _venueDetailsViewModel = new VenueDetailsViewModel();
                List<EventListModel> _eventListModel = new List<EventListModel>();

                _eventListModel = _venueDetailsViewModel.GetEventByDate(EventDate);

                ddEventList.DataSource = _eventListModel;
                ddEventList.DataTextField = "EventName";
                ddEventList.DataValueField = "EventSPID";
                ddEventList.DataBind();

            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script language='javascript'>");
                sb.Append(@"alert('Error : " + ex.Message + "')");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", sb.ToString(), false);
            }
        }
コード例 #2
0
        protected void GetEvent(string VenuID)
        {
            try
            {
                //if (hdValue.Value != "1")
                {
                    VenueDetailsViewModel _venueDetailsViewModel = new VenueDetailsViewModel();
                    List<EventListModel> _eventListModel = new List<EventListModel>();

                    if (txtEventDate.Value == "")
                    {
                        _eventListModel = _venueDetailsViewModel.GetEventList(VenuID, "ALL");
                    }
                    else
                    {
                        _eventListModel = _venueDetailsViewModel.GetEventList(VenuID, txtEventDate.Value);
                    }

                    ddEventList.DataSource = _eventListModel;
                    ddEventList.DataTextField = "EventName";
                    ddEventList.DataValueField = "EventSPID";
                    ddEventList.DataBind();

                    //ListItem lst = new ListItem();
                    //lst.Text = "ALL";
                    //lst.Value = "ALL";
                    //ddEventList.Items.Insert(0, lst);

                    //hdValue.Value = "1";
                    //ddEventList.Items.Add(lst);
                }
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script language='javascript'>");
                sb.Append(@"alert('Error : " + ex.Message + "')");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", sb.ToString(), false);
            }
        }
コード例 #3
0
ファイル: addvenue.aspx.cs プロジェクト: kamalpathi/Demo1
        protected void btnUpdate_ServerClick(object sender, EventArgs e)
        {
            try
            {
                if (ValidatePage() == true)
                {
                    VenueDetailsViewModel _venueDetailsViewModel = new VenueDetailsViewModel();
                    VenueDetailsModel _venueDetailsModel = new VenueDetailsModel();

                    _venueDetailsModel.VenueName = txtVenueName.Value;
                    _venueDetailsModel.StreetAddress = txtStreetAddress.Value;
                    _venueDetailsModel.City = txtCity.Value;
                    _venueDetailsModel.StateProvision = txtStateProvision.Value;
                    _venueDetailsModel.ZipCode = txtZipCode.Value;
                    _venueDetailsModel.VenueID = Convert.ToInt32(hdVenueID.Value);

                    string FileName = SaveImage();
                    _venueDetailsModel.VenueImage = FileName;

                    bool retval = _venueDetailsViewModel.UpdateVenueDetails(_venueDetailsModel);

                    if (retval == true)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Venue Details", "<script type='text/javascript'>ConfirmMsg('Venue details updated sucessfully.','Add Event Details');</script>", false);
                       // Response.Redirect("/VenueDetails.aspx"); //-kk redirect
                            Response.Redirect("/VenueDetails.aspx", false);
                            Context.ApplicationInstance.CompleteRequest();

                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Venue Details", "<script type='text/javascript'>ConfirmMsg('Unexpected error occured.Plese refresh the page and try again!','Add Event Details');</script>", false);
                    }
                }
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", "javascript:alert('Server is busy.Please try after sometime.');", true);
            }
        }
コード例 #4
0
ファイル: VenueDetails.aspx.cs プロジェクト: kamalpathi/Demo1
        //protected void gvVenueDetails_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        //{
        //    try
        //    {
        //        string selectedVenueCode = "";
        //        bool isRedirect = true;
        //        try
        //        {
        //            selectedVenueCode = gvVenueDetails.Rows[e.NewSelectedIndex].Cells[2].Text;
        //        }
        //        catch (Exception ex)
        //        {
        //            //Common.WriteLog("Method " + ex.TargetSite, ex.Message);
        //            ScriptManager.RegisterStartupScript(this, this.GetType(), "selection", "alert('Error Occured while selecting Venue Details');", true);
        //            isRedirect = false;
        //        }
        //        if (isRedirect)
        //            Response.Redirect("~/AdminPanel/addvenue.aspx?Ecode=" + selectedVenueCode + "&" + "Query=U");
        //    }
        //    catch (Exception ex)
        //    {
        //       // we.WriteExceptionInFile("DriverMaster-gvDriverDetails_SelectedIndexChanging :" + ex.ToString(), CompanyCode);
        //    }
        //}
        protected void gvVenueDetailsList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "edit")
                {
                    Response.Redirect("/addvenue.aspx?Ecode=" + e.CommandArgument + "");
                }

                if (e.CommandName == "delete")
                {
                    VenueDetailsViewModel _venueDetailsViewModel = new VenueDetailsViewModel();
                    string retVal = _venueDetailsViewModel.DeleteVenueDetails(e.CommandArgument.ToString());

                    if (retVal == "Ref")
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Venue Details", "<script type='text/javascript'>ConfirmMsg('Event having a reference with Venue. Cannot be deleted.','Add Event Details');</script>", false);
                    }
                    else if (retVal == "false")
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Venue Details", "<script type='text/javascript'>ConfirmMsg('Unexpected error occured.Plese refresh the page and try again!.','Add Event Details');</script>", false);
                    }
                    else if (retVal == "true")
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Venue Details", "<script type='text/javascript'>ConfirmMsg('Venue Deleted Sucessfully.','Add Event Details');</script>", false);
                    }

                    GetVenueDetails();
                }
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script language='javascript'>");
                sb.Append(@"alert('Error : " + ex.Message + "')");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", sb.ToString(), false);
            }
        }
コード例 #5
0
        protected void GetVenueDetails()
        {
            try
            {
                VenueDetailsViewModel _venueDetailsViewModel = new VenueDetailsViewModel();
                List<VenueDetailsModel> _venueDetailsModel = new List<VenueDetailsModel>();
                VenueDetailsModel _venueDetails = new VenueDetailsModel();

                if (Convert.ToInt32(Session["SVenue"].ToString()) == 0)
                {
                    _venueDetailsModel = _venueDetailsViewModel.GetVenueDetails();
                    ddVenue.DataSource = _venueDetailsModel;
                    ddVenue.DataTextField = "VenueName";
                    ddVenue.DataValueField = "VenueID";
                    ddVenue.DataBind();
                }
                else
                {
                    _venueDetails = _venueDetailsViewModel.GetVenueDetailsByID(Session["SVenue"].ToString());

                    ListItem lst = new ListItem();
                    lst.Text = _venueDetails.VenueName;
                    lst.Value = _venueDetails.VenueID.ToString();
                    ddVenue.Items.Add(lst);
                }

                ListItem lst1 = new ListItem();
                lst1.Text = "--SELECT--";
                lst1.Value = "--SELECT--";
                ddVenue.Items.Insert(0, lst1);
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script language='javascript'>");
                sb.Append(@"alert('Error : " + ex.Message + "')");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", sb.ToString(), false);
            }
        }
コード例 #6
0
        protected void GetVenueDetails()
        {
            try
            {
                List<VenueDetailsModel> _venueDetails = new List<VenueDetailsModel>();
                VenueDetailsViewModel venueList = new VenueDetailsViewModel();

                _venueDetails = venueList.GetVenueDetails();

                foreach (var item in _venueDetails)
                {
                    ListItem lst = new ListItem();
                    lst.Text = item.VenueName;
                    lst.Value = item.VenueID.ToString();
                    ddVenueDetails.Items.Add(lst);
                }
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", "javascript:alert('Server is busy.Please try after sometime.');", true);
            }
        }
コード例 #7
0
ファイル: addvenue.aspx.cs プロジェクト: kamalpathi/Demo1
 protected void GetVenueDetails(string VenueID)
 {
     try
     {
         VenueDetailsViewModel _venueDetailsViewModel = new VenueDetailsViewModel();
         VenueDetailsModel _venueDetailsModel = new VenueDetailsModel();
         _venueDetailsModel = _venueDetailsViewModel.GetVenueDetailsByID(VenueID);
         hdVenueID.Value = _venueDetailsModel.VenueID.ToString();
         txtVenueName.Value = _venueDetailsModel.VenueName;
         txtStreetAddress.Value = _venueDetailsModel.StreetAddress;
         txtCity.Value = _venueDetailsModel.City;
         txtStateProvision.Value = _venueDetailsModel.StateProvision;
         txtZipCode.Value = _venueDetailsModel.ZipCode;
         VenueImagePath.Value = _venueDetailsModel.VenueImage;
         img_prev.Src = _venueDetailsModel.VenueImage;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #8
0
        protected void GetVenueDetails()
        {
            try
            {
                List<VenueDetailsModel> _venueDetails = new List<VenueDetailsModel>();
                VenueDetailsModel _VenueDetailsModel = new VenueDetailsModel();

                VenueDetailsViewModel venueList = new VenueDetailsViewModel();

                //TODO
                if (Convert.ToInt32(Session["SVenue"].ToString()) == 0)
                {
                    _venueDetails = venueList.GetVenueDetails();

                    foreach (var item in _venueDetails)
                    {
                    ListItem lst = new ListItem();
                    lst.Text = item.VenueName;
                    lst.Value = item.VenueID.ToString();
                    ddVenueDetails.Items.Add(lst);
                    }

                }
                else
                {
                    _VenueDetailsModel = venueList.GetVenueDetailsByID(Session["SVenue"].ToString());

                    ListItem lst = new ListItem();
                    lst.Text = _VenueDetailsModel.VenueName;
                    lst.Value = _VenueDetailsModel.VenueID.ToString();
                    ddVenueDetails.Items.Add(lst);
                }

            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script language='javascript'>");
                sb.Append(@"alert('Error : " + ex.Message + "')");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", sb.ToString(), false);

            }
        }
コード例 #9
0
        protected void GetVenueDetails()
        {
            try
            {
                List<VenueDetailsModel> _venueDetails = new List<VenueDetailsModel>();
                VenueDetailsViewModel venueList = new VenueDetailsViewModel();

                _venueDetails = venueList.GetVenueDetails();

                foreach (var item in _venueDetails)
                {
                    ListItem lst = new ListItem();
                    lst.Text = item.VenueName;
                    lst.Value = item.VenueID.ToString();
                    ddVenueDetails.Items.Add(lst);
                }
            }
            catch
            {

            }
        }
コード例 #10
0
ファイル: VenueDetails.aspx.cs プロジェクト: kamalpathi/Demo1
        private void GetVenueDetails()
        {
            try
            {
                List<VenueDetailsModel> _venueDetailsModel = new List<VenueDetailsModel>();
                VenueDetailsViewModel _venueDetailsViewModel = new VenueDetailsViewModel();
                _venueDetailsModel = _venueDetailsViewModel.GetVenueDetails();

                //gvVenueDetails.DataSource = _venueDetailsModel;
                //gvVenueDetails.DataBind();

                gvVenueDetailsList.DataSource = _venueDetailsModel;
                gvVenueDetailsList.DataBind();
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script language='javascript'>");
                sb.Append(@"alert('Error : " + ex.Message + "')");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", sb.ToString(), false);
            }
        }