public void fillcitydetails(Int32 cityid, string streetname, string parent_zip) { txtaddress.Text = streetname.ToString(); if (cityid != 0) { hdncityid.Value = cityid.ToString(); DataTable dt = new DataTable(); DataTable dt1 = new DataTable(); MasterData mdl = new MasterData(); dt = mdl.Getcitydetails(Convert.ToInt32(hdncityid.Value)); if (dt.Rows.Count > 0) { txtaddress.Text = streetname.ToString(); ddlcity.SelectedIndex = ddlcity.Items.IndexOf(ddlcity.Items.FindByValue(dt.Rows[0]["City_ID"].ToString())); lblcountry.Text = dt.Rows[0]["COUNTRY_NAME"].ToString(); lblstate.Text = dt.Rows[0]["STATE_NAME"].ToString(); string[] zip = dt.Rows[0]["Zip"].ToString().Split(','); dt1.Columns.Add("ZipCode", typeof(string)); dt1.Columns.Add("Zipid", typeof(Int32)); for (int i = 0; i < zip.Length; i++) { dt1.Rows.Add(zip[i],i); } objcf.FillDropDownList(ddlzip, dt1, "ZipCode", "Zipid"); if (parent_zip != "0") ddlzip.SelectedIndex = ddlzip.Items.IndexOf(ddlzip.Items.FindByText(parent_zip)); } } else { clearall(); } }
public DataTable getdata() { DataTable dt = new DataTable(); objmst = new MasterData(); // dt = objmst.GetSearchDataNew("Personal", txtfirstname.Text, txtlastname.Text, txtmiddlename.Text, ddltitle.SelectedValue, ddlemployeestatus.SelectedItem .Text ,txtcompany .Text , txtphoneland .Text ,ddlemployeetype.SelectedItem.Text ,txtphonecell .Text); return dt; }
public void getcountry(DropDownList ddl) { DataTable dtcountry = new DataTable(); objData = new MasterData(); dtcountry = objData.Getcountry("Y"); ddl.DataSource = dtcountry; ddl.DataTextField = "country_name"; ddl.DataValueField = "country_id"; ddl.DataBind(); ddl.Items.Insert(0, "-Select-"); ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByText("USA")); }
public string GetNetworkpath(string drivename) { objmst = new MasterData(); DataTable dt = new DataTable(); dt = objmst.GetLookupList("folderpath"); if (dt.Rows.Count > 1) { dt = dt.Select("lkup_desc like '" + drivename + "%'").CopyToDataTable(); } return dt.Rows[0]["lkup_desc"].ToString().Split('|').GetValue(1).ToString(); }
public void bindcontactperson() { DataTable dt = (DataTable)ViewState["temptable"]; // dt = new DataTable(); MasterData objmst = new MasterData(); //dt=objmst.GetContactPersonList(hdnpresenteridlist.Value); RepDetails.DataSource = dt; RepDetails.DataBind(); hdnfirstnameid.Value = "0"; hdnfirstname.Value = ""; //DropDownList ddltitle = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddltitle"); //AjaxControlToolkit.AutoCompleteExtender acefirstname = (AjaxControlToolkit.AutoCompleteExtender)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("acefirstname"); //acefirstname.ContextKey = ddltitle.SelectedValue; }
public void loadCreateddate() { objshow = new MasterData(); objrpt = new ReportData(); DataTable dt = new DataTable(); Nullable<int> venueid = null; venueid = (ddlVenue.SelectedIndex > 0) ? Convert.ToInt32(ddlVenue.SelectedItem.Value) : venueid; dt = objrpt.GetEngtReportParameters("D", Convert.ToInt32(ddlShow.SelectedItem.Value), Convert.ToInt32(ddlCity.SelectedItem.Value), venueid); objcf.FillDropDownList(ddlCreateddate, dt, "ENGTSTARTDATE", "ENGAGEMENTID"); if (dt.Rows.Count == 1) { ddlCreateddate.SelectedIndex = 1; LoadEnddate(); } }
public string createnewengt(int rowid, Excel.Worksheet _valsheet) { string showid, cityid, venueid, presenterid, statename = ""; DateTime engtdate; showid = _valsheet.Cells[rowid, 18].Text; cityid = _valsheet.Cells[rowid, 15].Text; if (cityid.Split(',').Length > 1) { statename = cityid.Split(',').GetValue(1).ToString(); } cityid = cityid.Split(',').GetValue(0).ToString(); venueid = _valsheet.Cells[rowid, 19].Text; presenterid = _valsheet.Cells[rowid, 22].Text; engtdate = Convert.ToDateTime(_valsheet.Cells[rowid, 21].Text); MasterData objmst = new MasterData(); String newengtid = objmst.EngtInsert_fromexcel(showid, cityid, venueid, presenterid, engtdate, statename); return newengtid.ToString(); }
public void GetDocxDetails(Int32 tableid, string tablename) { hdntableid.Value = tableid.ToString(); hdntablename.Value = tablename; MasterData objmst = new MasterData(); DataTable dt = new DataTable(); dt = objmst.GetDocxDetails(tableid, tablename); DataColumn dc = new DataColumn(); dc.ColumnName = "tempid"; dc.DataType = typeof(int); dc.AutoIncrement = true; dc.AutoIncrementSeed = 1; dt.Columns.Add(dc); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["tempid"] = i + 1; } ViewState["tempdocx"] = dt; binddocx(); }
public void grdfill() { try { DataTable dt = new DataTable(); dt.Columns.Add("Country_name"); dt.Rows.Add("No Records Found!"); objData = new MasterData(); dtTitle = new DataTable(); dtTitle = objData.Gettitle(); if (dtTitle.Rows.Count > 0) { grdTitle.DataSource = dtTitle; grdTitle.DataBind(); } else { foreach (DataColumn cl in dtTitle.Columns) { cl.AllowDBNull = true; } dtTitle.Rows.Add(dtTitle.NewRow()); grdTitle.DataSource = dtTitle; grdTitle.DataBind(); int columncount = grdTitle.Rows[0].Cells.Count; grdTitle.Rows[0].Cells.Clear(); grdTitle.Rows[0].Cells.Add(new TableCell()); grdTitle.Rows[0].Cells[0].ColumnSpan = columncount - 2; grdTitle.Rows[0].Cells[0].Text = "No Records Found"; grdTitle.Columns[columncount - 2].Visible = false; } grdTitle.FooterRow.Visible = true; } catch (Exception ex) { lblerrmsg.Text = ex.ToString(); } }
public void grdfill() { try { dtstate.Clear(); dtstate = new DataTable(); objData = new MasterData(); dtstate = objData.Getstate(); if (dtstate.Rows.Count > 0) { grdState.DataSource = dtstate; grdState.DataBind(); } else { foreach (DataColumn cl in dtstate.Columns) { cl.AllowDBNull = true; } dtstate.Rows.Add(dtstate.NewRow()); grdState.DataSource = dtstate; grdState.DataBind(); int columncount = grdState.Rows[0].Cells.Count; grdState.Rows[0].Cells.Clear(); grdState.Rows[0].Cells.Add(new TableCell()); grdState.Rows[0].Cells[0].ColumnSpan = columncount - 2; grdState.Rows[0].Cells[0].Text = "No Records Found"; grdState.Columns[columncount - 2].Visible = false; } grdState.FooterRow.Visible = true; DropDownList ddlcountry = grdState.FooterRow.FindControl("ddlCountry") as DropDownList; getcountry(ddlcountry); } catch (Exception ex) { throw ex; } }
public void grdfill() { try { // DataTable dt = new DataTable(); objData = new MasterData(); DataTable dtcounty = new DataTable(); dtcounty = objData.Getcountry(); if (dtcounty.Rows.Count > 0) { grdCountry.DataSource = dtcounty; grdCountry.DataBind(); } else { foreach (DataColumn cl in dtcounty.Columns) { cl.AllowDBNull = true; } dtcounty.Rows.Add(dtcounty.NewRow()); grdCountry.DataSource = dtcounty; grdCountry.DataBind(); int columncount = grdCountry.Rows[0].Cells.Count; grdCountry.Rows[0].Cells.Clear(); grdCountry.Rows[0].Cells.Add(new TableCell()); grdCountry.Rows[0].Cells[0].ColumnSpan = columncount - 2; grdCountry.Rows[0].Cells[0].Text = "No Records Found"; grdCountry.Columns[columncount - 2].Visible = false; } grdCountry.FooterRow.Visible = true; } catch (Exception ex) { throw ex; } }
public void grdfill() { try { dtuser.Clear(); dtuser = new DataTable(); objData = new MasterData(); string userrole = Convert.ToString(Session["userrole"]); dtuser = objData.Users_Get(userrole); if (dtuser.Rows.Count > 0) { grdUsers.DataSource = dtuser; grdUsers.DataBind(); } else { foreach (DataColumn cl in dtuser.Columns) { cl.AllowDBNull = true; } dtuser.Rows.Add(dtuser.NewRow()); grdUsers.DataSource = dtuser; grdUsers.DataBind(); int columncount = grdUsers.Rows[0].Cells.Count; grdUsers.Rows[0].Cells.Clear(); grdUsers.Rows[0].Cells.Add(new TableCell()); grdUsers.Rows[0].Cells[0].ColumnSpan = columncount - 2; grdUsers.Rows[0].Cells[0].Text = "No Records Found"; grdUsers.Columns[columncount - 2].Visible = false; } grdUsers.FooterRow.Visible = true; } catch (Exception ex) { throw ex; } }
public void loadVenues() { objshow = new MasterData(); DataTable dt = new DataTable(); dt = objrpt.GetEngtReportParameters("V", Convert.ToInt32(ddlShow.SelectedItem.Value), Convert.ToInt32(ddlCity.SelectedItem.Value), null); objcf.FillDropDownList(ddlVenue, dt, "VENUE_NAME", "VENUE_ID"); if (dt.Rows.Count == 1) { ddlVenue.SelectedIndex = 1; } loadCreateddate(); }
public void LoadEnddate() { lblEngtEndDate.Text = string.Empty; objshow = new MasterData(); objrpt = new ReportData(); DataTable dt = new DataTable(); Nullable<int> venueid = null; venueid = (ddlVenue.SelectedIndex > 0) ? Convert.ToInt32(ddlVenue.SelectedItem.Value) : venueid; dt = objrpt.GetEngtReportParameters("E", Convert.ToInt32(ddlCreateddate.SelectedItem.Value), venueid, venueid); if (dt.Rows.Count > 0) { lblEngtEndDate.Text = dt.Rows[0]["ENGTENDDATE"].ToString(); } }
protected void grdCountry_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Save") { TextBox txtContryName = grdCountry.FooterRow.FindControl("txtCountryName") as TextBox; int afctrows; objData = new MasterData(); TextInfo textInfo = cultureInfo.TextInfo; afctrows = objData.Country_Insert(textInfo.ToTitleCase(txtContryName.Text.Trim())); if (afctrows == 101) { lblerrmsg.Text = "Country already exists."; return; } grdfill(); divmsg.InnerHtml = "Record inserted successfully."; (this.Master as Site1).ClearModifyStatus(); } } catch (Exception ex) { showerror(ex); } }
protected void grdCountry_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { TextBox txtCountryEdit = grdCountry.Rows[e.RowIndex].FindControl("txtCountryEdit") as TextBox; HiddenField hdfCountryid = grdCountry.Rows[e.RowIndex].FindControl("hdfCountryid") as HiddenField; CheckBox chkStatus = grdCountry.Rows[e.RowIndex].FindControl("chkStatus") as CheckBox; if (txtCountryEdit.Text.Length == 0) { lblerrmsg.Text = "Country name should not be empty"; return; } string status; if (chkStatus.Checked == true) { status = "Y"; } else { status = "N"; } int afctrows; objData = new MasterData(); TextInfo textInfo = cultureInfo.TextInfo; afctrows = objData.Country_Update(textInfo.ToTitleCase(txtCountryEdit.Text.Trim()), Convert.ToInt32(hdfCountryid.Value.Trim()), status); if (afctrows == 102) { lblerrmsg.Text = "Country already exists."; return; } else if (afctrows == 103) { lblerrmsg.Text = "Country can’t be deleted as is in use by an state"; return; } grdCountry.EditIndex = -1; grdfill(); divmsg.InnerHtml = "Record updated successfully!"; (this.Master as Site1).ClearModifyStatus(); } catch (Exception ex) { showerror(ex); } }
protected void grdLookup_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Save") { DropDownList ddllkup_group = grdLookup.FooterRow.FindControl("ddllkup_group") as DropDownList; TextBox txtlkup_desc = grdLookup.FooterRow.FindControl("txtlkup_desc") as TextBox; int afctrows; objData = new MasterData(); string groupvalue = ddllkup_group.SelectedItem.Value.Split('|').GetValue(0).ToString(); int groupsize = Convert.ToInt32(ddllkup_group.SelectedItem.Value.Split('|').GetValue(1).ToString()); if (groupsize < txtlkup_desc.Text.ToString().Length) { lblerrmsg.Text = "Check lookup value length"; return; } TextInfo textInfo = cultureInfo.TextInfo; afctrows = objData.Lookup_Insert(textInfo.ToTitleCase(txtlkup_desc.Text.Trim()), groupvalue); if (afctrows == 101) { lblerrmsg.Text = "Lookup already exists."; return; } grdfill(); divmsg.InnerHtml = "Record inserted successfully."; (this.Page.Master as Site1).ClearModifyStatus(); } } catch (Exception ex) { showerror(ex); } }
public static List<string> GetZipcode(string prefixText) { MasterData edl = new MasterData(); List<string> Zipcodelist = edl.serachZipcode(prefixText); return Zipcodelist; }
public static List<string> GetstATEname(string prefixText) { MasterData edl = new MasterData(); List<string> CountryNames = edl.SearchState(prefixText); return CountryNames; }
protected void grdState_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Save") { DropDownList ddlCountry = grdState.FooterRow.FindControl("ddlCountry") as DropDownList; TextBox txtStateName = grdState.FooterRow.FindControl("txtStateName") as TextBox; int afctrows; objData = new MasterData(); TextInfo textInfo = cultureInfo.TextInfo; afctrows = objData.State_Insert(textInfo.ToTitleCase(txtStateName.Text.Trim()), Convert.ToInt32(ddlCountry.SelectedItem.Value)); if (afctrows == 101) { lblerrmsg.Text = "State already exists."; return; } grdfill(); divmsg.InnerHtml = "Record inserted successfully."; (this.Master as Site1).ClearModifyStatus(); } } catch (Exception ex) { throw ex; } }
protected void RepDetails_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.ToLower() == "cancel") { bindScheduleDetails(engagementid); } if (e.CommandName.ToLower() == "edit") { e.Item.FindControl("tredit").Visible = true; DropDownList ddlscheduletypeE = (DropDownList)e.Item.FindControl("ddlscheduletypeE"); HiddenField hdnscheduletypeE = (HiddenField)e.Item.FindControl("hdnscheduletypeE"); MasterData objmst = new MasterData(); ddlscheduletypeE.DataSource = objmst.GetLookupList("scheduletype"); ddlscheduletypeE.DataTextField = "lkup_desc"; ddlscheduletypeE.DataBind(); ddlscheduletypeE.SelectedIndex = ddlscheduletypeE.Items.IndexOf(ddlscheduletypeE.Items.FindByText(hdnscheduletypeE.Value)); e.Item.FindControl("tr_crow").Visible = false; } if (e.CommandName.ToLower() == "update") { UpdateSchedule(e.Item); } trfooter.Visible = false; }
protected void grdState_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { TextBox txtStateEdit = grdState.Rows[e.RowIndex].FindControl("txtStateEdit") as TextBox; HiddenField hdfStateid = grdState.Rows[e.RowIndex].FindControl("hdfStateid") as HiddenField; DropDownList ddlCountryE = grdState.Rows[e.RowIndex].FindControl("ddlCountryE") as DropDownList; CheckBox chkStatus = grdState.Rows[e.RowIndex].FindControl("chkStatus") as CheckBox; if (ddlCountryE.SelectedIndex == 0) { lblerrmsg.Text = "Please select country"; return; } if (txtStateEdit.Text.Length == 0) { lblerrmsg.Text = "State should not be empty"; return; } string status; if (chkStatus.Checked == true) { status = "Y"; } else { status = "N"; } int afctrows; objData = new MasterData(); TextInfo textInfo = cultureInfo.TextInfo; afctrows = objData.State_Update(textInfo.ToTitleCase(txtStateEdit.Text.Trim()), Convert.ToInt32(hdfStateid.Value.Trim()), Convert.ToInt32(ddlCountryE.SelectedItem.Value.Trim()), status); if (afctrows == 102) { lblerrmsg.Text = "State already exists."; return; } else if (afctrows == 103) { lblerrmsg.Text = "State can’t be deleted as is in use by an city"; return; } grdState.EditIndex = -1; grdfill(); divmsg.InnerHtml = "Record updated successfully."; (this.Master as Site1).ClearModifyStatus(); } catch (Exception ex) { throw ex; } }
protected void grdLookup_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { TextBox txtlkup_descEdit = grdLookup.Rows[e.RowIndex].FindControl("txtlkup_descEdit") as TextBox; HiddenField hdflkup_id = grdLookup.Rows[e.RowIndex].FindControl("hdflkup_id") as HiddenField; DropDownList ddllkup_groupE = grdLookup.Rows[e.RowIndex].FindControl("ddllkup_groupE") as DropDownList; CheckBox chkStatus = grdLookup.Rows[e.RowIndex].FindControl("chkStatus") as CheckBox; //if (ddllkup_groupE.SelectedIndex == 0) //{ // lblerrmsg.Text = "Please select lookup group"; // return; //} if (txtlkup_descEdit.Text.Length == 0) { lblerrmsg.Text = "Lookup should not be empty"; return; } string status; if (chkStatus.Checked == true) { status = "Y"; } else { status = "N"; } int afctrows; objData = new MasterData(); string groupvalue = ddllkup_groupE.SelectedItem.Value.Split('|').GetValue(0).ToString(); int groupsize = Convert.ToInt32(ddllkup_groupE.SelectedItem.Value.Split('|').GetValue(1).ToString()); if (groupsize < txtlkup_descEdit.Text.ToString().Length) { lblerrmsg.Text = "Check lookup value length"; return; } TextInfo textInfo = cultureInfo.TextInfo; afctrows = objData.Lookup_Update(textInfo.ToTitleCase(txtlkup_descEdit.Text.Trim()), Convert.ToInt32(hdflkup_id.Value.Trim()), groupvalue, status); if (afctrows == 102) { lblerrmsg.Text = "Lookup already exists."; return; } grdLookup.EditIndex = -1; grdfill(); divmsg.InnerHtml = "Record updated successfully."; (this.Page.Master as Site1).ClearModifyStatus(); } catch (Exception ex) { showerror(ex); } }
public void grdfill() { try { string id = this.ID; vslist.ValidationGroup = id; switch (id) { case "lst_scheduletype": group = "scheduletype"; break; case "lst_pricescalestatus": group = "pricescalestatus"; break; case "lst_contractstatus": group = "contractstatus"; break; case "lst_offerstatus": group = "offerstatus"; break; case "lst_expensestatus": group = "expensestatus"; break; case "lst_memostatus": group = "memostatus"; break; case "lst_engagementstatus": group = "engagementstatus"; break; case "lst_employeetype": group = "employeetype"; break; case "lst_employeestatus": group = "employeestatus"; break; case "lst_Dealothers": group = "DealOthers"; break; case "lst_LocalOthers": group = "localdocumentedothers"; break; //case "lst_DocumentOthers": // group = "localdocumentedothers"; // break; } dtlookup.Clear(); dtlookup = new DataTable(); objData = new MasterData(); dtlookup = objData.GetLookupList(group); if (dtlookup.Rows.Count > 0) { grdLookup.DataSource = dtlookup; grdLookup.DataBind(); } else { foreach (DataColumn cl in dtlookup.Columns) { cl.AllowDBNull = true; } dtlookup.Rows.Add(dtlookup.NewRow()); grdLookup.DataSource = dtlookup; grdLookup.DataBind(); int columncount = grdLookup.Rows[0].Cells.Count; grdLookup.Rows[0].Cells.Clear(); grdLookup.Rows[0].Cells.Add(new TableCell()); grdLookup.Rows[0].Cells[0].ColumnSpan = columncount - 2; grdLookup.Rows[0].Cells[0].Text = "No Records Found"; grdLookup.Columns[columncount - 2].Visible = false; } DropDownList ddltype = grdLookup.FooterRow.FindControl("ddllkup_group") as DropDownList; switchddl(ddltype); //<asp:ListItem Value="scheduletype|30" Text="Engagement Schedule Type"></asp:ListItem> // <asp:ListItem Value="pricescalestatus|10" Text="Engagement Pricescale Status"></asp:ListItem> // <asp:ListItem Value="contractstatus|10" Text="Engagement Contract Status"></asp:ListItem> // <asp:ListItem Value="offerstatus|10" Text="Engagement Offer Status"></asp:ListItem> // <asp:ListItem Value="expensestatus|15" Text="Engagement Expense Status"></asp:ListItem> // <asp:ListItem Value="memostatus|10" Text="Engagement Memo Status"></asp:ListItem> // <asp:ListItem Value="engagementstatus|10" Text="Engagement Engagement Status"></asp:ListItem> grdLookup.FooterRow.Visible = true; } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetExpires(DateTime.Now.AddMinutes(-1)); divmsg.InnerHtml = ""; lblerrmsg.Text = ""; objmst = new MasterData(); if (!Page.IsPostBack) { lbl_msg = (Label)this.Master.FindControl("lbl_headersite"); lbl_msg.Text = "Create Presenter"; (this.Master as Site1).SetfNewbutton("Presenter"); if (!string.IsNullOrEmpty(Request.QueryString["presenterid"])) { if (!string.IsNullOrEmpty(Request.QueryString["search"])) { string presenterid = Request.QueryString["presenterid"]; lbl_msg.Text = ""; DataTable dtengdetails = objmst.GetEVPDetails(Convert.ToInt32(presenterid), 1); DataTable dtvenuedetails = objmst.GetEVPDetails(Convert.ToInt32(presenterid), 2); if (dtengdetails != null) { if (dtengdetails.Rows.Count > 0) { gvrEngagement.DataSource = dtengdetails; gvrEngagement.DataBind(); lblEnggrid.Visible = true; } } if (dtvenuedetails != null) { if (dtvenuedetails.Rows.Count > 0) { grdVenue.DataSource = dtvenuedetails; grdVenue.DataBind(); lblVenuegrid.Visible = true; } } } else lbl_msg.Text = "Modify Presenter"; // lnknew.Visible = true; // lblhead.Text = "Modify Presenter"; hdnpresenterid.Value = Request.QueryString["presenterid"].ToString(); loadpresenterdetails(); } if (!string.IsNullOrEmpty(Request.QueryString["type"])) { divmsg.InnerHtml = "Record submitted successfully!"; } ((HiddenField)this.Master.FindControl("hdnreqlist")).Value = (txtpresentername.ClientID); } }
public static List<string> GetStatus(string prefixText) { MasterData edl = new MasterData(); List<string> Status = edl.SearchEngagementStatus(prefixText); return Status; }
public static List<string> Getcityname(string prefixText) { MasterData edl = new MasterData(); List<string> CountryNames = edl.searchcity(prefixText, "Y"); return CountryNames; }
protected void grdCountry_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { ImageButton lnkDelete = grdCountry.Rows[e.RowIndex].FindControl("lnkDelete") as ImageButton; HiddenField hdfStateid = grdCountry.Rows[e.RowIndex].FindControl("hdfStateid") as HiddenField; if (lnkDelete.CommandArgument.ToString().Trim().ToUpper() == "Inactive".Trim().ToUpper()) { HiddenField hdfCountryid = grdCountry.Rows[e.RowIndex].FindControl("hdfCountryid") as HiddenField; int afctrows; objData = new MasterData(); afctrows = objData.Country_Delete(Convert.ToInt32(hdfCountryid.Value.Trim())); if (afctrows == 103) { lblerrmsg.Text = "Country can’t be deleted as is in use by an state"; return; } grdfill(); divmsg.InnerHtml = "Record deleted successfully."; } else { HiddenField hdfCountryid = grdCountry.Rows[e.RowIndex].FindControl("hdfCountryid") as HiddenField; int afctrows; objData = new MasterData(); afctrows = objData.Country_Activate(Convert.ToInt32(hdfCountryid.Value.Trim())); grdfill(); divmsg.InnerHtml = "Record activated successfully."; } } catch (Exception ex) { showerror(ex); } }
public DataTable getdata() { DataTable dt = new DataTable(); objmst = new MasterData(); // dt = objmst.GetSearchDataNew("Presenter", txtpresentername.Text); return dt; }
protected void RepDetails_ItemDataBound(object sender, RepeaterItemEventArgs e) { CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; TextInfo textInfo = cultureInfo.TextInfo; if (e.Item.ItemType == ListItemType.Footer) { MasterData objmst = new MasterData(); ddlscheduletype.DataSource = objmst.GetLookupList("scheduletype"); ddlscheduletype.DataTextField = "lkup_desc"; ddlscheduletype.DataBind(); int CurrentIndex = ddlscheduletype.Items.IndexOf(ddlscheduletype.Items.FindByText(hdfPerf.Value)); ddlscheduletype.Items.Insert(0, new ListItem { Value = "0", Text = "--Select--", Selected = true }); if ((CurrentIndex + 2) != ddlscheduletype.Items.Count) { ddlscheduletype.SelectedIndex = CurrentIndex + 2; } string schdate = System.DateTime.Now.ToString("MM/dd/yyyy"); if (!string.IsNullOrEmpty(hdn_schnextdate.Value)) { schdate = Convert.ToDateTime(hdn_schnextdate.Value, CultureInfo.CurrentUICulture.DateTimeFormat).AddDays(1).ToString("MM/dd/yyyy"); } txtscheduedate.Text = schdate; lblscheduleday.Text = textInfo.ToTitleCase(Convert.ToDateTime(txtscheduedate.Text, CultureInfo.CurrentUICulture.DateTimeFormat).DayOfWeek.ToString().Substring(0, 3)); } }