protected void btnCargar_Click(object sender, EventArgs e) { HttpPostedFile file = Request.Files["file1"]; if (file != null && file.ContentLength == 0) { Messagebox.Show(this, "Seleccione el archivo excel a cargar"); return; } if (file != null && file.ContentLength > 0) { string fname = Path.GetFileName(file.FileName); //file.SaveAs(Server.MapPath(Path.Combine("~/App_Data/", fname))); Stream stream2 = new MemoryStream(); CopyStream(file.InputStream, stream2); bool valido = ValidaArchivo(file); if (valido) { IWorkbook workbook = WorkbookFactory.Create(stream2); ISheet sheet1 = workbook.GetSheetAt(0); ISheet sheet2 = workbook.GetSheetAt(1); ISheet sheet3 = workbook.GetSheetAt(2); RegistrarPestana1(sheet1); RegistrarPestana2(sheet2); RegistrarPestana3(sheet3); } } }
protected void btn_freeze_Click(object sender, EventArgs e) { try { LinkButton lnk = (LinkButton)sender; GridViewRow grdRow = (GridViewRow)lnk.Parent.Parent; int rowIndex = grdRow.RowIndex; Label lbltabid = (Label)grd_data.Rows[rowIndex].FindControl("lbltabid"); Label refrenceno = (Label)grd_data.Rows[rowIndex].FindControl("lblrefrenceno"); lbltabid.Text = lbltabid.Text; pl.TABLEID = Convert.ToInt32(lbltabid.Text); pl.refrence_no = refrenceno.Text; pl.ref_status = "Settled"; pl.sptype = 8; pl.freeze_flage = "Y"; bl.Freeze(pl); Messagebox.Show(pl.MSG); bindgrdData(); Reset(); } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
public bool validate() { if (ddlFinancial.SelectedIndex == 0) { Messagebox.Show("Please Select Financial Year No."); return(false); } if (ddlEmpType.SelectedIndex == 0) { Messagebox.Show("Please Select Designation Type."); return(false); } if (ddl_emp.SelectedIndex == 0) { Messagebox.Show("Please Select Employee Name."); return(false); } if (ddlGpsMps.SelectedIndex == 0) { Messagebox.Show("Please Select Gpf/Nps."); return(false); } //if (txtTARate.Text.Trim() == "" && txtHandicapRate.Text.Trim() == "") //{ // Messagebox.Show("Add atleast One Row on Level Form"); // return false; //} return(true); }
public void BindRefrenceno() { try { string str = ""; str = "select * from Advance_Reimburse_Master where emp_pk='" + ddl_emp.SelectedValue + "' and ref_status='Pending' and Freeze_flag='Y' and Reimburse_Type='3'"; DataTable dt = cc.EQ(str); if (dt.Rows.Count > 0) { Ddl_advancerefNo.DataTextField = "advance_refno"; Ddl_advancerefNo.DataValueField = "advance_refno"; Ddl_advancerefNo.DataSource = dt; Ddl_advancerefNo.DataBind(); Ddl_advancerefNo.Items.Insert(0, "---Select ---"); } else { Ddl_advancerefNo.Items.Clear(); } } catch (Exception ex) { Messagebox.Show(ex.Message); } }
protected void imgDelete_Click(object sender, ImageClickEventArgs e) { try { ImageButton lnk = (ImageButton)sender; GridViewRow grdRow = (GridViewRow)lnk.Parent.Parent; int row = grdRow.RowIndex; Label lblDepartmentCode = (Label)grdDepartmentMaster.Rows[row].FindControl("lblDepartmentCode"); Label lblDepartmentName = (Label)grdDepartmentMaster.Rows[row].FindControl("lblDepartmentName"); Label lblPayBillSignAuth = (Label)grdDepartmentMaster.Rows[row].FindControl("lblPayBillSignAuth"); Label tabid = (Label)grdDepartmentMaster.Rows[row].FindControl("lbltabid"); PL.sptype = 2; PL.TableID = Convert.ToInt32(tabid.Text); PL.DepartmentCode = lblDepartmentCode.Text; PL.DepartmentName = lblDepartmentName.Text; PL.PayBillSighAuth = lblPayBillSignAuth.Text; BL.Delete(PL); Reset(); Messagebox.Show(PL.msg); BindGrid(); } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
protected void LinkbtnSelect_Click(object sender, EventArgs e) { try { LinkButton lnk = (LinkButton)sender; GridViewRow grdRow = (GridViewRow)lnk.Parent.Parent; int row = grdRow.RowIndex; Label lblDepartmentCode = (Label)grdDepartmentMaster.Rows[row].FindControl("lblDepartmentCode"); Label lblDepartmentName = (Label)grdDepartmentMaster.Rows[row].FindControl("lblDepartmentName"); Label lblPayBillSignAuth = (Label)grdDepartmentMaster.Rows[row].FindControl("lblPayBillSignAuth"); // HyperLink linkSignToview = (HyperLink)grdDepartmentMaster.Rows[row].FindControl("linkSignToview"); Label tabid = (Label)grdDepartmentMaster.Rows[row].FindControl("lbltabid"); lblTabid.Text = tabid.Text; // ddlDesignCatagoryCode.SelectedValue = lblgDesignCatagoryCode.Text.Trim(); txtDepartmentName.Text = lblDepartmentName.Text; lblDepartmentCode.Text = lblDepartmentCode.Text.Trim(); txtPayBSA.Text = lblPayBillSignAuth.Text.Trim(); // img_photo.ImageUrl = linkSignToview.Text.Trim(); btnDelete.Enabled = true; btnSave.Text = "Update"; } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
protected void Add_Click(object sender, EventArgs e) { if (txtNameOfArrived.Text.Trim() != "" && txtArrivalDate.Text != "" && txtArrivalHrs.Text.Trim() != "" && txtDistanceRoad.Text.Trim() != "" && txtConveyMode.Text.Trim() != "" && txtConveyClass.Text.Trim() != "" && txtDepartureDate.Text.Trim() != "" && txtDepartureHrs.Text.Trim() != "" && txtNoDA.Text.Trim() != "" && txtRateofRMADA.Text.Trim() != "" && txtAmount.Text.Trim() != "" && txtRemark.Text.Trim() != "") { DataTable dt = ViewState["dt"] as DataTable; dt.Rows.Add(txtNameOfArrived.Text.Trim(), txtArrivalDate.Text, txtArrivalHrs.Text.Trim(), txtDistanceRoad.Text.Trim(), txtConveyMode.Text.Trim(), txtConveyClass.Text.Trim(), txtDepartureDate.Text.Trim(), txtDepartureHrs.Text.Trim(), txtNoDA.Text.Trim(), txtRateofRMADA.Text.Trim(), txtAmount.Text.Trim(), txtRemark.Text.Trim()); ViewState["dt"] = dt; bindchildgrd(); txtNameOfArrived.Text = string.Empty; txtArrivalDate.Text = string.Empty; txtArrivalHrs.Text = string.Empty; txtDistanceRoad.Text = string.Empty; txtConveyMode.Text = string.Empty; txtConveyClass.Text = string.Empty; txtDepartureDate.Text = string.Empty; txtDepartureHrs.Text = string.Empty; txtNoDA.Text = string.Empty; txtRateofRMADA.Text = string.Empty; txtAmount.Text = string.Empty; txtRemark.Text = string.Empty; } else { Messagebox.Show("Please Fill All Fields Mandatory (*) Fields!"); } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (btnSave.Text == "Save") { //Validat(); pl.sptype = "1"; pl.TableID = "0"; } else { if (txtTableID.Text == chkParent.SelectedValue) { ScriptManager.RegisterStartupScript(this, this.GetType(), "AlertBox", "alert('Record Cannot Be Updated ,Please Check The Parent');", true); //Messagebox.Show("Record Cannot Be Updated ,Please Check The Parent"); return; } pl.TableID = txtTableID.Text; pl.sptype = "3"; } pl.SHName = ddlRole.SelectedValue; pl.HName = hfNameCUnicode.Value.ToString(); pl.Name = txtName.Text; { pl.ParentID = chkParent.SelectedValue; } string MyList = string.Empty; foreach (ListItem li in chkParent.Items) { if (li.Selected == true) { if (MyList == null || MyList == "") { MyList += li.Value; } else { MyList += "," + li.Value; } } } pl.MyList = MyList; bl.Insert(pl); Reset(); Messagebox.Show(pl.msg); } catch (Exception ex) { Messagebox.Show(ex.Message.ToString()); } }
protected void btnReset_Click(object sender, EventArgs e) { try { Reset(); } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
protected void grd_data_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { grd_data.PageIndex = e.NewPageIndex; } catch (Exception ex) { Messagebox.Show(ex.Message); } }
public void DeleteSelected() { if (!SelectFileItem.currentSelected) { return; } Messagebox.Show("Delete selected file? This cannot be undone.", () => { FileSystem.DeleteFile(SelectFileItem.currentSelected.myFile.fullPath); SelectFileItem.Select(null); LoadFiles(); }); }
public bool validate() { if (ddlFinancial.SelectedIndex == 0) { Messagebox.Show("Please Select Financial Year No."); return(false); } if (ddlEmpType.SelectedIndex == 0) { Messagebox.Show("Please Select Designation Type."); return(false); } if (ddl_emp.SelectedIndex == 0) { Messagebox.Show("Please Select Employee Name."); return(false); } if (ddlGpsMps.SelectedIndex == 0) { Messagebox.Show("Please Select Gpf/Nps."); return(false); } if (ddlHdtrOffice.SelectedIndex == 0) { Messagebox.Show("Please Select Headquarters/Office."); return(false); } if (txtOfMDuty.Text == "") { Messagebox.Show("Please Enter Order for Move/Duty."); return(false); } if (txtAuthRole.Text == "") { Messagebox.Show("Please Enter Autherity(Role in TR/SL)."); return(false); } if (txtDateTimeStrt.Text == "") { Messagebox.Show("Please Enter Date and Time of Start."); return(false); } if (txtStationfrmjnycom.Text == "") { Messagebox.Show("Please Enter Station from where Journey Commenced."); return(false); } return(true); }
protected void btnSave_Click(object sender, EventArgs e) { try { if (validate() == true) { Save(); } } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
// Use font as C# Code public void UpdateText1() { text1.Text = "Hi There"; FontFamily ff = this.Resources["YourFontNickName"] as FontFamily; if (ff == null) { Messagebox.Show("Wrong Font Name", "ERROR"); return; } text1.FontFamily = ff; text1.FontSize = 30; }
private void logout() { MessageBox.Show("Im in logout"); if (user.logout(user)) { //monitorLoginStatus.Abort(); MainWindow login = new MainWindow(); this.Close(); login.Show(); } else { Messagebox.Show("Unable to logout"); } }
private Boolean validation() { if (txtDepartmentName.Text == "") { Messagebox.Show("Please Enter Department Name"); //lblMsg.Text ="Please Enter Department Name"; return(false); } if (txtPayBSA.Text == "") { Messagebox.Show("Please Enter PayBill Signing Authetication"); return(false); } return(true); }
public static async Task StartSync() { string username = await GetVtUserName(); var status = await VtCore.Handle.CheckStatus(username); if (status == LobbyStatus.Idle) { Messagebox.Show("你不在任何房间中,无法开始同步", "错误"); return; } if (sync != null) { sync.Stop(); } sync = VtCore.Handle.CreateSyncworker(username, status == LobbyStatus.Host); sync.Do(); }
public void CrearPersona(string pCodigo, string pNombres, string pApellidos, string pEmail, DateTime pFecha, decimal pSueldo) { if (!existeRegistro()) { Persona miPersona = new Persona(); miPersona.Codigo = pCodigo; miPersona.Nombres = pNombres; miPersona.Apellidos = pApellidos; miPersona.Email = pEmail; miPersona.FechNacimiento = pFecha; miPersona.Sueldo = pSueldo; Personas.Add(miPersona); } else { Messagebox.Show("Registro Ya Existe", "Mensaje de Error.."); } }
protected void AddChild1_Click(object sender, EventArgs e) { if (txtfamMemName.Text.Trim() != "" && ddlAge.SelectedItem.Text.ToString() != "" && ddlRelation.SelectedItem.Text.ToString() != "") { DataTable dt1 = ViewState["dt1"] as DataTable; dt1.Rows.Add(txtfamMemName.Text.Trim(), ddlAge.SelectedItem.Text.ToString(), ddlRelation.SelectedItem.Text.ToString()); ViewState["dt1"] = dt1; bindchildgrd(); txtfamMemName.Text = string.Empty; ddlAge.SelectedIndex = 0; ddlRelation.SelectedIndex = 0; } else { Messagebox.Show("Please Fill All Fields Mandatory (*) Fields!"); } }
protected void bind_FinancialYear() { try { CultureInfo Cult = new CultureInfo("hi-IN"); int previousyear = Convert.ToDateTime(DateTime.Now, Cult).Year - 1; int currentyear = Convert.ToDateTime(DateTime.Now, Cult).Year; string str = "select * from [M_Financial_Year] order by year_id asc"; DataTable dt = SQL_DBCS.ExecuteDataTable(str); if (dt.Rows.Count > 0) { ddlFinancial.DataTextField = "fin_year"; ddlFinancial.DataValueField = "fin_year"; ddlFinancial.DataSource = dt; ddlFinancial.DataBind(); ddlFinancial.Items.Insert(0, "--Select--"); } int year = Convert.ToDateTime(DateTime.Now).Year; year = Convert.ToDateTime(DateTime.Now).Year; if (year == 2019) { ddlFinancial.SelectedValue = "2019-2020"; } else if (year == 2020) { ddlFinancial.SelectedValue = "2020-2021"; } else if (year == 2021) { ddlFinancial.SelectedValue = "2021-2022"; } else if (year == 2022) { ddlFinancial.SelectedValue = "2022-2023"; } } catch (Exception ex) { Messagebox.Show(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { DeptCode(); BindGrid(); //checkLoginAndBindGrid(); //ViewState["VolumeID"] = ""; btnDelete.Visible = false; } } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
protected void btnSearch_Click(object sender, EventArgs e) { grd.PageIndex = 0; try { if (txtSearchDesignationName.Text != "") { SearchDesignation(); } else { Messagebox.Show("Please enter string in textbox to search State"); } } catch (Exception m) { Messagebox.Show("There is exeption"); } }
protected void btnDelete_Click(object sender, EventArgs e) { try { PL.sptype = 1; PL.TableID = Convert.ToInt32(lblTabid.Text.Trim()); // PL.CCODE = ddlDesignCatagoryCode.SelectedValue; PL.DepartmentCode = lblDepartmentCode.Text.Trim(); BL.insert(PL); lblMsg.Text = ""; Messagebox.Show(PL.msg); btnDelete.Enabled = false; Reset(); btnSave.Text = "Save"; } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
static KeyValuePair <string, string> GetOperatingSystemProductName() { KeyValuePair <string, string> OperatingSystemSpec = new KeyValuePair <string, string>(); ManagementObjectSearcher wmiOsInfo = new ManagementObjectSearcher("SELECT Caption, Version FROM Win32_OperatingSystem"); try { foreach (var os in wmiOsInfo.Get()) { var version = os["Version"].ToString(); var productName = os["Caption"].ToString(); OperatingSystemSpec = new KeyValuePair <string, string>(productName, version); } } catch (Exception ex) { Messagebox.Show(ex); } return(OperatingSystemSpec); }
protected void masterdelete_Click(object sender, EventArgs e) { try { LinkButton lnk = (LinkButton)sender; GridViewRow grdRow = (GridViewRow)lnk.Parent.Parent; int rowIndex = grdRow.RowIndex; Label lbltabid = (Label)grd_data.Rows[rowIndex].FindControl("TABID"); lbltabid.Text = lbltabid.Text; pl.TABLEID = Convert.ToInt32(lbltabid.Text); pl.sptype = 7; bl.Delete(pl); Messagebox.Show(pl.MSG); bindgrdData(); Reset(); } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
protected void Add_Click(object sender, EventArgs e) { if (txtJourneyFrom.Text.Trim() != "" && txtJourneyTo.Text != "" && txtModeofConveyance.Text.Trim() != "" && txtClass.Text.Trim() != "" && txtDistance.Text.Trim() != "" && txtRate.Text.Trim() != "" && txtDoJAmount.Text.Trim() != "") { DataTable dt = ViewState["dt"] as DataTable; dt.Rows.Add(txtJourneyFrom.Text.Trim(), txtJourneyTo.Text, txtModeofConveyance.Text.Trim(), txtClass.Text.Trim(), txtDistance.Text.Trim(), txtRate.Text.Trim(), txtDoJAmount.Text.Trim()); ViewState["dt"] = dt; bindchildgrd(); txtJourneyFrom.Text = string.Empty; txtJourneyTo.Text = string.Empty; txtModeofConveyance.Text = string.Empty; txtClass.Text = string.Empty; txtDistance.Text = string.Empty; txtRate.Text = string.Empty; txtDoJAmount.Text = string.Empty; } else { Messagebox.Show("Please Fill All Fields Mandatory (*) Fields!"); } }
private bool ValidaArchivo(HttpPostedFile file) { if (file == null) { Messagebox.Show(this, "No se pudo leer el archivo."); return(false); } try { Stream stream = file.InputStream; IWorkbook workbook = WorkbookFactory.Create(stream); ISheet sheet = workbook.GetSheetAt(0); } catch (Exception ex) { Messagebox.Show(this, "El archivo no es un archivo excel xls o xlsx valido"); return(false); } return(true); }
protected void Add_Click(object sender, EventArgs e) { if (txtChild.Text.Trim() != "" && txtDoB.Text != "" && txtClass.Text.Trim() != "" && txtMonthlyFee.Text.Trim() != "" && txtSchool.Text.Trim() != "" && txtReimbursementclaim.Text.Trim() != "" && txtTuitionactually.Text.Trim() != "") { DataTable dt = ViewState["dt"] as DataTable; dt.Rows.Add(txtChild.Text.Trim(), txtDoB.Text, txtSchool.Text.Trim(), txtClass.Text.Trim(), txtMonthlyFee.Text.Trim(), txtTuitionactually.Text.Trim(), txtReimbursementclaim.Text.Trim()); ViewState["dt"] = dt; bindchildgrd(); txtChild.Text = string.Empty; txtDoB.Text = string.Empty; txtSchool.Text = string.Empty; txtClass.Text = string.Empty; txtMonthlyFee.Text = string.Empty; txtReimbursementclaim.Text = string.Empty; txtTuitionactually.Text = string.Empty; } else { Messagebox.Show("Please Fill All Fields Mandatory (*) Fields!"); } }
void Start() { eraserIndicator.gameObject.SetActive(false); load.SetOnClickListener(() => { SelectFilePanel.Show(SelectFilePanel.SelectionType.Load); }); save.SetOnClickListener(() => { SelectFilePanel.Show(SelectFilePanel.SelectionType.Save); }); clear.SetOnClickListener(() => { Messagebox.Show("Are you sure you want to clear the lines?", () => { LineWorld.main.ClearLines(); }); }); play.SetOnClickListener(() => { PlaybackManager.main.SetPlayback(PlaybackManager.PlayStates.Playing); }); pause.SetOnClickListener(() => { PlaybackManager.main.SetPlayback(PlaybackManager.PlayStates.Pause); }); stop.SetOnClickListener(() => { PlaybackManager.main.SetPlayback(PlaybackManager.PlayStates.Stop); }); }
protected void btnDelete_Click(object sender, EventArgs e) { try { if (btnSave.Text == "Update") { pl.sptype = "2"; pl.TableID = txtTableID.Text; bl.Insert(pl); bindParent(); Reset(); Messagebox.Show(pl.msg); //ScriptManager.RegisterStartupScript(this, this.GetType(), "AlertBox", "alert('" + pl.msg + "');", true); } else { Messagebox.Show("Please Select Record To Delete"); } } catch (Exception ex) { Messagebox.Show(ex.Message.ToString()); } }