protected void btnAddZoneCity_Click(object sender, EventArgs e) { dvmsgUpdateZone.Style.Add("display", "none"); MDMSVC.DC_ZoneRQ RQ = new MDMSVC.DC_ZoneRQ(); RQ.Create_Date = DateTime.Now; RQ.Create_User = System.Web.HttpContext.Current.User.Identity.Name;; RQ.Zone_id = Zone_Id; if (ddlMasterCityEdit.SelectedValue != "0") { RQ.City_id = new Guid(ddlMasterCityEdit.SelectedValue); } var result = masterSVc.AddZoneCityMapping(RQ); if (result != null) { if (result.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success) { BootstrapAlert.BootstrapAlertMessage(dvMsgaddZoneCity, "City has been added successfully", BootstrapAlertType.Success); fillgrdZoneCitiesData(Zone_Id); } else { BootstrapAlert.BootstrapAlertMessage(dvMsgaddZoneCity, result.StatusMessage, (BootstrapAlertType)result.StatusCode); } } }
protected void btnUpdateZoneMaster_Click(object sender, EventArgs e) { dvUpdateMsg.Style.Add("display", "none"); dvmsgUpdateZone.Style.Add("display", "none"); string lat = txtEditLatitude.Text; string longg = txtEditLongitude.Text; double zoneRadius = Convert.ToDouble(ddlZoneRadius.SelectedValue); var searchZone = masterSVc.SearchZone(new MDMSVC.DC_ZoneRQ { Zone_id = Zone_Id }); if (searchZone != null) { var ExistingZone = (from a in searchZone select a).First(); if (ExistingZone.Latitude != lat || ExistingZone.Longitude != longg) { var deletezone = masterSVc.DeleteZoneHotelsInTable(new MDMSVC.DC_ZoneRQ { Zone_id = Zone_Id }); } if (ExistingZone.Zone_Radius != zoneRadius) { var updateZone = masterSVc.UpdateZoneHotelsInTable(new MDMSVC.DC_ZoneRQ { Zone_id = Zone_Id, Zone_Radius = zoneRadius }); } } MDMSVC.DC_ZoneRQ UPdparam = new MDMSVC.DC_ZoneRQ(); UPdparam.Action = "UPDATE"; UPdparam.Zone_id = Zone_Id; UPdparam.Zone_Name = txtEditZoneName.Text; UPdparam.Latitude = lat; UPdparam.Longitude = longg; UPdparam.Edit_Date = DateTime.Now; UPdparam.Edit_User = System.Web.HttpContext.Current.User.Identity.Name; if (ddlEditZoneType.SelectedItem.Value != "0") { UPdparam.Zone_Type = ddlEditZoneType.SelectedItem.Text; } if (ddlEditZoneSubType.SelectedItem.Value != "0") { UPdparam.Zone_SubType = ddlEditZoneSubType.SelectedItem.Text; } if (ddlMasterCountryEdit.SelectedItem.Value != "0") { UPdparam.CountryName = ddlMasterCountryEdit.SelectedItem.Text; UPdparam.Country_id = Guid.Parse(ddlMasterCountryEdit.SelectedValue); } UPdparam.Zone_Radius = zoneRadius; var result = masterSVc.AddzoneMaster(UPdparam); var addZone = masterSVc.InsertZoneHotelsInTable(UPdparam); getZoneInfo(string.Empty); }
private void fillMasterSearchData(int pageindex, int pagesize) { try { MDMSVC.DC_ZoneRQ R = new MDMSVC.DC_ZoneRQ(); R.PageNo = pageindex; R.PageSize = pagesize; if (ddlMasterCountry.SelectedItem.Value != "0") { R.Country_id = new Guid(ddlMasterCountry.SelectedValue); } if (ddlMasterCity.SelectedItem.Value != "0") { R.City_id = new Guid(ddlMasterCity.SelectedValue); } if (ddlZoneType.SelectedItem.Value != "0") { R.Zone_Type = ddlZoneType.SelectedItem.Text; } if (ddlZoneSubType.SelectedItem.Value != "0") { R.Zone_SubType = ddlZoneSubType.SelectedItem.Text; } if (ddlStatus.SelectedItem.Value != "0") { R.Status = ddlStatus.SelectedItem.Text; } var res = masterSVc.SearchZone(R); if (res != null) { if (res.Count > 0) { grdZoneSearch.VirtualItemCount = res[0].TotalRecords ?? 0; lblTotalCount.Text = res[0].TotalRecords.ToString(); } grdZoneSearch.DataSource = res; grdZoneSearch.PageIndex = pageindex; grdZoneSearch.PageSize = Convert.ToInt32(ddlShowEntries.SelectedItem.Text); grdZoneSearch.DataBind(); } else { lblTotalCount.Text = string.Empty; grdZoneSearch.DataSource = null; grdZoneSearch.DataBind(); } } catch { throw; } }
public void ProcessRequest(HttpContext context) { MDMSVC.DC_ZoneRQ RQ = new MDMSVC.DC_ZoneRQ(); //RQ.Latitude = context.Request.QueryString["Latitude"]; //RQ.Longitude = context.Request.QueryString["Longitude"]; //RQ.CountryName = context.Request.QueryString["CountryName"]; RQ.Zone_id = new Guid(context.Request.QueryString["ZoneId"]); var res = MapSvc.SearchZoneHotels(RQ); context.Response.Write(new JavaScriptSerializer().Serialize(res)); }
protected void fillgrdZoneCitiesData(Guid Zone_id) { MDMSVC.DC_ZoneRQ zc = new MDMSVC.DC_ZoneRQ(); zc.Zone_id = Zone_id; var res = masterSVc.SearchZoneCities(zc); if (res != null && res.Count > 0) { grdZoneCities.DataSource = res; grdZoneCities.DataBind(); } else { grdZoneCities.DataSource = null; grdZoneCities.DataBind(); } }
public void ProcessRequest(HttpContext context) { MDMSVC.DC_ZoneRQ RQ = new MDMSVC.DC_ZoneRQ(); RQ.ZoneProductMapping_Id = new Guid(context.Request.QueryString["zoneProdMapId"]); bool includestatus = Convert.ToBoolean(context.Request.QueryString["includestatus"]); if (includestatus == false) { RQ.Included = true; } else { RQ.Included = false; } var res = MapSvc.IncludeExcludeHotels(RQ); context.Response.Write(new JavaScriptSerializer().Serialize(res)); }
protected void btnMapAll_Click(object sender, EventArgs e) { //List<MDMSVC.DC_ZoneRQ> mapall = new List<MDMSVC.DC_ZoneRQ>(); foreach (GridViewRow row in grdZoneHotelSearch.Rows) { int index = row.RowIndex; var myRow_Id = Guid.Parse(grdZoneHotelSearch.DataKeys[index].Values[0].ToString()); if (myRow_Id != Guid.Empty) { MDMSVC.DC_ZoneRQ mav = new MDMSVC.DC_ZoneRQ(); mav.ZoneProductMapping_Id = Guid.Parse(grdZoneHotelSearch.DataKeys[index].Values[0].ToString()); mav.Included = true; mav.Edit_Date = DateTime.Now; mav.Edit_User = System.Web.HttpContext.Current.User.Identity.Name; var res = masterSVc.IncludeExcludeHotels(mav); } } fillgrdZoneHotelSearchData(); }
protected void grdZoneCities_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "SoftDelete") { GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int index = row.RowIndex; Guid myRowId = Guid.Parse(e.CommandArgument.ToString()); MDMSVC.DC_ZoneRQ RQ = new MDMSVC.DC_ZoneRQ(); RQ.Zone_id = Zone_Id; RQ.ZoneCityMapping_Id = myRowId; RQ.Edit_Date = DateTime.Now; RQ.Edit_User = System.Web.HttpContext.Current.User.Identity.Name; RQ.Status = "Inactive"; RQ.IsActive = false; var result = masterSVc.DeactivateOrActivateZones(RQ); fillgrdZoneCitiesData(Zone_Id); } if (e.CommandName == "UnDelete") { GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int index = row.RowIndex; Guid myRowId = Guid.Parse(e.CommandArgument.ToString()); MDMSVC.DC_ZoneRQ p = new MDMSVC.DC_ZoneRQ(); p.Zone_id = Zone_Id; p.ZoneCityMapping_Id = myRowId; p.Status = "Active"; p.IsActive = true; p.Edit_Date = DateTime.Now; p.Edit_User = System.Web.HttpContext.Current.User.Identity.Name; var result = masterSVc.DeactivateOrActivateZones(p); fillgrdZoneCitiesData(Zone_Id); } } catch (Exception) { throw; } }
protected void fillgrdZoneHotelSearchData() { MDMSVC.DC_ZoneRQ zh = new MDMSVC.DC_ZoneRQ(); var DistanceRange = Convert.ToDouble(ddlShowDistance.SelectedValue); zh.Zone_id = Zone_Id; var result = masterSVc.SearchZoneHotels(zh); if (result != null && result.Count > 0) { result = (from a in result where a.Distance <= DistanceRange select a).ToList(); lblTotalCount.Text = (result.Count).ToString(); grdZoneHotelSearch.DataSource = result; grdZoneHotelSearch.DataBind(); } else { lblTotalCount.Text = string.Empty; grdZoneHotelSearch.DataSource = null; grdZoneHotelSearch.DataBind(); } }
protected void grdZoneSearch_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Select") { GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int index = row.RowIndex; Guid myRowId = Guid.Parse(e.CommandArgument.ToString()); //create Query String string strQueryString = GetQueryString(myRowId.ToString(), ((GridView)sender).PageIndex.ToString()); Response.Redirect(strQueryString, true); //end Query string } if (e.CommandName == "SoftDelete") { GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int index = row.RowIndex; Guid myRowId = Guid.Parse(e.CommandArgument.ToString()); MDMSVC.DC_ZoneRQ RQ = new MDMSVC.DC_ZoneRQ(); RQ.Zone_id = myRowId; RQ.Action = "ZoneMaster"; RQ.Edit_Date = DateTime.Now; RQ.Edit_User = System.Web.HttpContext.Current.User.Identity.Name; RQ.Status = "Inactive"; RQ.IsActive = false; var result = masterSVc.DeactivateOrActivateZones(RQ); if (result != null) { if (result.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success) { fillMasterSearchData(0, Convert.ToInt32(ddlShowEntries.SelectedValue)); BootstrapAlert.BootstrapAlertMessage(dvMsgDeleted, "Zone has been deleted successfully", BootstrapAlertType.Success); } else { BootstrapAlert.BootstrapAlertMessage(dvMsgDeleted, result.StatusMessage, (BootstrapAlertType)result.StatusCode); } } } if (e.CommandName == "UnDelete") { GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int index = row.RowIndex; Guid myRowId = Guid.Parse(e.CommandArgument.ToString()); MDMSVC.DC_ZoneRQ p = new MDMSVC.DC_ZoneRQ(); p.Zone_id = myRowId; p.Action = "ZoneMaster"; p.Status = "Active"; p.IsActive = true; p.Edit_Date = DateTime.Now; p.Edit_User = System.Web.HttpContext.Current.User.Identity.Name; var result = masterSVc.DeactivateOrActivateZones(p); if (result != null) { if (result.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success) { fillMasterSearchData(0, Convert.ToInt32(ddlShowEntries.SelectedValue)); BootstrapAlert.BootstrapAlertMessage(dvMsgDeleted, "Zone has been Undeleted successfully", BootstrapAlertType.Success); } else { BootstrapAlert.BootstrapAlertMessage(dvMsgDeleted, result.StatusMessage, (BootstrapAlertType)result.StatusCode); } } } } catch (Exception) { throw; } }
protected void btnSaveZoneMaster_Click(object sender, EventArgs e) { MDMSVC.DC_ZoneRQ param = new MDMSVC.DC_ZoneRQ(); var Zone_id = Guid.NewGuid(); param.Action = "ADD"; param.Zone_Radius = 4.0; param.Zone_id = Zone_id; param.Create_Date = DateTime.Now; param.Create_User = System.Web.HttpContext.Current.User.Identity.Name; if (ddlMasterCountryAddModal.SelectedItem.Value != "0") { param.CountryName = ddlMasterCountryAddModal.SelectedItem.Text; param.Country_id = new Guid(ddlMasterCountryAddModal.SelectedValue); } if (ddlMasterCityAddModal.SelectedItem.Value != "0") { param.City_id = new Guid(ddlMasterCityAddModal.SelectedValue); } if (ddlAddZoneType.SelectedItem.Value != "0") { param.Zone_Type = ddlAddZoneType.SelectedItem.Text; } if (ddlAddZoneSubType.SelectedItem.Value != "0") { param.Zone_SubType = ddlAddZoneSubType.SelectedItem.Text; } if (ddlAddHotelIncludeRange.SelectedItem.Value != "0") { param.Zone_Radius = Convert.ToDouble(ddlAddHotelIncludeRange.SelectedValue); } //else param.Zone_Radius = 4; param.Zone_Name = txtAddZoneName.Text; param.Latitude = txtLatitude.Text; param.Longitude = txtLongitude.Text; var result = masterSVc.AddzoneMaster(param); if (result != null) { if (result.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success) { BootstrapAlert.BootstrapAlertMessage(dvmsgAdd, "Zone has been added successfully", BootstrapAlertType.Success); var addHotels = masterSVc.InsertZoneHotelsInTable(param); string strQueryString = GetQueryString(Zone_id.ToString(), "0"); Response.Redirect(strQueryString, true); } else { BootstrapAlert.BootstrapAlertMessage(dvmsgAdd, result.StatusMessage, (BootstrapAlertType)result.StatusCode); } } }