protected void grdSpecs_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit") { Response.Redirect("DictSpecsEdit.aspx?ID=" + e.CommandArgument); } }
protected void GrdProductDetail_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete") { dsProductMainPageSectionTableAdapters.ProductMainPageSectionTableAdapter taProductMainPageSection = new dsProductMainPageSectionTableAdapters.ProductMainPageSectionTableAdapter(); int CompanyId; int SubCategoryId; int CategoryId; int ProductGroupCode; #region SetListVariables CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]); CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]); SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]); ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]); #endregion string[] arg = new string[2]; arg = e.CommandArgument.ToString().Split(';'); int ProductId = Convert.ToInt32(arg[0]); int SectionCode = Convert.ToInt32(arg[1]); taProductMainPageSection.Prc_Ins_ProductMainPageSection(CompanyId, CategoryId, SubCategoryId, ProductGroupCode, SectionCode, ProductId); Response.Redirect("MainPageSectionDetail.aspx?CompanyId=" + CompanyId + "&CategoryId=" + CategoryId + "&SubCategoryId=" + SubCategoryId + "&ProductGroupCode=" + ProductGroupCode); } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit") { f_id.Text = e.CommandArgument.ToString(); } if (e.CommandName == "Delete") { int f_id = Convert.ToInt32(e.CommandArgument); BLL.procate myb = new BLL.procate(); int result = myb.num(f_id); if (result > 0) { msg("先把含有此父类的子类删除,才能删除父类"); } else { BLL.fathercate f_b = new BLL.fathercate(); int rs = f_b.delete(f_id); if (rs > 0) { msg("删除成功"); bing(); } else { msg("删除失败"); } } } }
protected void gvTipoDocumentos_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Editar") GetTipoDocumento(int.Parse(e.CommandArgument.ToString())); else if (e.CommandName == "Excluir") DeleteTipoDocumento(int.Parse(e.CommandArgument.ToString())); }
protected void grdvwViewAsset_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("AlphaPaging")) { string commandname = e.CommandArgument.ToString(); ViewState["commandname"] = e.CommandArgument.ToString(); col = ObjAsset.Get_By_comandname(commandname); if (col.Count != 0) { grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); } else { DataTable dt = new DataTable(); dt.Columns.Add("assetid"); dt.Columns.Add("computername"); dt.Columns.Add("domain"); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); grdvwViewAsset.DataSource = dt; grdvwViewAsset.DataBind(); //grdvwViewAsset.Rows[0].Cells[3].Visible = false; //grdvwViewAsset.Rows[0].Cells[5].Visible = false; } } }
protected void gvList_RowCommand1(object sender, GridViewCommandEventArgs e) { string cmdName = e.CommandName; int nodeId = int.Parse(e.CommandArgument.ToString()); NodeVO nodeVO = m_PostService.GetNodeById(nodeId); switch (cmdName) { case "myModify": m_Mode = nodeId; txtNodeName.Text = nodeVO.Name; txtSortNo.Text = nodeVO.SortNo.ToString(); //txtContent.Text = nodeVO.HtmlContent; ShowMode(); break; case "myDel": try { m_PostService.DeleteNode(nodeVO); m_WebLogService.AddSystemLog(MsgVO.Action.刪除, nodeVO); } catch (Exception ex) { ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "js", JavascriptUtil.AlertJS("無法刪除品名,尚有關聯資料。"), false); m_Log.Error(ex); } break; default: break; } GetList(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "edit") { Response.Redirect("~/employer/addeditposting.aspx?id=" + e.CommandArgument); } }
/// <summary> /// To Show CanceMoneyReceiptScreen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdManageMoneyReceipt_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == Globals.GridCommandEvents.CANCEL) { Event_ShowCanceMoneyReceiptScreen(Convert.ToInt32(e.CommandArgument)); } }
protected void gridViewData_RowCommand(object sender, GridViewCommandEventArgs e) { DataKey row = gridViewData.DataKeys[int.Parse(e.CommandArgument.ToString())]; if (e.CommandName == "cmdEdit") { // GridViewRow row = gridViewData.Rows[]; keyField.Value = row.Values[DIA_DIEM_DUA_RUOC_MIEN_PHI.cl_DIA_DIEM_ID].ToString(); txtTenVanPhong.Text = row.Values[DIA_DIEM_DUA_RUOC_MIEN_PHI.cl_TEN_DIA_DIEM].ToString(); txtDiaChi.Text = row.Values[DIA_DIEM_DUA_RUOC_MIEN_PHI.cl_DIA_CHI].ToString(); ddlTinhThanh.SelectedValue = row.Values[DIA_DIEM_DUA_RUOC_MIEN_PHI.cl_TINH_THANH].ToString(); txtURL.Text = row.Values[DIA_DIEM_DUA_RUOC_MIEN_PHI.cl_GHI_CHU].ToString(); btnSave.Text = "Cập nhật"; } else if (e.CommandName == "cmdDelete") { string delete = row.Values[DIA_DIEM_DUA_RUOC_MIEN_PHI.cl_DIA_DIEM_ID].ToString(); // HelpControls.ShowMsgBoxConfirmDelete(this); string sql = string.Format("delete from {0} where {1}={2}", DIA_DIEM_DUA_RUOC_MIEN_PHI.sTableName, DIA_DIEM_DUA_RUOC_MIEN_PHI.cl_DIA_DIEM_ID, delete); if (SQLConnectWeb.ExecSQL(sql)) { // HelpControls.ShowMsgBox(this, "Xóa dữ liệu thành công!"); InitListData(); if (delete == keyField.Value) btnClearNew_Click(null, null); } else { HelpControls.ShowMsgBox(this, "Dữ liệu đang được sử dụng!"); } } }
protected void Press_OnRowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("editPress")) { Response.Redirect("EditPress.aspx?pressId=" + e.CommandArgument.ToString()); } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "viewdetails") { Response.Redirect("~/jobseeker/viewjobposting.aspx?id=" + e.CommandArgument); } }
//SexBLL bll = new SexBLL(); //protected void ButtonNew_Click(object sender, EventArgs e) //{ // if (string.IsNullOrEmpty(txtName.Text)) return; // Guid ID = bll.Insert(txtName.Text); // GridView1.DataBind(); //} protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { } }
protected void gv_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow gvr = (GridViewRow)((Control)e.CommandSource).NamingContainer; int rowIndex = gvr.RowIndex; if (e.CommandName == "sell") { // string orderdate =GridView1.Rows[rowIndex].Cells[0].Text; //string symbol = GridView1.Rows[rowIndex].Cells[1].Text; //string qunatity = GridView1.Rows[rowIndex].Cells[2].Text; //string marketprice = GridView1.Rows[rowIndex].Cells[4].Text; Label orderdate1 = GridView1.Rows[rowIndex].FindControl("ID2") as Label; Label symbol1 = GridView1.Rows[rowIndex].FindControl("ID3") as Label; Label qunatity1 = GridView1.Rows[rowIndex].FindControl("ID4") as Label; Label marketprice1 = GridView1.Rows[rowIndex].FindControl("ID6") as Label; string orderdate = orderdate1.Text; string symbol = symbol1.Text; string qunatity = qunatity1.Text; string marketprice = marketprice1.Text; Session["orderdate1"] = orderdate; Session["symbol1"] = symbol; Session["quantity1"] = qunatity; Session["marketprice1"] = marketprice; Response.Redirect("SellStock.aspx"); } }
protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName != "Page") {//Paginação int iIndice = (((GridView)sender).PageIndex * ((GridView)sender).PageSize) + int.Parse(e.CommandArgument.ToString()); if (e.CommandName == "Alterar") { DataTable lTable = (DataTable)ViewState["WRK_TABLE"]; if (lTable.Rows.Count > 0) { Response.Redirect("editNoticia.aspx?NOT_ID=" + lTable.Rows[iIndice][PORT_NOTICIAQD._NOT_ID.Name].ToString()); } } else if (e.CommandName == "Excluir") { DataTable lTable = (DataTable)ViewState["WRK_TABLE"]; } } } catch (Exception err) { exibirMensagem(UpdatePanelPrincipal, "Erro", err.Message, "erro"); } }
protected void gvUnassignedProj_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "btnView") { int row = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = gvUnassignedProj.Rows[row]; Session["projID"] = Convert.ToInt32(selectedRow.Cells[0].Text); Response.Redirect("~/PM/ManageProject.aspx"); } if (e.CommandName == "btnActivate") { int row = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = gvUnassignedProj.Rows[row]; Project proj = ff.Projects.Where(p => p.projId == Convert.ToInt32(selectedRow.Cells[0].Text)).First(); proj.isActive = 1; ff.SubmitChanges(); //Response.Redirect("~/PM/ProjectList.aspx"); populateProjectList(); } } catch (Exception exception) { //lblException.Text = exception.StackTrace; } }
protected void gvData_RowCommand(object sender, GridViewCommandEventArgs e) { int ID = Convert.ToInt32(e.CommandArgument.ToString()); if (e.CommandName.Equals("btnEdit")) { if (ID != 0) { DTO.MAD_ActivityType item = BUS.MAD_ActivityType.GetByID(ID); if (item != null) { btnOK.Text = "Cập nhật"; lbModal_Title.Text = "Cập nhật Activity Type"; hdID.Value = item.ActivityTypeNo_.ToString(); LoadDataObject(item.ActivityTypeNo_); if (ddlParentNo_.Items.Count > 0) ddlParentNo_.SelectedValue = item.ParentNo_.ToString(); txtActivityTypeName.Text = item.ActivityTypeName; ddlStatus.SelectedValue = item.Status.ToString(); ModelData.Show(); } } } if (e.CommandName.Equals("btnTrash")) { if (ID != 0) { BUS.MAD_ActivityType.Delete(ID); LoadData(); } } }
protected void gvAuth_RowCommand(object sender, GridViewCommandEventArgs e) { string cmdName = e.CommandName; string cmdArg = e.CommandArgument.ToString(); Control ctrl = ((Control)e.CommandSource); FunctionPath fp = authService.myService.DaoGetVOById<FunctionPath>(int.Parse(cmdArg)); switch (cmdName) { case "MyUpdate": fp.Path = UIHelper.FindTextBoxText(ctrl, "txtFPath"); authService.myService.DaoUpdate(fp); lblMsg.Text = MsgVO.UPDATE_OK; fillData(); break; case "MyDel": fp.BelongMenuFunc.FuncionPaths.Remove(fp); authService.myService.DaoDelete(fp); lblMsg.Text = MsgVO.DELETE_OK; fillData(); break; } }
protected void gvValoresCampo_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Editar") GetCampoOpcao(int.Parse(e.CommandArgument.ToString())); else if (e.CommandName == "Excluir") Excluir(int.Parse(e.CommandArgument.ToString())); }
protected void gvOS_RowCommand(object sender, GridViewCommandEventArgs e) { int index = 0; switch (e.CommandName) { case "fechar": index = Convert.ToInt32(e.CommandArgument); OS os = new OS(); OSBD bd = new OSBD(); os = bd.Select(index); string Data = os.HoraSaida.ToShortDateString(); if (Data == "01/01/0001") { Session["OS"] = index; Response.Redirect("Fechar.aspx"); lblMensagem.Text = ""; } else { lblMensagem.Text = "OS já encerrada!"; } break; default: break; } }
protected void gvPortfolio_RowCommand(object sender, GridViewCommandEventArgs e) { int i; if (e.CommandName == "InActive") { // write code to update column to 0 //if (objPortfolio.updateStatus(0, int.Parse(e.CommandArgument.ToString()))) //{ // message = "User status has been updated successfully."; //} //else //{ // message = "Unable to update status of user."; //} } else if (e.CommandName == "Active") { // write code to update column to 1 //if (objPortfolio.updateStatus(1, int.Parse(e.CommandArgument.ToString()))) //{ // message = "User status has been updated successfully."; //} //else //{ // message = "Unable to update status of user."; //} } else if (e.CommandName == "Delete") { } BindData(); }
protected void gvProgramas_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Editar") GetPrograma(int.Parse(e.CommandArgument.ToString())); else if (e.CommandName == "Excluir") DeletePrograma(int.Parse(e.CommandArgument.ToString())); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "insert") { string lot_no, stack, size, no, vol, ctt, remarks, name_party, bid; DropDownList chl = ((DropDownList)(GridView1.FooterRow.FindControl("chl"))); lot_no = ((TextBox)(GridView1.FooterRow.FindControl("lot_no"))).Text; stack = ((TextBox)(GridView1.FooterRow.FindControl("stack_no"))).Text; size = ((DropDownList)(GridView1.FooterRow.FindControl("size"))).Text; no = ((TextBox)(GridView1.FooterRow.FindControl("no"))).Text; vol = ((TextBox)(GridView1.FooterRow.FindControl("vol"))).Text; ctt = ((TextBox)(GridView1.FooterRow.FindControl("ctt"))).Text; remarks = ((TextBox)(GridView1.FooterRow.FindControl("remarks"))).Text; name_party = ((TextBox)(GridView1.FooterRow.FindControl("name_party"))).Text; bid = ((TextBox)(GridView1.FooterRow.FindControl("bid"))).Text; SqlDataSource1.InsertParameters["challan_no"].DefaultValue = chl.SelectedItem.Text.ToString(); SqlDataSource1.InsertParameters["date"].DefaultValue = TextBox1.Text.ToString(); SqlDataSource1.InsertParameters["stack"].DefaultValue = stack.ToString(); SqlDataSource1.InsertParameters["lot_no"].DefaultValue = lot_no.ToString(); SqlDataSource1.InsertParameters["size"].DefaultValue = size.ToString(); SqlDataSource1.InsertParameters["no"].DefaultValue = no; SqlDataSource1.InsertParameters["vol"].DefaultValue = vol.ToString(); SqlDataSource1.InsertParameters["ctt"].DefaultValue = ctt.ToString(); SqlDataSource1.InsertParameters["remarks"].DefaultValue = remarks.ToString(); SqlDataSource1.InsertParameters["bid"].DefaultValue = bid.ToString(); SqlDataSource1.InsertParameters["name_party"].DefaultValue = name_party.ToString(); SqlDataSource1.Insert(); GridView1.DataSource = SqlDataSource1; GridView1.DataBind(); bnk(); } }
/// <summary> /// Get the appointmentId from the row that was clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void AppointmentsGridView_RowCommand(object sender, GridViewCommandEventArgs e) { LinqDataManipulator apps = new LinqDataManipulator(); Notifier textDoctor; try { GridViewRow gvr = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int RowIndex = gvr.RowIndex; appointmentId = Convert.ToInt32(gvr.Cells[1].Text); apps.UpdateAppointments(appointmentId); // Text the Doctor about the upcoming appointment doctorText = apps.CreateText(appointmentId); textDoctor = new Notifier(doctorText); Page_Load(sender, e); } catch (Exception) { throw; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Add") { String strName = ((TextBox)GridView1.FooterRow.FindControl("txtName")).Text; string strAge =((TextBox)GridView1.FooterRow.FindControl("txtAge")).Text; string strSex = ((TextBox)GridView1.FooterRow.FindControl("txtSex")).Text; //SqlDataSource1.InsertParameters.Clear(); //SqlDataSource1.InsertParameters.Add //("FirstName", strFirstName); //SqlDataSource1.InsertParameters.Add //("LastName", strLastName); //SqlDataSource1.InsertParameters.Add //("Department", strDepartment); //SqlDataSource1.InsertParameters.Add //("Location", strLocation); SqlDataSource1.InsertParameters["Name"].DefaultValue = strName; SqlDataSource1.InsertParameters["Age"].DefaultValue = strAge; SqlDataSource1.InsertParameters["Sex"].DefaultValue = strSex; SqlDataSource1.Insert(); } }
protected void gdvMessDish_RowCommand(object sender, GridViewCommandEventArgs e) { int i = 0; if (e.CommandName == "editing") { txtDishName.Text = e.CommandArgument.ToString().Split('@')[1].ToString(); hdnMessDish.Value = e.CommandArgument.ToString().Split('@')[0].ToString(); if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Morning Snacks") ddlMeal.SelectedIndex = 1; if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Breakfast") ddlMeal.SelectedIndex = 2; if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Lunch") ddlMeal.SelectedIndex = 3; if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Evenin Snacks") ddlMeal.SelectedIndex = 4; if (e.CommandArgument.ToString().Split('@')[2].ToString() == "Dinner") ddlMeal.SelectedIndex = 5; btnAdd.Text = "Update"; } if (e.CommandName == "del") { hdnMessDish.Value = e.CommandArgument.ToString().Split('@')[0].ToString(); i = objMess.DeleteMessDish(Convert.ToInt32(hdnMessDish.Value)); if (i > 0) { lblMessage.Visible = true; lblMessage.Text = txtDishName.Text + " DishName Deleted Successfully"; txtDishName.Text = ""; bindMessDish(); } btnAdd.Text = "Add"; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { int _langId = int.Parse(e.CommandArgument.ToString()); switch (e.CommandName) { case "Delete": if (Enidc.Web.Business.Language.DeleteLanguage(_langId)) { //delete ok this.BindGrid(); } else { //delete has some problems return; } // Response.Write(e.CommandArgument.ToString()); break; case "ChangeStatus": if (Enidc.Web.Business.Language.ChangeToDefault(_langId)) { this.BindGrid(); } else { return; } break; default: break; } }
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Add") { DataTable dt = (DataTable)(ViewState["ab"]); string des = ((DropDownList)(GridView2.FooterRow.FindControl("des1"))).SelectedItem.Text.ToString(); Int32 no = Convert.ToInt32(((TextBox)(GridView2.FooterRow.FindControl("no"))).Text); decimal wtqtl = Convert.ToDecimal(((TextBox)(GridView2.FooterRow.FindControl("wtqtl"))).Text); decimal wtkg = Convert.ToDecimal(((TextBox)(GridView2.FooterRow.FindControl("wtkg"))).Text); decimal wtqtl1 = Convert.ToDecimal(((TextBox)(GridView2.FooterRow.FindControl("textbox17"))).Text); decimal wt1 = Convert.ToDecimal(((TextBox)(GridView2.FooterRow.FindControl("wtkg1"))).Text); string batch = ((TextBox)(GridView2.FooterRow.FindControl("batch"))).Text.ToString(); string remark = ((TextBox)(GridView2.FooterRow.FindControl("remark"))).Text.ToString(); DataRow r; r = dt.NewRow(); r[0] = des; r[1] = no; r[2] = wtqtl; r[3] = wtkg; r[4] = wtqtl1; r[5] = wt1; r[6] = batch; r[7] = remark; dt.Rows.Add(r); GridView2.DataSource = dt; GridView2.DataBind(); } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[index]; if (e.CommandName == "Accept") { con.Open(); string id = (GridView1.Rows[index].Cells[0].Text); SqlCommand com4 = new SqlCommand("UPDATE booking SET status='Confirmed' WHERE empid=@empid and status='Requested'", con); com4.Parameters.AddWithValue("@empid", id); com4.ExecuteNonQuery(); con.Close(); GridView1.EditIndex = -1; BindSubjectData(); } else if (e.CommandName == "Reject") { con.Open(); string id = (GridView1.Rows[index].Cells[0].Text); SqlCommand com4 = new SqlCommand("UPDATE booking SET status='Rejected' WHERE empid=@empid and status='Requested'", con); com4.Parameters.AddWithValue("@empid", id); com4.ExecuteNonQuery(); con.Close(); GridView1.EditIndex = -1; BindSubjectData(); } }
protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "delRecord") { string strMessage = ""; //int intIndex = Convert.ToInt32(e.CommandArgument); /*strMessage = GridView1.SelectedIndex.ToString(); strMessage = GridView1.SelectedRow.Cells[0].Text.ToString(); strMessage = GridView1.Rows[GridView1.SelectedIndex].Cells[0].Text.ToString();*/ //GridView1.SelectedRow /*BL_VirtualCard objVirtual = new BL_VirtualCard(); int intResult = objVirtual.DeleteWalletCard(strMessage); if (intResult > 0) strMessage = "Card Deleted successfully."; else strMessage = "Card not deleted. Please try again"; divMessage.Visible = true; divMessage.InnerText = strMessage.ToString(); divAddCard.Visible = true; clearData(); LoadExistingCards(strUserName);*/ } }
protected void gvCliBlo_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "Nuevo": { #region Nuevo Session["editOp"] = false; MpUp_MA.Hide(); gvCliBlo.EditIndex = -1; Session["dtDoc"] = null; DataTable dt = ((DataTable)Session["dtVigencia"]).Copy(); Session["RANew"] = Convert.ToInt32(e.CommandArgument.ToString()); if (dt.Rows[0][0].ToString() == "##" & gvCliBlo.Rows.Count == 1) { gvCliBlo.EditIndex = 0; gvCliBlo.DataSource = dt; gvCliBlo.DataBind(); } else { DataRow rw = dt.NewRow(); for (int i = 0; i <= dt.Columns.Count - 1; i++) { rw[i] = DBNull.Value; } dt.Rows.Add(rw); gvCliBlo.DataSource = dt; gvCliBlo.DataBind(); gvCliBlo.PageIndex = gvCliBlo.PageCount; gvCliBlo.DataBind(); gvCliBlo.EditIndex = gvCliBlo.Rows.Count - 1; gvCliBlo.DataBind(); } #endregion } break; case "Buscar": { #region Buscar Session["dtDoc"] = null; DataTable dt2 = ((DataTable)Session["dtVigencia"]).Copy(); if (dt2.Rows[0][0].ToString() == "##" & gvCliBlo.Rows.Count == 1) { return; } gvCliBlo.EditIndex = -1; gvCliBlo.DataSource = Session["dtVigencia"]; gvCliBlo.DataBind(); gv_Alertas.DataSource = new DataTable(); gv_Alertas.DataBind(); txtIdBusq.Text = String.Empty; txtMSGBusq.Text = String.Empty; lblId.Text = "Id:"; lblTxtCod.Text = "Codigo:"; txtIdBusq_TextBoxWatermarkExtender.WatermarkText = "Id"; txtMSGBusq_TextBoxWatermarkExtender.WatermarkText = "Cliente"; gv_Alertas.Visible = true; pnlMpBA.Visible = true; MpUp_MA.Show(); #endregion } break; case "Editar": { #region Editar Session["dtDoc"] = null; DataTable dt = ((DataTable)Session["dtVigencia"]).Copy(); ServCBloqueados serv = new ServCBloqueados(); string IdCli = gvCliBlo.Rows[Convert.ToInt32(e.CommandArgument.ToString())].Cells[0].Text.Trim(); Session["editOp"] = true; MpUp_MA.Hide(); if (dt.Rows[0][0].ToString() != "##") { Session["RANew"] = 0; gvCliBlo.EditIndex = Convert.ToInt32(e.CommandArgument.ToString()); gvCliBlo.DataSource = Session["dtVigencia"]; gvCliBlo.DataBind(); } ((TextBox)gvCliBlo.Rows[Convert.ToInt32(e.CommandArgument.ToString())].FindControl("txtIdCli")).Enabled = false; var itemSelected = serv.findClient(IdCli.ToString(), "8", ((IUsr)Session["Usr"]).usr.Pais.IdPais.ToString()); #endregion } break; case "Guardar": { #region Guardar var Id = gvCliBlo.Rows[Convert.ToInt32(e.CommandArgument.ToString())].Cells[0].Text.Trim(); var IdCli = ((TextBox)gvCliBlo.Rows[Convert.ToInt32(gvCliBlo.EditIndex)].FindControl("txtIdCli")).Text; var vigencia = ((TextBox)gvCliBlo.Rows[Convert.ToInt32(e.CommandArgument.ToString())].FindControl("txtVigencia")).Text.Trim(); ServCBloqueados serv = new ServCBloqueados(); switch (((int)Session["RANew"])) { case 0: { //Actualizar Cli string res = serv.updateValidyty(Id, IdCli, vigencia, ((IUsr)Session["Usr"]).usr.Pais.IdPais.ToString()); if (res.CompareTo("0") == 0) { lblEInsUp.ForeColor = Color.Red; lblEInsUp.Text = "No se ha podido realizar la modificación"; lblEInsUp.Visible = true; } else { Response.Redirect(Request.RawUrl); } } break; case 1: { //Nuevo Cli IdCli = ((TextBox)gvCliBlo.Rows[Convert.ToInt32(e.CommandArgument.ToString())].FindControl("txtIdCli")).Text.Trim(); string res = serv.insertValidity(IdCli, vigencia, ((IUsr)Session["Usr"]).usr.Pais.IdPais.ToString()); if (res.CompareTo("0") == 0) { lblEInsUp.ForeColor = Color.Red; lblEInsUp.Text = "El cliente ya se encuentra registrado"; lblEInsUp.Visible = true; } else { if (res.CompareTo("-1") == 0) { lblEInsUp.ForeColor = Color.Red; lblEInsUp.Text = "Datos Incorrectos"; lblEInsUp.Visible = true; } else { Response.Redirect(Request.RawUrl); } } } break; } #endregion } break; case "Borrar": { #region Borrar if (gvCliBlo.EditIndex != -1) { return; } var IdCli = gvCliBlo.Rows[Convert.ToInt32(e.CommandArgument.ToString())].Cells[0].Text.Trim(); ServCBloqueados serv = new ServCBloqueados(); string res = serv.deleteValidity(IdCli, ((IUsr)Session["Usr"]).usr.Pais.IdPais.ToString()); if (res.CompareTo("0") == 0) { lblEInsUp.ForeColor = Color.Red; lblEInsUp.Text = "No se pudo eliminar el Cliente"; lblEInsUp.Visible = true; } else { Response.Redirect(Request.RawUrl); } #endregion } break; case "Cancelar": { #region Cancelar MpUp_MA.Hide(); Session["dtDoc"] = null; lblEInsUp.Visible = false; Session["RANew"] = 0; gvCliBlo.EditIndex = -1; gvCliBlo.DataSource = Session["dtVigencia"]; gvCliBlo.DataBind(); #endregion } break; } }
// Permite visualizar todos los usuarios y realizar acciones con cada registro protected void grvAdminUsuario_RowCommand(object sender, GridViewCommandEventArgs e) { listas(); int index = int.Parse(e.CommandArgument.ToString()); GridViewRow row = grvAdminUsuario.Rows[(index)]; // Permite consultar los datos de un usuario if (e.CommandName == "Consultar_Click") { int usuario = int.Parse(row.Cells[1].Text); DataTable dt = new DataTable(); dt = Control.ConsultarUsuario(usuario); divConsultar.Visible = true; divAcciones.Visible = false; divAdicionar.Visible = false; divPermisos.Visible = false; grvConsultarUsuario.DataSource = dt; grvConsultarUsuario.DataBind(); } // Permite modificar los datos de un usuario if (e.CommandName == "Modificar_Click") { int usuario = int.Parse(row.Cells[1].Text); DataTable dt = new DataTable(); dt = Control.ConsultarUsuarioModificar(usuario); if (dt.Rows.Count > 0) { txtCedula.Text = dt.Rows[0]["con_Id"].ToString(); txtPrimerNombre.Text = dt.Rows[0]["con_PrimerNombre"].ToString(); txtSegundoNombre.Text = dt.Rows[0]["con_SegundoNombre"].ToString(); txtPrimerApellido.Text = dt.Rows[0]["con_PrimerApellido"].ToString(); txtSegundoApellido.Text = dt.Rows[0]["con_SegundoApellido"].ToString(); ddlDepartamento.Items.FindByText(dt.Rows[0]["dep_Nombre"].ToString()).Selected = true; ddlDepartamento_SelectedIndexChanged(sender, e); ddlCiudad.Items.FindByText(dt.Rows[0]["ciu_Nombre"].ToString()).Selected = true; ddlAgencia.Items.FindByText(dt.Rows[0]["age_Nombre"].ToString()).Selected = true; ddlCargo.Items.FindByText(dt.Rows[0]["car_Nombre"].ToString()).Selected = true; ddlNivel.Items.FindByText(dt.Rows[0]["niv_Nombre"].ToString()).Selected = true; txtUsuario.Text = dt.Rows[0]["con_Usuario"].ToString(); txtContrasena.Text = dt.Rows[0]["con_Password"].ToString(); ddlEstado.Items.FindByText(dt.Rows[0]["est_Nombre"].ToString()).Selected = true; } divAdicionar.Visible = true; titleAdicionar.Visible = false; btnGuardar.Visible = false; divAcciones.Visible = false; divConsultar.Visible = false; divPermisos.Visible = false; grvConsultarUsuario.DataSource = dt; grvConsultarUsuario.DataBind(); } // Permite asignar las restricciones del sistema para un usuario if (e.CommandName == "Asignar_Click") { int con_Id = int.Parse(row.Cells[1].Text); Session["con_Id"] = con_Id; lblConUsuario.Text = "Nombre: " + row.Cells[2].Text; lblNombre.Text = "Usuario: " + row.Cells[3].Text; txtPerId.Text = row.Cells[7].Text; DataTable dt = new DataTable(); dt = Control.ListarFormularioAsignados(); divPermisos.Visible = true; divAcciones.Visible = false; divAdicionar.Visible = false; divConsultar.Visible = false; } // Permite eliminar un usuario if (e.CommandName == "Eliminar_Click") { int usuario = int.Parse(row.Cells[1].Text); DataTable dt = new DataTable(); dt = Control.EliminarUsuario(usuario); Response.RedirectToRoute("gestionUsuarios"); } }
protected void grd_RowCommand(object sender, GridViewCommandEventArgs e) { try { ltrErr.Text = ""; if (e.CommandName == "del") { string[] arg = e.CommandArgument.ToString().Split(':'); if (arg != null && arg.Length == 2) { int deptId = 0; int.TryParse(arg[1], out deptId); objmysqldb.ConnectToDatabase(); dtdeptList = objmysqldb.GetData("Select department_id from department_master WHERE department_id =" + deptId + " "); string qu = "Select empId from employee_master WHERE EmpDeptID=" + deptId + ""; DataTable dtemp = objmysqldb.GetData(qu); if (dtemp != null && dtemp.Rows.Count > 0) { ltrErr.Text = "Employee Assign to selected Department so you can't delete it"; return; } else { int.TryParse(Request.Cookies["LoginCookies"]["UserId"].ToString(), out user_id); DateTime currenttime = Logger.getIndiantimeDT(); string query = "Update department_master set IsDelete=1,modify_datetime=" + currenttime.Ticks + ",IsUpdate=1,UserID=" + user_id + " where department_id=" + deptId + " "; objmysqldb.OpenSQlConnection(); int res = objmysqldb.InsertUpdateDeleteData(query); if (res != 1) { ltrErr.Text = "Please Try Again."; Logger.WriteCriticalLog("Manage_Department 194 Update error."); } else { grd.EditIndex = -1; showgrid(); ltrErr.Text = "Department Delete Successfully."; } } } else { showgrid(); ltrErr.Text = "Please Try Again."; } grd.EditIndex = -1; } else if (e.CommandName == "Edit") { } } catch (Exception ex) { Logger.WriteCriticalLog("Manage_Department 218: exception:" + ex.Message + "::::::::" + ex.StackTrace); } finally { objmysqldb.CloseSQlConnection(); objmysqldb.disposeConnectionObj(); } }
protected void PPRDetailsGridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "ActionUrl") { string Action = e.CommandArgument.ToString(); if (Action.Equals("Submitted")) { Response.Redirect("../LinMin/PprApprovalRequest.aspx"); } if (Action.Equals("Verified")) { Response.Redirect("../LinMin/PPMRemark.aspx"); } if (Action.Equals("Comments Received")) { Response.Redirect("../LinMin/sendtodea.aspx"); } if (Action.Equals("Marked for Comments")) { Response.Redirect("../LinMin/QMS.aspx"); } } if (e.CommandName == "ViewPpr") { try { string PprId = e.CommandArgument.ToString(); string url = "../LinMin/PprPreview.aspx?PPRID=" + PprId; string s = "window.open('" + url + "', 'popup_window', 'width=1100,height=700,left=200,top=50,resizable=yes');"; ClientScript.RegisterStartupScript(this.GetType(), "script", s, true); } catch (Exception ex) { LogError(ex); } } if (e.CommandName == "ProposalPreview") { ViewState["PPRId"] = e.CommandArgument.ToString(); PPRDataBL obj = new PPRDataBL(); DataTable dt = new DataTable(); dt = obj.GetFinalPprDocDataBL(HttpUtility.HtmlEncode(ViewState["PPRId"].ToString())); if (dt.Rows.Count > 0) { if (dt.Rows[0]["RelevantDocumentOne"].ToString() == null || dt.Rows[0]["RelevantDocumentOne"].ToString() == "" || dt.Rows[0]["RelevantDocumentOne"].ToString() == "N") { Label9.Text = "File Not available"; btnRelevantDocumentTwo.Visible = false; RD2.Visible = false; } else { btnRelevantDocumentTwo.CommandArgument = dt.Rows[0]["RelevantDocumentOne"].ToString(); btnRelevantDocumentTwo.Visible = true; } if (dt.Rows[0]["RelevantDocumentTwo"].ToString() == null || dt.Rows[0]["RelevantDocumentTwo"].ToString() == "" || dt.Rows[0]["RelevantDocumentTwo"].ToString() == "N") { Label10.Text = "File Not available"; btnRelevantDocumentThree.Visible = false; RD3.Visible = false; } else { btnRelevantDocumentThree.CommandArgument = dt.Rows[0]["RelevantDocumentTwo"].ToString(); btnRelevantDocumentThree.Visible = true; } if (dt.Rows[0]["TechnicalDocument"].ToString() == null || dt.Rows[0]["TechnicalDocument"].ToString() == "" || dt.Rows[0]["TechnicalDocument"].ToString() == "N") { Label2.Text = "File Not available"; lnkTechnicalDocument.Visible = false; Sd.Visible = false; } else { lnkTechnicalDocument.CommandArgument = dt.Rows[0]["TechnicalDocument"].ToString(); lblpd.Text = ""; lnkTechnicalDocument.Visible = true; } if (dt.Rows[0]["DebtSustCert"].ToString() == "NA") { lnkpd.Visible = false; lblpd.Text = "File Not available"; } else { lnkpd.CommandArgument = dt.Rows[0]["DebtSustCert"].ToString(); lblpd.Text = ""; lnkpd.Visible = true; } if (dt.Rows[0]["PrevPhase"].ToString() == "NA") { lnkPPD.Visible = false; lblPPD.Text = "File Not available"; PP.Visible = false; } else { lnkPPD.CommandArgument = dt.Rows[0]["PrevPhase"].ToString(); lblPPD.Text = ""; lnkPPD.Visible = true; } if (dt.Rows[0]["StaClearance"].ToString() == "NA") { lnkSc.Visible = false; lblSc.Text = "File Not available"; } else { lnkSc.Visible = true; lblSc.Text = ""; lnkSc.CommandArgument = dt.Rows[0]["StaClearance"].ToString(); } if ((dt.Rows[0]["RevisedPpr"].ToString() == "RP" || dt.Rows[0]["RevisedPpr"].ToString() != "") && dt.Rows[0]["RevisedPpr"].ToString() != "NA") { RPpr.Visible = true; } else { RPpr.Visible = false; } if (dt.Rows[0]["DefermentPpr"].ToString() == "DP") { DPpr.Visible = true; } else { DPpr.Visible = false; } } ModalPopupExtender1.Show(); } }
protected void ContactsGridView_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow row = GridView1.Rows[0]; if (e.CommandName == "duzelt") { for (int i = 0; i < GridView1.Rows.Count; i++) { if (GridView1.Rows[i].Cells[0].Text == e.CommandArgument.ToString()) { row = GridView1.Rows[i]; } } arizaId = row.Cells[0].Text; ariza_numarasi.Text = (row.Cells[1].Text).Trim(); kisi.Text = string.Compare((row.Cells[3].Text).Trim(), " ", true) == 0 ? string.Empty : (row.Cells[3].Text); form_DropDownList_1.ClearSelection(); form_DropDownList_1.Items.Clear(); setArizaTur(((Label)row.Cells[4].FindControl("lbl_tur")).Text); marka.Text = string.Compare((row.Cells[5].Text).Trim(), " ", true) == 0 ? string.Empty : (row.Cells[5].Text); model.Text = string.Compare((row.Cells[6].Text).Trim(), " ", true) == 0 ? string.Empty : (row.Cells[6].Text); seri_no.Text = string.Compare((row.Cells[7].Text).Trim(), " ", true) == 0 ? string.Empty : (row.Cells[7].Text); comment.Text = string.Compare((row.Cells[8].Text).Trim(), " ", true) == 0 ? string.Empty : (row.Cells[8].Text); phone.Text = string.Compare((row.Cells[11].Text).Trim(), " ", true) == 0 ? string.Empty : (row.Cells[11].Text); dahili.Text = string.Compare((row.Cells[12].Text).Trim(), " ", true) == 0 ? string.Empty : (row.Cells[12].Text); faks.Text = string.Compare((row.Cells[13].Text).Trim(), " ", true) == 0 ? string.Empty : (row.Cells[13].Text); this.ModalPopupDuzelt.Show(); } else if (e.CommandName == "sil") { for (int i = 0; i < GridView1.Rows.Count; i++) { if (GridView1.Rows[i].Cells[0].Text == e.CommandArgument.ToString()) { row = GridView1.Rows[i]; } } arizaId = row.Cells[0].Text; arizaNoD.Text = row.Cells[1].Text; //mesaj(arizaId + " delete"); this.ModalPopupDelete.Show(); } else if (e.CommandName == "inform") { for (int i = 0; i < GridView1.Rows.Count; i++) { if (GridView1.Rows[i].Cells[0].Text == e.CommandArgument.ToString()) { row = GridView1.Rows[i]; } } durumu = Convert.ToInt32(row.Cells[10].Text); arizaNo.Text = row.Cells[1].Text; ilgiliAd.Text = row.Cells[3].Text; telNo.Text = row.Cells[11].Text + " (" + row.Cells[12].Text + ")"; //+dahili faksNo.Text = row.Cells[13].Text; markaAd.Text = row.Cells[5].Text; modelAd.Text = row.Cells[6].Text; seriNo.Text = row.Cells[7].Text; arizaAd.Text = ((Label)row.Cells[4].FindControl("lbl_tur")).Text; tarih.Text = row.Cells[2].Text; aciklama.Text = row.Cells[8].Text; mdate.Text = row.Cells[9].Text; /*if (row.Cells[10].Text == "1") durumu = 1;*/ //mesaj("e:" + e.CommandArgument.ToString()); /*try { string sorgu1 = "SELECT ariza.yil, ariza.no, kurum.ad,kurum.adres,ariza.tel,ariza.dahili,ariza.faks,ariza.marka,ariza.model,ariza.serino,ariza.aciklama,ariza.adate,ariza.ilgili_ad,ariza_tur.ad AS adT FROM ariza, kurum, ariza_tur WHERE ariza.kurum_id = kurum.id AND ariza_tur.id = ariza.tur_id AND ariza.id = " + Request.QueryString["no"]; SqlConnection con = baglantiV(); DataTable dtt = new DataTable(); SqlDataAdapter sql = new SqlDataAdapter(sorgu1, con); sql.Fill(dtt); if (dtt.Rows.Count > 0) { lblNo.Text = dtt.Rows[0]["yil"].ToString() + "-" + dtt.Rows[0]["no"].ToString(); lblKurum.Text = dtt.Rows[0]["ad"].ToString(); lblAdres.Text = dtt.Rows[0]["adres"].ToString(); lblDate.Text = dtt.Rows[0]["adate"].ToString(); lblAd.Text = lblAd2.Text = dtt.Rows[0]["ilgili_ad"].ToString(); lblTel.Text = dtt.Rows[0]["tel"].ToString(); lblDahili.Text = dtt.Rows[0]["dahili"].ToString(); lblFaks.Text = dtt.Rows[0]["faks"].ToString(); lblMarka.Text = dtt.Rows[0]["marka"].ToString(); lblModel.Text = dtt.Rows[0]["model"].ToString(); lblSeri.Text = dtt.Rows[0]["serino"].ToString(); lblAriza.Text = dtt.Rows[0]["adT"].ToString(); lblAciklama.Text = dtt.Rows[0]["aciklama"].ToString(); } con.Dispose(); con.Close(); } catch { Response.Write("Hata oldu. "); }*/ if(durumu>=1) mesaj("e:" + e.CommandArgument.ToString()); this.programmaticModalPopup.Show(); } else return; }
protected void grdv_Usuarios_RowCommand(object sender, GridViewCommandEventArgs e) { string comand = e.CommandName; int index = Convert.ToInt32(e.CommandArgument); string codigo = grdv_Usuarios.DataKeys[index].Value.ToString(); int id = Int32.Parse(codigo); switch (comand) { case "editUsuario": { lblIdUsuario.Text = codigo; SqlConnection conn = null; SqlDataReader rdr = null; try { string SQL = "getUsuarioByID"; string cadenaConexion = ConfigurationManager.ConnectionStrings["GESTLIBRERIA"].ConnectionString; conn = new SqlConnection(cadenaConexion); SqlCommand cmd = new SqlCommand(SQL, conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@pUsuarioId", id); conn.Open(); rdr = cmd.ExecuteReader(); if (rdr.HasRows) { while (rdr.Read()) { txtNombreUsuario.Text = rdr["nombreUsuario"].ToString(); txtApellidos.Text = rdr["apellidosUsuario"].ToString(); txtfNacimiento.Text = rdr["fNacimientoUsuario"].ToString(); txtPassword.Text = rdr["passwordUsuario"].ToString(); } } else { Console.WriteLine("No se han encontrado registros"); } } catch (SqlException ex) { Console.Error.Write(ex.Message); } finally { rdr.Close(); conn.Close(); } System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script>"); sb.Append("$('#editModal').modal('show')"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ConfirmarEdit", sb.ToString(), false); cargaDatos(); } break; case "deleteUsuario": { txtIdUsuario.Text = codigo; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script>"); sb.Append("$('#deleteConfirm').modal('show')"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ConfirmarBorrado", sb.ToString(), false); cargaDatos(); } break; } }
protected void GVAsistencia_RowCommand(object sender, GridViewCommandEventArgs e) { }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { string ctrlName = ((Control)sender).ID; string cmdName = e.CommandName.ToString(); string id_num = String.Empty; //switch (cmdName) //{ // case "GridView1_Credentials": // { // id_num = GridView1.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Value.ToString(); // ParentPortlet.NextScreen("CredentialsScreen"); // } // break; // case "GridView1_Courses": // { // id_num = GridView1.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Value.ToString(); // ParentPortlet.NextScreen("CoursesScreen"); // } // break; //} /* * string ctrlName = ((Control)sender).ID; * Guid WidgetID = Guid.Empty; * string commandName = e.CommandName; * * switch (ctrlName) * { * case "GridView3": * WidgetID = GridView3.DataKeys[e.CommandArgument.ToString()].Value.ToString(); * break; * case "grdCerts": * facqual_no = grdCerts.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Value.ToString(); * break; * case "grdQuals": * facqual_no = grdQuals.DataKeys[Convert.ToInt32(e.CommandArgument.ToString())].Value.ToString(); * break; * } * * * Session["SelectedQual"] = WidgetID; * * * * * switch (commandName) * { * case "DeleteRow": * // Session["CredentialAction"] = "Delete"; * //Session["SelectcedID"] = GridView3.ID; * //loadDisplays(); * * //removeSelectedItem(selectedID, WidgetID); * //GridView3_RowDeleting(selectedID, e); * break; * case "View": * * Session["CredentialAction"] = "View"; * * int index = Convert.ToInt32(e.CommandArgument); * GridViewRow row = GridView3.Rows[index]; * var dataId = row.Cells[0].Text; * var dataName = row.Cells[1].Text; * var dataDesc = row.Cells[2].Text; * this.IDtxt.Text = dataId; * this.NAMEtxt.Text = dataName; * this.DESCtxt.Text = dataDesc; * * break; * case "EditRow": * * //GridView3_RowEditing(selectedID, e); * //Session["CredentialAction"] = "Edit"; * break; * * * default: * break; * } * * * * * if (commandName == "View" || commandName == "Edit") * { * * if (isLoginPortlet) * { * switch (ctrlName) * { * case "grdDegrees": * //HttpContext.Current.Session["nextScreen"] = "AddDegree"; * this.CurrentLoginData.LoginState["nextScreen"] = "AddDegree"; * this.NextLoginPage(); * break; * case "grdCerts": * //HttpContext.Current.Session["nextScreen"] = "AddCert"; * this.CurrentLoginData.LoginState["nextScreen"] = "AddCert"; * this.NextLoginPage(); * break; * case "grdQuals": * //HttpContext.Current.Session["nextScreen"] = "AddOther"; * this.CurrentLoginData.LoginState["nextScreen"] = "AddOther"; * this.NextLoginPage(); * break; * } * } * else * { * switch (ctrlName) * { * case "grdDegrees": * this.ParentPortlet.NextScreen("AddDegree"); * break; * case "grdCerts": * this.ParentPortlet.NextScreen("AddCert"); * break; * case "grdQuals": * this.ParentPortlet.NextScreen("AddOther"); * break; * } * } */ string pause = String.Empty; }
protected void GridView1_Credentials(object sender, GridViewCommandEventArgs e) { }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "yes") { string i = Convert.ToString(e.CommandArgument.ToString()); SqlDataAdapter da; DataSet ds = new DataSet(); string ml = "select sscp,hscp,g1c,g2c,g3c,g4c,g5c,g6c,g7c,g8c,p1c,p2c,p3c,p4c,p5c,p6c,highest_q,current_sem from student where sid='" + i + "'"; da = new SqlDataAdapter(ml, con); da.Fill(ds); string hq = "", sem = ""; double ssc = 0, hsc = 0, g_avg = 0, g_total = 0, pg_avg = 0, pg_total = 0, graduate = 0, pgraduate = 0, dp_total = 0, dg_avg = 0, dg_total = 0, dp_avg = 0, dg1 = 0, dg2 = 0, dg3 = 0, dg4 = 0, dg5 = 0, dg6 = 0, dg7 = 0, dg8 = 0, dp1 = 0, dp2 = 0, dp3 = 0, dp4 = 0, dp5 = 0, dp6 = 0; double gcount = 0, pgcount = 0, g1 = 0, g2 = 0, g3 = 0, g4 = 0, g5 = 0, g6 = 0, g7 = 0, g8 = 0, p1 = 0, p2 = 0, p3 = 0, p4 = 0, p5 = 0, p6 = 0; if (ds.Tables[0].Rows.Count > 0) { ssc = Convert.ToDouble(ds.Tables[0].Rows[0][0].ToString()); hsc = Convert.ToDouble(ds.Tables[0].Rows[0][1].ToString()); /* hq = ds.Tables[0].Rows[0][16].ToString(); * sem = ds.Tables[0].Rows[0][17].ToString(); * string[] s = sem.Split(' '); * int val = Convert.ToInt32(s[1]) + 1;*/ if (ds.Tables[0].Rows[0][2].ToString() == "") { g1 = 0; } else { g1 = Convert.ToDouble(ds.Tables[0].Rows[0][2].ToString()); gcount = gcount + 1; } if (ds.Tables[0].Rows[0][3].ToString() == "") { g2 = 0; } else { g2 = Convert.ToDouble(ds.Tables[0].Rows[0][3].ToString()); gcount = gcount + 1; } if (ds.Tables[0].Rows[0][4].ToString() == "") { g3 = 0; } else { g3 = Convert.ToDouble(ds.Tables[0].Rows[0][4].ToString()); gcount = gcount + 1; } if (ds.Tables[0].Rows[0][5].ToString() == "") { g4 = 0; } else { g4 = Convert.ToDouble(ds.Tables[0].Rows[0][5].ToString()); gcount = gcount + 1; } if (ds.Tables[0].Rows[0][6].ToString() == "") { g5 = 0; } else { g5 = Convert.ToDouble(ds.Tables[0].Rows[0][6].ToString()); gcount = gcount + 1; } if (ds.Tables[0].Rows[0][7].ToString() == "") { g6 = 0; } else { g6 = Convert.ToDouble(ds.Tables[0].Rows[0][7].ToString()); gcount = gcount + 1; } if (ds.Tables[0].Rows[0][8].ToString() == "") { g7 = 0; } else { g7 = Convert.ToDouble(ds.Tables[0].Rows[0][8].ToString()); gcount = gcount + 1; } if (ds.Tables[0].Rows[0][9].ToString() == "") { g8 = 0; } else { g8 = Convert.ToDouble(ds.Tables[0].Rows[0][9].ToString()); gcount = gcount + 1; } if (ds.Tables[0].Rows[0][10].ToString() == "") { p1 = 0; } else { p1 = Convert.ToDouble(ds.Tables[0].Rows[0][10].ToString()); pgcount = pgcount + 1; } if (ds.Tables[0].Rows[0][11].ToString() == "") { p2 = 0; } else { p2 = Convert.ToDouble(ds.Tables[0].Rows[0][11].ToString()); pgcount = pgcount + 1; } if (ds.Tables[0].Rows[0][12].ToString() == "") { p3 = 0; } else { p3 = Convert.ToDouble(ds.Tables[0].Rows[0][12].ToString()); pgcount = pgcount + 1; } if (ds.Tables[0].Rows[0][13].ToString() == "") { p4 = 0; } else { p4 = Convert.ToDouble(ds.Tables[0].Rows[0][13].ToString()); pgcount = pgcount + 1; } if (ds.Tables[0].Rows[0][14].ToString() == "") { p5 = 0; } else { p5 = Convert.ToDouble(ds.Tables[0].Rows[0][14].ToString()); pgcount = pgcount + 1; } if (ds.Tables[0].Rows[0][15].ToString() == "") { p6 = 0; } else { p6 = Convert.ToDouble(ds.Tables[0].Rows[0][15].ToString()); pgcount = pgcount + 1; } dg1 = g2 - g1; dg2 = g3 - g2; dg3 = g4 - g3; dg4 = g5 - g4; dg5 = g6 - g5; dg6 = g7 - g6; dg7 = g8 - g7; dp1 = p2 - p1; dp2 = p3 - p2; dp3 = p4 - p3; dp4 = p5 - p4; dp5 = p6 - p5; dp_total = dp1 + dp2 + dp3 + dp4 + dp5; dp_avg = dp_total / 5; dg_total = dg1 + dg2 + dg3 + dg4 + dg5 + dg6 + dg7; dg_avg = dg_total / 7; g_total = g1 + g2 + g3 + g4 + g5 + g6 + g7 + g8; g_avg = g_total / gcount; pg_total = p1 + p2 + p3 + p4 + p5 + p6; pg_avg = pg_total / pgcount; graduate = g_avg + dg_avg; pgraduate = pg_avg + dp_avg; C4_5 obj = new C4_5(); obj.add(); /* double total = ssc + hsc + graduate + pgraduate; * double sscprob = ssc / total; * double hscprob = hsc / total; * double graduateprob = graduate / total; * double pgraduateprob = pgraduate / total; * // double sumprob = sscprob + hscprob + graduateprob + pgraduate; * // string str = result(sscprob,hscprob,graduateprob,pgraduateprob,hq);*/ string sscgrade = "", hscgrade = "", ggrade = "", pggrade = ""; if (ssc >= 80 && ssc <= 100) { sscgrade = "A"; } else if (ssc >= 50 && ssc < 80) { sscgrade = "B"; } else if (ssc >= 35 && ssc <= 50) { sscgrade = "C"; } if (hsc >= 80 && hsc <= 100) { hscgrade = "D"; } else if (hsc >= 50 && hsc < 80) { hscgrade = "E"; } else if (hsc >= 35 && hsc <= 50) { hscgrade = "F"; } if (graduate >= 80 && graduate <= 100) { ggrade = "P"; } else if (graduate >= 50 && graduate < 80) { ggrade = "Q"; } else if (graduate >= 35 && graduate <= 50) { ggrade = "R"; } if (pgraduate >= 80 && pgraduate <= 100) { pggrade = "P"; } else if (pgraduate >= 50 && pgraduate < 80) { pggrade = "Q"; } else if (pgraduate >= 35 && pgraduate <= 50) { pggrade = "R"; } double sscm = 0, hscm = 0, gm = 0, pggm = 0; if (sscgrade == "A") { sscm = 80; } else if (sscgrade == "B") { sscm = 60; } else if (sscgrade == "C") { sscm = 50; } if (hscgrade == "D") { hscm = 80; } else if (hscgrade == "E") { hscm = 60; } else if (hscgrade == "F") { hscm = 50; } if (ggrade == "P") { gm = 80; } else if (ggrade == "Q") { gm = 60; } else if (ggrade == "R") { gm = 50; } if (pggrade == "X") { pggm = 80; } else if (pggrade == "Y") { pggm = 60; } else if (pggrade == "Z") { pggm = 50; } double sscp = 0, hscp = 0, gp = 0, pgp = 0; SqlDataAdapter da2; DataSet ds2 = new DataSet(); string m = "select prob from tree where node='ssc'and gain='" + sscgrade + "'"; da2 = new SqlDataAdapter(m, con); da2.Fill(ds2); if (ds2.Tables[0].Rows.Count > 0) { sscp = Convert.ToDouble(ds2.Tables[0].Rows[0][0].ToString()); } ds2 = new DataSet(); m = "select prob from tree where node='hsc'and gain='" + hscgrade + "'"; da2 = new SqlDataAdapter(m, con); da2.Fill(ds2); if (ds2.Tables[0].Rows.Count > 0) { hscp = Convert.ToDouble(ds2.Tables[0].Rows[0][0].ToString()); } ds2 = new DataSet(); m = "select prob from tree where node='g'and gain='" + ggrade + "'"; da2 = new SqlDataAdapter(m, con); da2.Fill(ds2); if (ds2.Tables[0].Rows.Count > 0) { gp = Convert.ToDouble(ds2.Tables[0].Rows[0][0].ToString()); } ds2 = new DataSet(); m = "select prob from tree where node='pg'and gain='" + pggrade + "'"; da2 = new SqlDataAdapter(m, con); da2.Fill(ds2); if (ds2.Tables[0].Rows.Count > 0) { pgp = Convert.ToDouble(ds2.Tables[0].Rows[0][0].ToString()); } double avg = 0, probavg = 0; avg = sscm + hscm + gm + pggm; avg = avg / (2 + gcount + pgcount); probavg = sscp + hscp + gp + pgp; probavg = probavg / (2 + gcount + pgcount); string expectedgrade = ""; if (avg >= 80 && avg <= 100) { expectedgrade = "A"; } else if (avg >= 60 && avg < 80) { expectedgrade = "B"; } else if (avg >= 50 && avg < 60) { expectedgrade = "C"; } else if (avg >= 35 && avg < 50) { expectedgrade = "D"; } SqlDataAdapter da6; DataSet ds6 = new DataSet(); string t = "select prob,gain from tree where node='g' or node='pg'"; da6 = new SqlDataAdapter(t, con); da6.Fill(ds6); if (ds6.Tables[0].Rows.Count > 0) { double prob = 0; for (int o = 0; o < ds6.Tables[0].Rows.Count; o++) { prob = Convert.ToDouble(ds6.Tables[0].Rows[o][0].ToString()); if (probavg < prob) { expectedgrade = ds6.Tables[0].Rows[o][1].ToString(); if (expectedgrade == "X") { expectedgrade = "A"; } else if (expectedgrade == "Y") { expectedgrade = "B"; } else if (expectedgrade == "Z") { expectedgrade = "C"; } if (expectedgrade == "P") { expectedgrade = "A"; } else if (expectedgrade == "Q") { expectedgrade = "B"; } else if (expectedgrade == "R") { expectedgrade = "C"; } } } } Label2.Text = "Expected grade=" + expectedgrade; } } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { int index; string oplogsid=""; string logininfo = ""; string username = ""; string LogInTime = ""; //string LogOffTime = ""; if (e.CommandName == "OpLogs") { index = Convert.ToInt32(e.CommandArgument); oplogsid = GridView1.Rows[index].Cells[0].Text; username = GridView1.Rows[index].Cells[1].Text; LogInTime = GridView1.Rows[index].Cells[2].Text; //LogOffTime = GridView1.Rows[index].Cells[3].Text; logininfo = GridView1.Rows[index].Cells[3].Text; if (username == " ") { username = ""; } if (LogInTime == " ") { LogInTime = ""; } //if (LogOffTime == " ") //{ // LogOffTime = ""; //} if (logininfo == " ") { logininfo = ""; } Session["CurrUsername"] = username; Session["logininfo"] = logininfo; Session["LogInTime"] = LogInTime; Response.Redirect("~/WebFiles/OperateLog/OPLogs.aspx?uId=" + oplogsid.Trim()); #region 未使用 //string selectcmd = ""; //string selectcmd_First = "select OperationLogs.[PID]"; //string selectcmd_Second = " FROM OperationLogs,UserLoginInfo "; //string selectcmd_Third = " WHERE OperationLogs.[PID]=UserLoginInfo.[ID] "; //selectcmd = selectcmd_First + selectcmd_Second + selectcmd_Third + // "AND UserLoginInfo.[UserName]='" + username + "' AND UserLoginInfo.[LogInTime]='" + LogInTime + "' AND UserLoginInfo.[LogOffTime] ='" + LogOffTime + "' AND cast (UserLoginInfo.[LoginInfo] as nvarchar(500)) ='" + logininfo + "'"; //mysql.OpenDatabase(true); //dt = mysql.GetDataTable(selectcmd, "OperationLogs"); //if (dt.Rows.Count != 0) //{ // //oplogsid = id; // oplogsid = dt.Rows[0]["PID"].ToString(); // Session["CurrUsername"] = username; // Session["logininfo"] = logininfo; // Session["LogInTime"] = LogInTime; // Response.Redirect("~/WebFiles/OperateLog/OPLogs.aspx?uId=" + oplogsid.Trim()); //} //else //{ // oplogsid = " "; // Session["CurrUsername"] = username; // Session["logininfo"] = logininfo; // Session["LogInTime"] = LogInTime; // Response.Redirect("~/WebFiles/OperateLog/OPLogs.aspx?uId=" + oplogsid.Trim()); //} #endregion } }
protected void GridView1_Courses(object sender, GridViewCommandEventArgs e) { }
public void gv1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "ReturnInitiate") { try { GridViewRow gvr = (GridViewRow)((Control)e.CommandSource).NamingContainer; int rowIndex = gvr.RowIndex; int LineItems_id = int.Parse(gv1.DataKeys[rowIndex]["LineItems_id"].ToString()); Initialize1(); connection.Open(); SqlCommand = new MySqlCommand("update order_lineitems set Shipment_status='RETURN INITIATED' where LineItems_id=" + LineItems_id + ";", connection); int j = SqlCommand.ExecuteNonQuery(); if (j > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Return Initiated')", true); // System.Windows.Forms.DialogResult dialogResult = System.Windows.Forms.MessageBox.Show("Succesfully Updated", "Update Products", System.Windows.Forms.MessageBoxButtons.OK); } BindGrid(); } catch (Exception e1) { Response.Write(e1); } } if (e.CommandName == "CancelInitiate") { try { GridViewRow gvr = (GridViewRow)((Control)e.CommandSource).NamingContainer; int rowIndex = gvr.RowIndex; int LineItems_id = int.Parse(gv1.DataKeys[rowIndex]["LineItems_id"].ToString()); Initialize1(); connection.Open(); SqlCommand = new MySqlCommand("update order_lineitems set Shipment_status='CANCEL INITIATED' where LineItems_id=" + LineItems_id + ";", connection); int j = SqlCommand.ExecuteNonQuery(); if (j > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Cancel Initiated')", true); // System.Windows.Forms.DialogResult dialogResult = System.Windows.Forms.MessageBox.Show("Succesfully Updated", "Update Products", System.Windows.Forms.MessageBoxButtons.OK); } BindGrid(); } catch (Exception e1) { Response.Write(e1); } } }
protected void GridViewUsers_RowCommand(object sender, GridViewCommandEventArgs e) { }
protected void GrdViewDetails_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Cancel") { GrdViewDetails.FooterRow.Visible = false; var ds = (DataSet)Session["BillData"]; GrdViewDetails.EditIndex = -1; if (ds != null) { GrdViewDetails.DataSource = ds; } GrdViewDetails.DataBind(); lnkAddBills.Visible = true; ModalPopupExtender2.Show(); pnlEdit.Visible = true; Error.Text = ""; } else if (e.CommandName == "Edit") { ModalPopupExtender2.Show(); lnkAddBills.Visible = false; } else if (e.CommandName == "Insert") { try { ModalPopupExtender2.Show(); DataTable dt; DataRow drNew; DataColumn dc; DataSet ds; BusinessLogic bl = new BusinessLogic(GetConnectionString()); string billNo = ((TextBox)GrdViewDetails.FooterRow.FindControl("txtAddBillNo")).Text; string amount = ((TextBox)GrdViewDetails.FooterRow.FindControl("txtAddBillAmount")).Text; string CustomerID = ddledger.SelectedValue.ToString().Trim(); string TransNo = string.Empty; //if (GrdViewReceipt.SelectedDataKey != null) // TransNo = GrdViewReceipt.SelectedDataKey.Value.ToString(); //else TransNo = ""; //if (bl.GetIfBillNoExists(int.Parse(billNo), CustomerID) == 0) //{ // ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('BillNo does not Exists. Please check BillNo.')", true); // //Error.Text = "BillNo does not Exists. Please check BillNo."; // pnlEdit.Visible = true; // ModalPopupExtender2.Show(); // return; //} //var isBillExists = CheckIfBillExists(billNo); //if (isBillExists) //{ // ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('BillNo already Exists')", true); // //Error.Text = "BillNo already Exists"; // ModalPopupExtender2.Show(); // return; //} double eligibleAmount = bl.GetSalesPendingAmount(int.Parse(billNo)); if (double.Parse(amount) > eligibleAmount) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('The Amount you entered for BillNo:" + billNo + " is Greater than Pending Sales Amount of " + eligibleAmount.ToString() + ". Please check the Bill Amount')", true); //Error.Text = "The Amount you entered for BillNo:" + billNo + " is Greater than Pending Sales Amount of " + eligibleAmount.ToString() + ". Please check the Bill Amount"; ModalPopupExtender2.Show(); return; } if ((Session["BillData"] == null) || (((DataSet)Session["BillData"]).Tables[0].Rows.Count == 0)) { //if (double.Parse(amount) > double.Parse(txtAmount.Text)) //{ // ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('Total Bills amount is exceeding the Receipt Amount. Please check the Bill Amount')", true); // //Error.Text = "Total Bills amount is exceeding the Receipt Amount. Please check the Bill Amount"; // ModalPopupExtender2.Show(); // return; //} ds = new DataSet(); dt = new DataTable(); dc = new DataColumn("ReceiptNo"); dt.Columns.Add(dc); dc = new DataColumn("BillNo"); dt.Columns.Add(dc); dc = new DataColumn("Amount"); dt.Columns.Add(dc); ds.Tables.Add(dt); drNew = dt.NewRow(); drNew["ReceiptNo"] = TransNo; drNew["BillNo"] = billNo; drNew["Amount"] = amount; ds.Tables[0].Rows.Add(drNew); Session["BillData"] = ds; GrdViewDetails.DataSource = ds; GrdViewDetails.DataBind(); GrdViewDetails.EditIndex = -1; lnkAddBills.Visible = true; } else { ds = (DataSet)Session["BillData"]; //if ((calcDatasetSum(ds) + double.Parse(amount)) > double.Parse(txtAmount.Text)) //{ // ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('Total Bills amount is exceeding the Receipt Amount. Please check the Bill Amount')", true); // //Error.Text = "Total Bills amount is exceeding the Receipt Amount. Please check the Bill Amount"; // ModalPopupExtender2.Show(); // return; //} if (ds.Tables[0].Rows[0]["ReceiptNo"].ToString() == "0") { ds.Tables[0].Rows[0].Delete(); ds.Tables[0].AcceptChanges(); } drNew = ds.Tables[0].NewRow(); drNew["ReceiptNo"] = TransNo; drNew["BillNo"] = billNo; drNew["Amount"] = amount; ds.Tables[0].Rows.Add(drNew); Session["BillData"] = ds; //System.Threading.Thread.Sleep(1000); GrdViewDetails.DataSource = ds; GrdViewDetails.DataBind(); GrdViewDetails.EditIndex = -1; lnkAddBills.Visible = true; ModalPopupExtender2.Show(); checkPendingBills(ds); } //} //catch (Exception ex) //{ // if (ex.InnerException != null) // { // StringBuilder script = new StringBuilder(); // script.Append("alert('Unit with this name already exists, Please try with a different name.');"); // if (ex.InnerException.Message.IndexOf("duplicate values in the index") > -1) // ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), script.ToString(), true); // ModalPopupExtender2.Show(); // return; // } //} } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } finally { //checkPendingBills(); } } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void GrdReferrer_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Insert")) { DropDownList ddlTitle = (DropDownList)GrdReferrer.FooterRow.FindControl("ddlNewTitle"); TextBox txtName = (TextBox)GrdReferrer.FooterRow.FindControl("txtNewName"); TextBox txtABN = (TextBox)GrdReferrer.FooterRow.FindControl("txtNewABN"); TextBox txtACN = (TextBox)GrdReferrer.FooterRow.FindControl("txtNewACN"); OrganisationDB.InsertExtOrg(191, txtName.Text, txtACN.Text, txtABN.Text, false, false, "", ""); FillGrid(); } if (e.CommandName.Equals("_Delete") || e.CommandName.Equals("_UnDelete")) { try { // if getting orgs of a referer, set the reg-ref relationship as active/inactive if (Request.QueryString["referrer"] != null) { int reg_ref_id = Convert.ToInt32(e.CommandArgument); if (e.CommandName.Equals("_Delete")) { RegisterReferrerDB.UpdateInactive(reg_ref_id); } else { RegisterReferrerDB.UpdateActive(reg_ref_id); } } // if getting all orgs, set the org as active/inactive else { int org_id = Convert.ToInt32(e.CommandArgument); if (e.CommandName.Equals("_Delete")) { OrganisationDB.UpdateInactive(org_id); } else { OrganisationDB.UpdateActive(org_id); } } } catch (ForeignKeyConstraintException fkcEx) { if (Utilities.IsDev()) { SetErrorMessage("Can not delete because other records depend on this : " + fkcEx.Message); } else { SetErrorMessage("Can not delete because other records depend on this"); } } FillGrid(); } if (e.CommandName.Equals("ViewPatients")) { int id = Convert.ToInt32(e.CommandArgument); if (Request.QueryString["referrer"] == null) { FillGrid_Patients(typeof(Organisation), id); } else { FillGrid_Patients(typeof(RegisterReferrer), id); } } }
protected void GrdDetail_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "slip") { using (TransactionScope ex = new TransactionScope()) { string[] arg = new string[2]; arg = e.CommandArgument.ToString().Split(','); token = arg[0]; ccd = arg[1]; string mmid = Common.Get(objsql.GetSingleValue("select Max(id) from Student_Fee where CourseId='" + ccd + "' and RollNo='" + RollNo + "'")); string maxid = Common.Get(objsql.GetSingleValue("select Token from Student_Fee where id='" + mmid + "' ")); DataSet ds1 = new DataSet(); ds1 = objsql.GetDataset("select * from Student_Fee where Token='" + maxid + "'"); if (maxid != "" && maxid != null) { if (token == maxid) // check last slip { string totpaid = Common.Get(objsql.GetSingleValue("select PaidFees from Fees_Master where CourseId='" + ccd + "' and RollNo='" + RollNo + "'")); string nowpaid = (Convert.ToInt32(totpaid) - Convert.ToInt32(ds1.Tables[0].Rows[0]["TodayPaidFee"])).ToString(); objsql.ExecuteNonQuery("update Fees_Master set PaidFees='" + nowpaid + "' where CourseId='" + ccd + "' and RollNo='" + RollNo + "'"); objsql.ExecuteNonQuery("delete from Student_Fee where Token='" + token + "'"); objsql.ExecuteNonQuery("delete from Recipt_Details where TokenNo='" + token + "'"); string alert = Common.Get(objsql.GetSingleValue("select ToDate from Student_Fee where CourseId='" + ccd + "' and RollNo='" + RollNo + "' order by id desc")); objsql.ExecuteNonQuery("update Fees_Master set AlertDate='" + alert + "' where CourseId='" + ccd + "' and RollNo='" + RollNo + "'"); ex.Complete(); } else { ex.Dispose(); Page.RegisterStartupScript("d", "<script>alert('Sorry You Delete Wrong Slip')</script>"); } } ex.Dispose(); BindStudent(); } } if (e.CommandName == "cancel") { string[] arg = new string[6]; arg = e.CommandArgument.ToString().Split(','); objsql.ExecuteNonQuery("update student_fee set status='Cancel' where Token='" + arg[2] + "' and courseid='" + arg[4] + "'"); objsql.ExecuteNonQuery("update Recipt_details set cancelauthorisation='Cancel' where id='" + arg[0] + "' and courseid='" + arg[4] + "'"); string fees = Common.Get(objsql.GetSingleValue("select Paidfees from fees_master where courseid='" + arg[4] + "' and Rollno='" + RollNo + "'")); if (fees != null) { int leftpayment = (Convert.ToInt32(fees) - Convert.ToInt32(arg[3])); objsql.ExecuteNonQuery("update Fees_Master set PaidFees='" + leftpayment + "' where CourseId='" + arg[4] + "' and RollNo='" + RollNo + "'"); } } if (e.CommandName == "reprint") { DataTable dt3 = new DataTable(); dt3 = objsql.GetTable("select s.name , r.reciptno , r.date,r.amount,r.particular,r.courseid,r.checkno,r.draftno,r.TokenNo from tblstudentdata s , recipt_details r where s.rollno='" + RollNo + "' and r.id='" + e.CommandArgument.ToString() + "'"); if (dt3.Rows.Count > 0) { lblrname.Text = dt3.Rows[0]["name"].ToString(); lastrc = dt3.Rows[0]["reciptno"].ToString(); rno = RollNo; string token = dt3.Rows[0]["tokenno"].ToString(); cname = dt3.Rows[0]["particular"].ToString(); cid = dt3.Rows[0]["courseid"].ToString(); string date = dt3.Rows[0]["date"].ToString(); lbldate.Text = Convert.ToDateTime(date).ToString("dd/MM/yyyy"); lastpa = dt3.Rows[0]["amount"].ToString(); string word = ConvertNumbertoWords(Convert.ToInt32(lastpa)); discont = Common.Get(objsql.GetSingleValue("select discount from student_fee where token='" + token + "'")); pend = Common.Get(objsql.GetSingleValue("select fees from tblpendingfee where tokenno='" + token + "'")); lblramt.Text = word; ClientScript.RegisterStartupScript(this.GetType(), "alert", "OpenPopUp();", true); } check(); } }
protected void gvtblUserManagement_RowCommand(object sender, GridViewCommandEventArgs e) { }
protected void gridHistory_RowCommand(object sender, GridViewCommandEventArgs e) { }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "tuijian") { int ID = Convert.ToInt32(e.CommandArgument); SqlDataReader datar = SqlHelper.ExecuteReader("select count(KmId) as nums from OA_KlRecNum where Username='******' and convert(char(10),cast(Settime as datetime),120)=convert(char(10),cast('" + System.DateTime.Now.ToShortDateString() + "' as datetime),120) "); if (datar.Read()) { string nums = datar["nums"].ToString(); if (int.Parse(nums) >= 3) { mydb.Alert("您今天3次推荐票已使用完,请明天再推荐!"); return; } } datar.Close(); SqlDataReader datar1 = SqlHelper.ExecuteReader("select * from OA_KnowLedge where id='" + ID + "' and (CHARINDEX('," + this.Session["userid"].ToString() + ",',','+TjUsername+',') > 0 ) "); if (datar1.Read()) { SqlHelper.ExecuteSql("Update OA_KnowLedge Set TjNum=TjNum+1 where id='" + ID + "'"); mydb.Alert("推荐成功!"); } else { SqlHelper.ExecuteSql("Update OA_KnowLedge Set TjNum=TjNum+1 ,TjUsername=TjUsername+'" + this.Session["userid"].ToString() + ",',TjRealname=TjRealname+'" + this.Session["username"].ToString() + ",' where id='" + ID + "'"); mydb.Alert("推荐成功!"); } SqlHelper.ExecuteSql("insert into OA_KlRecNum (KmId,Username,Realname,Settime) values ('" + ID + "','" + this.Session["userid"] + "','" + this.Session["username"] + "','" + System.DateTime.Now.ToString() + "')"); datar1.Close(); GridViewBind(); } if (e.CommandName == "dingyue") { int ID = Convert.ToInt32(e.CommandArgument); SqlDataReader datar2 = SqlHelper.ExecuteReader("select * from OA_KnowLedge where id='" + ID + "' and (CHARINDEX('," + this.Session["userid"].ToString() + ",',','+DyUsername+',') > 0 ) "); if (datar2.Read()) { mydb.Alert("已订阅!"); return; } else { SqlHelper.ExecuteSql("Update OA_KnowLedge Set DyNum=DyNum+1 ,DyUsername=DyUsername+'" + this.Session["userid"].ToString() + ",',DyRealname=DyRealname+'" + this.Session["username"].ToString() + ",' where id='" + ID + "'"); mydb.Alert("订阅成功!"); } datar2.Close(); GridViewBind(); } if (e.CommandName == "shoucang") { int ID = Convert.ToInt32(e.CommandArgument); SqlDataReader datar3 = SqlHelper.ExecuteReader("select * from OA_KnowLedge where id='" + ID + "' and (CHARINDEX('," + this.Session["userid"].ToString() + ",',','+ScUsername+',') > 0 ) "); if (datar3.Read()) { mydb.Alert("已收藏!"); return; } else { SqlHelper.ExecuteSql("Update OA_KnowLedge Set ScNum=ScNum+1 ,ScUsername=ScUsername+'" + this.Session["userid"].ToString() + ",',ScRealname=ScRealname+'" + this.Session["username"].ToString() + ",' where id='" + ID + "'"); mydb.Alert("收藏成功!"); } datar3.Close(); GridViewBind(); } }
protected void dgChange_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { pnlEMPHIST_ModalPopupExtender.Show(); int Row = Convert.ToInt32(e.CommandArgument); chan = Session["chan"] as Contract; int TEMPChid = Convert.ToInt32(dgChange.DataKeys[Row].Value); // int TEMPChid = Convert.ToInt32(dgContractDetail.DataKeys[dgContractDetail.SelectedRow.RowIndex].Value.ToString()); if (TEMPChid > 0) { EmployeeDetail empdetail = chan.GetEmployeeDetails(TEMPChid); ddlPosition.SelectedValue = empdetail.Position.Id.ToString(); ddlProgram.SelectedValue = Convert.ToInt32(empdetail.Program.Id).ToString(); ddlDutyStation.SelectedValue = empdetail.DutyStation.ToString(); txtSalary.Text = Convert.ToDecimal(empdetail.Salary).ToString(); txtHoursPerWeek.Text = empdetail.HoursPerWeek; txtBaseCount.Text = empdetail.BaseCountry; txtBaseCity.Text = empdetail.BaseCity; txtBaseState.Text = empdetail.BaseState; txtClass.SelectedValue = empdetail.Class; txtCountryTeam.Text = empdetail.CountryTeam; txtEmployeeStatus.SelectedValue = empdetail.EmploymentStatus; ddlSuperVisor.SelectedValue = Convert.ToInt32(empdetail.Supervisor).ToString(); txtEffectDate.Text = empdetail.EffectiveDateOfChange.ToShortDateString(); btnAddChange.Text = "Update Change"; pnlEMPHIST_ModalPopupExtender.Show(); } } else if (e.CommandName == "Delete") { int Row = Convert.ToInt32(e.CommandArgument); chan = Session["chan"] as Contract; int TEMPChid = Convert.ToInt32(dgChange.DataKeys[Row].Value); EmployeeDetail emp = _presenter.GetEmployeeDetail(TEMPChid); if (TEMPChid > 0) { emp = _presenter.GetEmployeeDetail(TEMPChid); } // else // emp = (EmployeeDetail)chan.EmployeeDetails[e.CommandArgumen.Item.ItemIndex]; try { if (TEMPChid > 0) { _presenter.CurrentEmployee.GetContract(Convert.ToInt32(hfDetailId.Value)).RemoveEmployeeDetail(TEMPChid); if (_presenter.GetEmployeeDetail(TEMPChid) != null) { _presenter.DeleteEmployeeDetails(_presenter.GetEmployeeDetail(TEMPChid)); } _presenter.SaveOrUpdateEmployeeActivity(_presenter.CurrentEmployee); } else { _presenter.CurrentEmployee.GetContract(Convert.ToInt32(hfDetailId.Value)).EmployeeDetails.Remove(emp); } BindEmpDetail(emp.Contract); pnlEMPHIST_ModalPopupExtender.Show(); Master.ShowMessage(new AppMessage("Employee History was removed successfully", Chai.WorkflowManagment.Enums.RMessageType.Info)); } catch (Exception ex) { Master.ShowMessage(new AppMessage("Error: Unable to delete Employee History. ", RMessageType.Error)); ExceptionUtility.LogException(ex, ex.Source); ExceptionUtility.NotifySystemOps(ex, _presenter.CurrentEmployee.AppUser.FullName); } } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { Session["sname"] = e.CommandArgument.ToString(); Response.Redirect("LSearch.aspx"); }
protected void dgContractDetail_RowCommand(object sender, GridViewCommandEventArgs e) { }
protected void dgContractDetail_RowCommand1(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "History") { int Row = Convert.ToInt32(e.CommandArgument); int TEMPChid = Convert.ToInt32(dgContractDetail.DataKeys[Row].Value); // int TEMPChid = Convert.ToInt32(dgContractDetail.DataKeys[dgContractDetail.SelectedRow.RowIndex].Value.ToString()); if (TEMPChid > 0) { Session["chan"] = _presenter.CurrentEmployee.GetContract(TEMPChid); } else { Session["chan"] = _presenter.CurrentEmployee.Contracts[dgChange.SelectedRow.DataItemIndex]; } if (_presenter.CurrentEmployee.Id > 0) { hfDetailId.Value = TEMPChid.ToString(); } else { hfDetailId.Value = dgChange.SelectedRow.DataItemIndex.ToString(); } BindEmpDetail(chan); pnlEMPHIST_ModalPopupExtender.Show(); } else if (e.CommandName == "Select") { int Row = Convert.ToInt32(e.CommandArgument); int TEMPChid = Convert.ToInt32(dgContractDetail.DataKeys[Row].Value); // int TEMPChid = Convert.ToInt32(dgContractDetail.DataKeys[dgContractDetail.SelectedRow.RowIndex].Value.ToString()); if (TEMPChid > 0) { Session["chan"] = _presenter.CurrentEmployee.GetContract(TEMPChid); } else { Session["chan"] = _presenter.CurrentEmployee.Contracts[dgChange.SelectedRow.DataItemIndex]; } Contract cont = _presenter.CurrentEmployee.GetContract(TEMPChid); txtStartDate.Text = cont.ContractStartDate.ToShortDateString(); txtEndDate.Text = cont.ContractEndDate.ToShortDateString(); ddlReason.SelectedValue = cont.Reason; ddlStatus.SelectedValue = cont.Status; btnAddcontract.Text = "Update Contracts"; } else if (e.CommandName == "Delete") { int Row = Convert.ToInt32(e.CommandArgument); int TEMPChid = Convert.ToInt32(dgContractDetail.DataKeys[Row].Value); try { if (TEMPChid > 0) { _presenter.CurrentEmployee.RemoveContract(TEMPChid); _presenter.SaveOrUpdateEmployeeActivity(_presenter.CurrentEmployee); if (_presenter.CurrentEmployee.Contracts.Count > 1) { _presenter.CurrentEmployee.GetLastInActiveContract().Status = "Active"; } dgContractDetail.DataSource = _presenter.CurrentEmployee.Contracts; dgContractDetail.DataBind(); Master.ShowMessage(new AppMessage("Contract Detail Is Successfully Deleted!", RMessageType.Info)); } } catch (Exception ex) { Master.ShowMessage(new AppMessage("Error: Unable to Delete Contract. ", RMessageType.Error)); ExceptionUtility.LogException(ex, ex.Source); ExceptionUtility.NotifySystemOps(ex, _presenter.CurrentEmployee.AppUser.FullName); } } }
protected void gvGRN_RowCommand(object sender, GridViewCommandEventArgs e) { // Label id = (Label)row.FindControl("lblGRN"); int index = Convert.ToInt32(e.CommandArgument); GridViewRow rw = this.gvGRN.Rows[index]; if (e.CommandName == "View") { if (rw != null) { Label id = (Label)rw.FindControl("lblId"); if (id != null) { Session["GRNID"] = id.Text; Response.Redirect("ViewGRN.aspx"); } } } //Update GRN No if (e.CommandName == "cmdGRNNoUpdate") { Label id = (Label)rw.FindControl("lblId"); if (id != null) { //Session["GRNIDUpdateGRNNo"] = id.Text; //Response.Redirect("UpdateGRNNumber.aspx"); } } else if (e.CommandName == "cmdPrint") { if (rw != null) { Label id = (Label)rw.FindControl("lblId"); if (id != null) { Session["GRNIDPrint"] = id.Text; StringBuilder sb = new StringBuilder(); sb.Append("<script>"); sb.Append("window.open('rptGRN.aspx"); sb.Append("', '', 'toolbar=0');"); sb.Append("</scri"); sb.Append("pt>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ShowReport", sb.ToString(), false); } } } else if (e.CommandName == "Edit") { if (rw != null) { Label id = (Label)rw.FindControl("lblId"); Label lblStatus = (Label)rw.FindControl("lblStatus"); if (lblStatus != null) { if (lblStatus.Text.ToUpper() != "NEW" && lblStatus.Text.ToUpper() != "OpenForEdit".ToUpper()) { Session["GRNIDRequestCD"] = id.Text; Response.Redirect("AddApprovedGRNEditRequest.aspx"); } else if (lblStatus.Text.ToUpper() == "OpenForEdit".ToUpper()) { Session["ReCreateGRNID"] = id.Text; Response.Redirect("ReCreateGRN.aspx"); } else if (lblStatus.Text.ToUpper() == "NEW") { Session["ReCreateGRNID"] = id.Text; GRNBLL objGRN = new GRNBLL(); objGRN = objGRN.GetbyGRN_Number(new Guid(id.Text)); Session["ReCreateGRNTrackingNo"] = objGRN.TrackingNo; Response.Redirect("ReCreateGRN.aspx"); } else { Session["GRNID"] = id.Text; Response.Redirect("ViewGRN.aspx"); } } } } else if (e.CommandName == "cmdCancel") { if (rw != null) { Label id = (Label)rw.FindControl("lblId"); Label lblStatus = (Label)rw.FindControl("lblStatus"); if (lblStatus != null) { if (lblStatus.Text.ToUpper() == "NEW" || lblStatus.Text.ToUpper() == "ClientAccepted".ToUpper() || lblStatus.Text.ToUpper() == "ClientRejected".ToUpper()) { Session["GRNID"] = id.Text; Response.Redirect("ViewGRN.aspx"); } else if (lblStatus.Text.ToUpper() == "ManagerApproved".ToUpper()) { Session["ApprovedGRNCancelationID"] = id.Text; Response.Redirect("RequestApprovedGRNCancelation.aspx"); } } } } }
protected void RowCommandHandler(object sender, GridViewCommandEventArgs e) { }
protected void grdPlanes_RowCommand(object sender, GridViewCommandEventArgs e) { }
protected void GridViewConclusion_RowCommand(object sender, GridViewCommandEventArgs e) { int currentRowIndex = int.Parse(e.CommandArgument.ToString()); TextBox textBoxDesc; Label labelSerial; PmsMinconclution pmsMinconclution = new PmsMinconclution(); PmsMinconclutionBiz pmsMinconclutionBiz = new PmsMinconclutionBiz(); IList <string> listContactWindow; string currentDesc; IList <PmsMinconclution> pmsMinconclutionList; switch (e.CommandName) { case "Save": #region Save if (GridViewConclusion.EditIndex != -1) { Msgbox("Please complete the editing action!"); return; } textBoxDesc = (TextBox)GridViewConclusion.FooterRow.FindControl("TextBoxDesc"); currentDesc = Server.HtmlDecode(textBoxDesc.Text).Trim(); if (string.IsNullOrEmpty(currentDesc)) { Msgbox("Please input Title!"); return; } listContactWindow = GetLastContactWindows(-1); if (CheckContactWindow(currentDesc, listContactWindow)) { Msgbox(currentDesc + " " + "already exist!"); return; } pmsMinconclutionList = GetPmsMinConlutionList(-1); pmsMinconclution.Description = currentDesc; pmsMinconclutionList.Add(pmsMinconclution); GridViewBind(pmsMinconclutionList); //pmsMinconclution.Mnid = MinID; //pmsMinconclution.Description = Server.HtmlDecode(textBoxDesc.Text).Trim(); //pmsMinconclution.Creator = LoginName; //pmsMinconclution.CreateDate = System.DateTime.Now; //if (pmsMinconclutionBiz.InsertPmsMinconclutionByMinId(pmsMinconclution) == 0) //{ // Msgbox("Save Failed!"); // return; //} //BindGrid(); PageRegisterStartupScript("Refresh();"); break; #endregion case "Delete": # region Delete if (GridViewConclusion.EditIndex != -1) { Msgbox("Please complete the editing action!"); return; } listContactWindow = GetLastContactWindows(-1); listContactWindow.RemoveAt(currentRowIndex); pmsMinconclutionList = GetPmsMinConlutionList(-1); pmsMinconclutionList.RemoveAt(currentRowIndex); GridViewBind(pmsMinconclutionList); //labelSerial = (Label)GridViewConclusion.Rows[currentRowIndex].FindControl("LabelSerial"); //if (pmsMinconclutionBiz.DeletePmsMinconclutionBySerial(labelSerial.Text) == 0) //{ // Msgbox("Delete Failed!"); // return; //} //BindGrid(); PageRegisterStartupScript("Refresh();"); break; # endregion case "Edit": #region Edit if (GridViewConclusion.EditIndex != -1) { Msgbox("Please complete the editing action!"); return; } listContactWindow = GetLastContactWindows(-1); EditContactWindow = listContactWindow[currentRowIndex]; pmsMinconclutionList = GetPmsMinConlutionList(-1); EditPmsMinconclution = pmsMinconclutionList[currentRowIndex]; GridViewConclusion.EditIndex = currentRowIndex; GridViewBind(pmsMinconclutionList); break; #endregion case "Update": #region Update textBoxDesc = (TextBox)GridViewConclusion.Rows[currentRowIndex].FindControl("TextBoxDesc"); currentDesc = Server.HtmlDecode(textBoxDesc.Text).Trim(); if (string.IsNullOrEmpty(Server.HtmlDecode(textBoxDesc.Text).Trim())) { Msgbox("Please input Title!"); return; } listContactWindow = GetLastContactWindows(GridViewConclusion.EditIndex); if (CheckContactWindow(currentDesc, listContactWindow)) { Msgbox(currentDesc + " " + "already exist!"); return; } pmsMinconclutionList = GetPmsMinConlutionList(currentRowIndex); pmsMinconclutionList[currentRowIndex].Description = currentDesc; GridViewConclusion.EditIndex = -1; GridViewBind(pmsMinconclutionList); //labelSerial = (Label)GridViewConclusion.Rows[currentRowIndex].FindControl("LabelSerial"); //int intSerial; //int.TryParse(labelSerial.Text, out intSerial); //pmsMinconclution.Serial = intSerial; //pmsMinconclution.Description = Server.HtmlDecode(textBoxDesc.Text).Trim(); //pmsMinconclution.Creator = LoginName; //pmsMinconclution.CreateDate = System.DateTime.Now; //if (pmsMinconclutionBiz.UpdatePmsMinconclutionBySerial(pmsMinconclution) == 0) //{ // Msgbox("Update Failed!"); // return; //} //GridViewConclusion.EditIndex = -1; //BindGrid(); break; #endregion case "Cancel": #region Cancel GridViewConclusion.EditIndex = -1; pmsMinconclutionList = GetPmsMinConlutionList(currentRowIndex); GridViewBind(pmsMinconclutionList); break; #endregion default: break; } }
protected void gvEmployeeList_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "PayrollSetup") { GridViewRow row = ((e.CommandSource as LinkButton).NamingContainer as GridViewRow); DataTable dt = oPayroll.GET_EMPLOYEE_SALARY(); DataView dv = dt.DefaultView; dv.RowFilter = "EmployeeID ='" + row.Cells[0].Text + "'"; if (dv.Count > 0) { DataRowView dvr = dv[0]; lblEmpCode.Text = dvr.Row["EmployeeID"].ToString(); lblEmpName.Text = dvr.Row["EmployeeName"].ToString(); if (!string.IsNullOrEmpty(dvr.Row["PayrollGroupCode"].ToString())) { ddPayrollGroup.SelectedValue = dvr.Row["PayrollGroupCode"].ToString(); } //Identify Salary Type and implement condition in corresponding selection. if (ddPayrollGroup.SelectedValue == "BP") { chkDebitMemo.Visible = true; chkManualSalary.Checked = false; chkManualSalary.Visible = false; } else { chkManualSalary.Visible = true; chkDebitMemo.Visible = false; chkDebitMemo.Checked = false; } if (!string.IsNullOrEmpty(dvr.Row["BranchCode"].ToString())) { ddBranchList.SelectedValue = dvr.Row["BranchCode"].ToString(); panelBranch.Visible = true; } else { panelBranch.Visible = false; } if (!string.IsNullOrEmpty(dvr.Row["IsSenior"].ToString())) { chkIsSenior.Checked = (bool)dvr.Row["IsSenior"]; } if (!string.IsNullOrEmpty(dvr.Row["IsBranchWife"].ToString())) { chkIsBranchWife.Checked = (bool)dvr.Row["IsBranchWife"]; } if (!string.IsNullOrEmpty(dvr.Row["IsDMPay"].ToString())) { chkDebitMemo.Checked = (bool)dvr.Row["IsDMPay"]; } if (!string.IsNullOrEmpty(dvr.Row["IsManualSalary"].ToString())) { chkManualSalary.Checked = (bool)dvr.Row["IsManualSalary"]; } txtBasicRatePerDay.Text = dvr.Row["BasicRate"].ToString(); txtActualRatePerDay.Text = dvr.Row["ActualRate"].ToString(); if (File.Exists(Server.MapPath("~/Emp_Pictures/" + lblEmpCode.Text + ".jpg"))) { imgEmployeePicture.ImageUrl = "~/Emp_Pictures/" + lblEmpCode.Text + ".jpg"; } else { imgEmployeePicture.ImageUrl = "~/Emp_Pictures/default-avatar.png"; } } ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "<script>$('#modalPayrollSetup').modal('show');</script>", false); } }
protected void mydetails_RowCommand(object sender, GridViewCommandEventArgs e) { }
protected void GridViewFriends_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.CompareTo("FriendsReject") == 0) { SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ShopConnectionString"].ConnectionString); SqlCommand sqlCmd; try { sqlCmd = new SqlCommand("sp_requestsConnectionsFriendsReject", sqlConn); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.Parameters.Add("@RequestId", SqlDbType.Int).Value = Convert.ToInt32(e.CommandArgument.ToString()); sqlConn.Open(); sqlCmd.ExecuteNonQuery(); } catch { } finally { sqlConn.Close(); } GridViewFriends.DataBind(); } if (e.CommandName.CompareTo("FriendsAccept") == 0) { SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ShopConnectionString"].ConnectionString); SqlCommand sqlCmd; try { DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); DataSet ds = new DataSet(); SqlDataAdapter sda = new SqlDataAdapter("sp_requestsConnectionsFriendsVerify", sqlConn); sda.SelectCommand.CommandType = CommandType.StoredProcedure; sda.SelectCommand.Parameters.Add("@RequestId", SqlDbType.Int).Value = Convert.ToInt32(e.CommandArgument.ToString()); sda.SelectCommand.Parameters.Add("@UserId", SqlDbType.Int).Value = Convert.ToInt32(Session["UserId"]); sda.Fill(ds); dt = ds.Tables[0]; dt2 = ds.Tables[1]; NotificationsClass nc = new NotificationsClass(); nc.addNotification(1, Convert.ToInt32(dt.Rows[0]["FriendId"].ToString()), 7, dt2.Rows[0]["FullName"].ToString(), ""); } catch { } finally { sqlConn.Close(); } GridViewFriends.DataBind(); } }