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()); } }
public void ThreadWork() { while (true) { List <MessageModel> mess = Program.Messages(Program.chat_name); foreach (MessageModel result in mess) { if (Program.last_message_id != result.messageId) { Messagebox.BeginInvoke(new MethodInvoker(() => { if (Program.clear_chat) { Messagebox.Text = ""; Program.clear_chat = false; } Messagebox.Text += result.username + ":" + result.message + "\n"; })); Program.last_message_id = result.messageId; } } Thread.Sleep(1000); } }
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); } } }
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); }
void ButtonSave_Click(object sender, EventArgs e) { ApplicationData data = ApplicationData.Create; data.PafFileAdress = Messagebox_String; Messagebox.Close(); }
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()); } }
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 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!"); } }
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); } }
private void pictureBox1_Click(object sender, EventArgs e) { double FORCE = Convert.ToDouble(textBox1.Text); double ANGLE = Convert.ToDouble(textBox2.Text); double Fx = FORCE * cos(ANGLE); double Fy Messagebox.show("Fx = " + Fx) }
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()); } }
public async Task <Boolean> IsValid() { if (Messagebox.Text == null || Messagebox.Text.Trim() == "") { await DisplayAlert("Alert", "Please Type a message..!", "Ok"); Messagebox.Focus(); return(false); } return(true); }
protected void grd_data_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { grd_data.PageIndex = e.NewPageIndex; } catch (Exception ex) { Messagebox.Show(ex.Message); } }
protected void btnReset_Click(object sender, EventArgs e) { try { Reset(); } catch (Exception ex) { Messagebox.Show(ex.ToString()); } }
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(); }); }
private void CheckTableIsCorrect(string tableID) { bool show = ConfigFile.ConfirmationMessageboxShow.ToLower() == "true" ? true : false; if (show) { Messagebox.ShowConfirmation(tableID + " ? ", tableID, true, true); } else { SendToWS(tableID); } }
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); }
// Update is called once per frame void Update() { if (gameObject.GetComponent <HP>().Health <= 0) { if (gameObject.GetComponent <CellObject>().moveAble == true) { Messagebox.MessageBox(IntPtr.Zero, "你被干掉了!", "嘻嘻", 0); Destroy(gameObject); SceneManager.LoadScene("Over"); } else { Messagebox.MessageBox(IntPtr.Zero, "恭喜胜利!", "嘻嘻", 0); Destroy(gameObject); } } }
/// <summary> /// sending a message on the button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { try { TcpClient client = new TcpClient(); client.Connect(IPAddress.Parse(MainWindow.ip_adres_serser), 10000); string textmessage = this.Messagebox.Text; int count_newLine = textmessage.Length / 30; string newtext = null; int count = 30; string[] mas = textmessage.Split(' '); for (int i = 0; i < mas.Length; i++) { if ((newtext + mas[i]).Length > count) { newtext += "&&" + mas[i] + " "; count += 30; } else { newtext += (mas[i] + " "); } } var buf = Encoding.Unicode.GetBytes(string.Format("009{0}\\{1}\\{2}", NameChat, myid, newtext)); NetworkStream s = client.GetStream(); s.Write(buf, 0, buf.Length); buf = new byte[4096]; var iReadServ = s.Read(buf, 0, buf.Length); string str = Encoding.Unicode.GetString(buf, 0, iReadServ); if (int.Parse(str) != 1) { MessageBox.Show("Сообщение не отправилось, повторите попытку"); } s.Close(); s = null; ViewMessage(NameChat, myid); Messagebox.Clear(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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(); }
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 btnConfirmTableNumber_Click(object sender, EventArgs e) { var q = from i in dc.Tbltables.ToList() select new { ID = i.Tablename, TableNumber = i.Tabledescription, }; if (q.Where(z => z.TableNumber == txtTableNumber.Text).Count() > 0) { CheckTableIsCorrect(txtTableNumber.Text); } else { Messagebox.ShowAlert("Table not exist."); } }
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 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"); } }