protected void RadGrid_parametros_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { iidcompany = Convert.ToInt32(this.Session["companyid"].ToString()); sidcanal = this.Session["Canal"].ToString(); if (e.CommandName == "BUSCAR") { Label lbl_id_año = (Label)e.Item.FindControl("lbl_id_año"); Label lbl_id_mes = (Label)e.Item.FindControl("lbl_id_mes"); Label lbl_id_periodo = (Label)e.Item.FindControl("lbl_id_periodo"); Label lbl_id_oficina = (Label)e.Item.FindControl("lbl_id_oficina"); Label lbl_id_tipoReporte = (Label)e.Item.FindControl("lbl_id_tipoReporte"); //crearXML(iidcompany, sidcanal, lbl_id_tipoReporte.Text.Trim(), lbl_id_oficina.Text.Trim(), lbl_id_año.Text.Trim(), lbl_id_mes.Text.Trim()); } if (e.CommandName == "ELIMINAR") { Label lbl_id = (Label)e.Item.FindControl("lbl_id"); string path = Server.MapPath("~/parametros.xml"); Reportes_parametros oReportes_parametros = new Reportes_parametros(); oReportes_parametros.Id = Convert.ToInt32(lbl_id.Text); Reportes_parametrosToXml oReportes_parametrosToXml = new Reportes_parametrosToXml(); oReportes_parametrosToXml.DeleteElement(oReportes_parametros, path); cargarParametrosdeXml(); } }
protected void rdgvFairmadanGelenIstekler_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == RadGrid.SelectCommandName && e.Item is GridDataItem) { GridDataItem dataItem = (GridDataItem)e.Item; int key = int.Parse(dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["ISTID"].ToString()); } if (e.CommandName == "DokumanEkle") { GridDataItem dataItem = (GridDataItem)e.Item; Session["DokumanEklenecekIstId"] = int.Parse(dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["ISTID"].ToString()); Response.Redirect("~/UserControls/Docs/DosyaGonder.aspx"); } if (e.CommandName == "ArsivGoruntule") { GridDataItem dataItem = (GridDataItem)e.Item; Session["DokumanEklenecekIstId"] = int.Parse(dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["ISTID"].ToString()); Response.Redirect("~/UserControls/Docs/IstekArsivi.aspx"); } if (e.CommandName == "ImzalanmaDurumu") { GridDataItem dataItem = (GridDataItem)e.Item; //Session["DokumanEklenecekIstId"] = int.Parse(dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["ISTID"].ToString()); //Response.Redirect("~/UserControls/Pages/IsteginImzalanmaDurumu.aspx?IstId=" + dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["ISTID"].ToString()); ScriptManager.RegisterStartupScript(Page, typeof(Page), "OpenWindow", "window.open('UserControls/Pages/IsteginImzalanmaDurumu.aspx?IstId=" + dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["ISTID"].ToString() + "');", true); //string pageurl="~/UserControls/Pages/IsteginImzalanmaDurumu.aspx?IstId=" + dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["ISTID"].ToString(); // Response.Write( "<script> window.open( '"+pageurl+"','_blank' ); </script>"); // Response.End(); } }
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { // weonly process commands with a datasource (our image buttons) if (e.CommandSource == null) { return; } string typeOfControl = e.CommandSource.GetType().ToString(); if (typeOfControl.Equals("System.Web.UI.WebControls.ImageButton")) { int id = 0; ImageButton imgb = (ImageButton)e.CommandSource; if (imgb.ID != "New" && imgb.ID != "Exit") { id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]]; } switch (imgb.ID) { case "Select": break; case "Edit": break; case "Delete": ServiceCategory scat = (from sc in ctx.ServiceCategories where sc.ServiceCategoryId == id select sc).FirstOrDefault <ServiceCategory>(); ctx.Delete(scat); ctx.SaveChanges(); RefreshGrid(); break; } } }
//GridmEMBER_ItemCommand event is use for two command name edit and delete protected void GridmEMBER_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { string MID; //if command name is EditMember of fund it will get the id of particuar //row to edit the Member and redirecte it to newmember screen to update that Member if (e.CommandName == "EditMember") { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; MID = item["MID"].Text.ToString().Trim(); Response.Redirect("~/UserScreens/Addnewmem.aspx?EID=" + MID); } } else if (e.CommandName == "Delete") { //If command name is delete it will get the id that member which needs to be deleted by calling DELETEMEMBER //it will successfully get deleted GridDataItem item = (GridDataItem)e.Item; objm.Memberid = item["MID"].Text.ToString(); no_of_rows_affected = objm.DELETEMEMBER(); if (no_of_rows_affected == 1) { Validations.showMessage(lblErrorMsg, "Member " + Validations.RecordDeleted, ""); BindGrid(); } else { Validations.showMessage(lblErrorMsg, "Member " + Validations.Err_RefDelete, "Error"); } } }
protected void gvStudents_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName.ToString() == "ExpandCollapse" && !e.Item.Expanded) { foreach (GridItem item in e.Item.OwnerTableView.Items) { if (item.Expanded && item != e.Item) { item.Expanded = false; } } RadGrid innerGrid = (e.Item as GridDataItem).ChildItem.FindControl("gvEnrollments") as RadGrid; ImageButton ImgStudentID = (e.Item as GridDataItem).FindControl("BtnViewStudent") as ImageButton; Label lblStatus = (Label)e.Item.FindControl("lblStatus"); this.GetStudentEnrollments(innerGrid, ImgStudentID.CommandArgument.ToString(), lblStatus.Text); } else if (e.CommandName.ToString() == "View") { ImageButton ImgStudentID = (e.Item as GridDataItem).FindControl("BtnViewStudent") as ImageButton; Response.Redirect("ViewStudent.aspx?StudentID=" + AppSecurity.Encrypt(e.CommandArgument.ToString())); } }
protected void rgvData_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { string id = null; switch (e.CommandName) { case "InitInsert": Response.Redirect("CrmEvolutionServiceCreate.aspx", true); break; case "View": id = ((e.Item as GridDataItem)).GetDataKeyValue("Id").ToString(); Response.Redirect("CrmEvolutionServiceView.aspx?Id=" + id, true); break; case "Edit": id = ((e.Item as GridDataItem)).GetDataKeyValue("Id").ToString(); Response.Redirect("CrmEvolutionServiceEdit.aspx?Id=" + id, true); break; case "Details": id = ((e.Item as GridDataItem)).GetDataKeyValue("Id").ToString(); Response.Redirect("CrmEvolutionServiceDetail.aspx?ServiceId=" + id, true); break; case "Revert": id = ((GridDataItem)e.Item)["Id"].Text; DAL.ServiceCrmEvolution.Revert(ctx, Convert.ToInt32(id)); break; case "Execute": id = ((GridDataItem)e.Item)["Id"].Text; Helper.Execute.Start(DAL.ServiceCrmEvolution.Get(ctx, Convert.ToInt32(id)).Code); break; } }
protected void RadGrid1_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { GridEditableItem editedItem = e.Item as GridEditableItem; UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID); GroupMA gma = new GroupMA(); try { gma.GtCode = (userControl.FindControl("txtGroupMACode") as RadTextBox).Text.ToUpper(); gma.UserInsert = "toro"; gma.TglInsert = DateTime.Now; gma.Save(); } catch (Exception ex) { string es = ex.Message; e.Canceled = true; } finally { RadGrid1.Rebind(); } }
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { // weonly process commands with a datasource (our image buttons) if (e.CommandSource == null) { return; } string typeOfControl = e.CommandSource.GetType().ToString(); if (typeOfControl.Equals("System.Web.UI.WebControls.ImageButton")) { int id = 0; ImageButton imgb = (ImageButton)e.CommandSource; if (imgb.ID != "New" && imgb.ID != "Exit") { id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]]; } switch (imgb.ID) { case "Select": break; case "Edit": break; case "Delete": Session["DeleteId"] = id; string message = Resources.GeneralResource.DeleteRecordQuestion; GridDataItem gdi = (GridDataItem)e.Item; message = String.Format("{0}<br/>{1}: {2}", message, gdi["Patient.FullName"].Text, gdi["Examination.Name"].Text); string command = String.Format("ariDialog('Servicios','{0}','prompt',null,0,0)", message); RadAjaxManager1.ResponseScripts.Add(command); break; } } }
//GridFund_ItemCommand event is use for two command name edit and delete protected void GridFund_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { string EnvelopedNumber, DID; //if command name is EditDonation donation it will get the id of particuar //row to edit the donation and redirecte it to newdonation screen to update that donation if (e.CommandName == "EditDonation") { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; EnvelopedNumber = (item["Envelopenumber"].Text.ToString()); DID = item["DID"].Text.ToString().Trim(); Response.Redirect("~/UserScreens/NewDonation.aspx?DID=" + DID); } } //If command name is delete it will get the id that donation which needs to be deleted by calling DELETEDonation //it will successfully get deleted else if (e.CommandName == "Delete") { GridDataItem item = (GridDataItem)e.Item; objd.Envelopenumber = (item["Envelopenumber"].Text.ToString()); objd.FundName = (item["FundName"].Text.ToString()); no_of_rows_affected = objd.DELETEDonation(); if (no_of_rows_affected == 1) { Validations.showMessage(lblErrorMsg, "Donation " + Validations.RecordDeleted, ""); BindGrid(); } else { Validations.showMessage(lblErrorMsg, "Donation " + Validations.Err_RefDelete, "Error"); } } }
protected void RG_Salary_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { try { if (e.CommandName == "Formula") { GridDataItem dt_Item = (GridDataItem)e.Item; int index = dt_Item.ItemIndex; Label lblCode = new Label(); // Pay item Code Label lblMode = new Label(); // Pay item Mode Telerik.Web.UI.RadTextBox txtVal = new RadTextBox(); // Salary Structure Entered Value Label lblformula = new Label(); //Salary Structure Entered Formula lblCode = RG_Salary.Items[index].FindControl("lblCode") as Label; lblMode = RG_Salary.Items[index].FindControl("lblMode") as Label; txtVal = RG_Salary.Items[index].FindControl("txtValue") as Telerik.Web.UI.RadTextBox; lblformula = RG_Salary.Items[index].FindControl("lblformula") as Label; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_SalaryStructure", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rGridStadium_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { }
protected void RadGrid_parametros_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "BUSCAR") { Label lbl_id_año = (Label)e.Item.FindControl("lbl_id_año"); Label lbl_id_mes = (Label)e.Item.FindControl("lbl_id_mes"); Label lbl_id_periodo = (Label)e.Item.FindControl("lbl_id_periodo"); Label lbl_id_categoria = (Label)e.Item.FindControl("lbl_id_categoria"); sidaño = lbl_id_año.Text.Trim(); sidmes = lbl_id_mes.Text.Trim(); sidperiodo = lbl_id_periodo.Text.Trim(); sidcategoria = lbl_id_categoria.Text.Trim(); //llenarPanelClientes(); } if (e.CommandName == "ELIMINAR") { Label lbl_id = (Label)e.Item.FindControl("lbl_id"); string path = Server.MapPath("~/parametros.xml"); Reportes_parametros oReportes_parametros = new Reportes_parametros(); oReportes_parametros.Id = Convert.ToInt32(lbl_id.Text); Reportes_parametrosToXml oReportes_parametrosToXml = new Reportes_parametrosToXml(); oReportes_parametrosToXml.DeleteElement(oReportes_parametros, path); cargarParametrosdeXml(); } if (e.CommandName == "EDITAR") { Label lbl_id = (Label)e.Item.FindControl("lbl_id"); Label lbl_id_año = (Label)e.Item.FindControl("lbl_id_año"); Label lbl_id_mes = (Label)e.Item.FindControl("lbl_id_mes"); Label lbl_id_periodo = (Label)e.Item.FindControl("lbl_id_periodo"); Label lbl_id_categoria = (Label)e.Item.FindControl("lbl_id_categoria"); Label lbl_quiebre = (Label)e.Item.FindControl("lbl_quiebre"); Label lbl_dias = (Label)e.Item.FindControl("lbl_dias"); Session["idxml"] = lbl_id.Text.Trim(); cmb_año.SelectedIndex = cmb_año.Items.FindItemByValue(lbl_id_año.Text).Index; cmb_mes.SelectedIndex = cmb_mes.Items.FindItemByValue(lbl_id_mes.Text).Index; Llenar_Periodos(); cmb_periodo.SelectedIndex = cmb_periodo.FindItemByValue(lbl_id_periodo.Text).Index; TabContainer_filtros.ActiveTabIndex = 0; lbl_updateconsulta.Visible = true; btn_img_actualizar.Visible = true; lbl_saveconsulta.Visible = false; btn_img_add.Visible = false; } }
protected void rgCourier_InsertCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { var detail = ((RadTextBox)rgCourier.MasterTableView.GetInsertItem().FindControl("detail")); insert(detail.Text); }
protected void contactsGrid_ItemCommand3(object sender, Telerik.Web.UI.GridCommandEventArgs e) { }
protected void RewardRadGrid_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { }
protected void rgClassRoom_EditCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { GridDataItem item = (GridDataItem)e.Item; hdnName.Value = item["Name"].Text; }
protected void cityGrid_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { // int news_id = Int32.Parse((e.Item as GridDataItem).GetDataKeyValue("NewsSiteId_Pk").ToString()); //database.DeleteNews(news_id); }
protected void rGridStadium_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { rGridStadium_UpdIns(sender, e, "Update"); }
protected void rdUsuarios_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { switch (e.CommandName) { case "cmdEdit": string[] cParam = new string[2]; cParam[0] = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["cod_user"].ToString(); Response.Redirect(String.Format("Usuario.aspx?CodUsuario={0}", cParam)); break; case "cmdDelete": string pCodUsuario = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["cod_user"].ToString(); DBConn oConn = new DBConn(); if (oConn.Open()) { string sPath = string.Empty; sPath = Server.MapPath(".") + @"\binary\ComentarioUsuario_" + pCodUsuario + ".bin"; File.Delete(sPath); SysComentarioUsuario oComentarioUsuario = new SysComentarioUsuario(ref oConn); oComentarioUsuario.CodUsuario = pCodUsuario; oComentarioUsuario.Accion = "ELIMINAR"; oComentarioUsuario.Put(); sPath = string.Empty; sPath = Server.MapPath(".") + @"\binary\InfoUsuario_" + pCodUsuario + ".bin"; File.Delete(sPath); SyrInfoUsuarios oInfoUsuarios = new SyrInfoUsuarios(ref oConn); oInfoUsuarios.CodUsuario = pCodUsuario; oInfoUsuarios.Accion = "ELIMINAR"; oInfoUsuarios.Put(); SyrPerfilesUsuarios oPerfilesUsuarios = new SyrPerfilesUsuarios(ref oConn); oPerfilesUsuarios.CodUsuario = pCodUsuario; oPerfilesUsuarios.Accion = "ELIMINAR"; oPerfilesUsuarios.Put(); sPath = string.Empty; sPath = Server.MapPath(".") + @"\binary\RelacionUsuario_" + pCodUsuario + ".bin"; File.Delete(sPath); SysRelacionUsuarios oRelacionUsuarios = new SysRelacionUsuarios(ref oConn); oRelacionUsuarios.CodUsuario = pCodUsuario; oRelacionUsuarios.Accion = "ELIMINAR"; oRelacionUsuarios.Put(); /* Eliminar referencia de los usuarios con el usuario eliminado */ sPath = string.Empty; sPath = Server.MapPath(".") + @"\binary\UserArchivo_" + pCodUsuario + ".bin"; File.Delete(sPath); SysArchivosUsuarios oArchivosUsuarios = new SysArchivosUsuarios(ref oConn); oArchivosUsuarios.CodUsuario = pCodUsuario; DataTable dUserFile = oArchivosUsuarios.Get(); if (dUserFile != null) { if (dUserFile.Rows.Count > 0) { sPath = string.Empty; sPath = Server.MapPath(".") + @"\rps_onlineservice\usuarios\usuario_" + pCodUsuario + @"\"; foreach (DataRow oRow in dUserFile.Rows) { sPath = sPath + oRow["nom_archivo"].ToString(); File.Delete(sPath); } } } dUserFile = null; oArchivosUsuarios.Accion = "ELIMINAR"; oArchivosUsuarios.Put(); sPath = string.Empty; sPath = Server.MapPath(".") + @"\binary\Usuario_" + pCodUsuario + ".bin"; File.Delete(sPath); SysUsuario oUsuario = new SysUsuario(ref oConn); oUsuario.CodUsuario = pCodUsuario; oUsuario.EstUsuario = "E"; oUsuario.Accion = "EDITAR"; oUsuario.Put(); sPath = string.Empty; sPath = Server.MapPath(".") + @"\binary\"; string sFile = "Usuarios.bin"; oUsuario.SerializaTblUsuario(ref oConn, sPath, sFile); oConn.Close(); } rdUsuarios.Rebind(); break; } }
protected void RGTxns_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { LoadTxns(); }
public bool SubmitRecord(object source, Telerik.Web.UI.GridCommandEventArgs e) { DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.ClassRoom, "SubmitRecord", "Submit record method called", DayCarePL.Common.GUID_DEFAULT); bool result = false; try { DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.ClassRoom, "SubmitRecord", " Debug Submit record method called of ClassRoom", DayCarePL.Common.GUID_DEFAULT); DayCareBAL.ClassRoomService proxySave = new DayCareBAL.ClassRoomService(); DayCarePL.ClassRoomProperties objClassRoom = new DayCarePL.ClassRoomProperties(); Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)e.Item; var InsertItem = e.Item as Telerik.Web.UI.GridEditableItem; Telerik.Web.UI.GridEditManager editMan = InsertItem.EditManager; if (InsertItem != null) { foreach (GridColumn column in e.Item.OwnerTableView.RenderColumns) { if (column is IGridEditableColumn) { IGridEditableColumn editableCol = (column as IGridEditableColumn); if (editableCol.IsEditable) { IGridColumnEditor editor = editMan.GetColumnEditor(editableCol); switch (column.UniqueName) { case "Name": { objClassRoom.Name = (editor as GridTextBoxColumnEditor).Text.Trim().ToString(); ViewState["Name"] = objClassRoom.Name; break; } case "MaxSize": { if (!string.IsNullOrEmpty((e.Item.FindControl("txtMaxSize") as TextBox).Text)) { objClassRoom.MaxSize = Convert.ToInt32((e.Item.FindControl("txtMaxSize") as TextBox).Text); ViewState["MaxSize"] = objClassRoom.MaxSize; } else { objClassRoom.MaxSize = 0; } break; } case "Active": { objClassRoom.Active = (editor as GridCheckBoxColumnEditor).Value; break; } case "FullName": { objClassRoom.StaffId = new Guid((e.Item.FindControl("ddlStaff") as DropDownList).SelectedValue); break; } } } } } if (Session["SchoolId"] != null) { objClassRoom.SchoolId = new Guid(Session["SchoolId"].ToString()); } if (e.CommandName != "PerformInsert") { if (Session["StaffId"] != null) { objClassRoom.LastModifiedById = new Guid(Session["StaffId"].ToString()); } objClassRoom.Id = new Guid(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"].ToString()); // objClassRoom.StaffId = new Guid(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["FullName"].ToString()); if (!objClassRoom.Id.ToString().Equals(hdnName.Value.Trim())) { // bool ans = Common.CheckDuplicate("ClassRoom", "Name", objClassRoom.Name, "update", objClassRoom.Id.ToString()); bool ans = proxySave.CheckDuplicateClassRoomName(objClassRoom.Name, objClassRoom.Id, objClassRoom.SchoolId, objClassRoom.StaffId.Value, new Guid(Session["CurrentSchoolYearId"].ToString())); if (ans) { MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Already Exist", "false")); return(false); } } } else { // bool ans = Common.CheckDuplicate("ClassRoom", "Name", objClassRoom.Name, "insert", objClassRoom.Id.ToString()); bool ans = proxySave.CheckDuplicateClassRoomName(objClassRoom.Name, objClassRoom.Id, objClassRoom.SchoolId, objClassRoom.StaffId.Value, new Guid(Session["CurrentSchoolYearId"].ToString())); if (ans) { MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Already Exist", "false")); return(false); } } hdnName.Value = ""; //result = proxySave.Save(objClassRoom); if (Session["StaffId"] == null) { Response.Redirect("~/Login.aspx"); } else { objClassRoom.LastModifiedById = new Guid(Session["StaffId"].ToString()); } result = proxySave.SaveClassRoomYearWise(objClassRoom, new Guid(Session["CurrentSchoolYearId"].ToString())); if (result == true) { MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Saved Successfully", "false")); } } } catch (Exception ex) { DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.ClassRoom, "SubmitRecord", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT); result = false; } return(result); }
protected void RadGrid1_InsertCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { }
protected void RedemptionMemberRadGrid_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "manage") { Guid UserId = (Guid)((GridDataItem)e.Item).GetDataKeyValue("UserId"); Response.Redirect("MemberUpdate.aspx?userid=" + UserId.ToString()); } //Reset password to be in link client page //if (e.CommandName == "resetpassword") //{ // Guid UserId = (Guid)((GridDataItem)e.Item).GetDataKeyValue("UserId"); // Response.Redirect("MemberResetPassword.aspx?userid=" + UserId.ToString()); //} if (e.CommandName == "enable") { Guid UserId = (Guid)((GridDataItem)e.Item).GetDataKeyValue("UserId"); MembershipUser aMembershipUser = Membership.GetUser(UserId); LinkButton enableLB = e.Item.FindControl("enableLB") as LinkButton; aMembershipUser.IsApproved = !aMembershipUser.IsApproved; Membership.UpdateUser(aMembershipUser); RedemptionMemberRadGrid.Rebind(); //if (aMembershipUser.IsApproved) //{ enableLB.Text = "Disable"; } //else { enableLB.Text = "Enable"; } //TBA if (aMembershipUser.IsApproved) { Logger.LogInfo(Membership.GetUser().UserName + "- disabled member username:"******"- enabled member username:"******"unlock") { Guid UserId = (Guid)((GridDataItem)e.Item).GetDataKeyValue("UserId"); MembershipUser aMembershipUser = Membership.GetUser(UserId); aMembershipUser.UnlockUser(); Membership.UpdateUser(aMembershipUser); RedemptionMemberRadGrid.Rebind(); //if (aMembershipUser.IsApproved) //{ enableLB.Text = "Disable"; } //else { enableLB.Text = "Enable"; } //TBA Logger.LogInfo(Membership.GetUser().UserName + "- unlock member username:"******"linkclient") { Guid UserId = (Guid)((GridDataItem)e.Item).GetDataKeyValue("UserId"); Response.Redirect("MemberClient.aspx?userid=" + UserId.ToString()); } }
//*** //*** RadGridBoxes_ItemCommand protected void RadGridBoxes_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { try { CheckSession(); if (e.CommandName == "PerformInsert") // add { GridDataItem item = e.Item as GridDataItem; string po_id = ""; //string po_number = Controller.Clean(((TextBox)item.FindControl("po_numberTXT")).Text); //string official_number = Controller.Clean(((TextBox)item.FindControl("official_numberTXT")).Text); RadDatePicker add_po_dateRDP = ((RadDatePicker)item.FindControl("po_dateRDPTXT")); string item_id = ((RadComboBox)item.FindControl("item_idRCB")).SelectedValue; //string po_address = ((TextBox)item.FindControl("po_addressTXT")).Text; //string po_contactPerson = Controller.Clean(((TextBox)item.FindControl("po_contactPersonTXT")).Text); string po_date = add_po_dateRDP.SelectedDate.ToString(); using (SqlConnection con = new SqlConnection(Controller.connection)) { using (SqlCommand cmd = new SqlCommand()) { Dictionary <string, string> fields = new Dictionary <string, string>(); // fields.Add("po_number", po_number); //fields.Add("official_number", official_number); fields.Add("item_id", item_id); fields.Add("po_date", po_date); //fields.Add("po_address", po_address); fields.Add("user_name", Session["user_name"].ToString()); fields.Add("createdBy", Session["user_name"].ToString()); con.Open(); po_id = Controller.InsertInto(cmd, con, "CNRS_PurchaseOrder", fields, true); } } RadGridBoxes.MasterTableView.IsItemInserted = false; if (po_id != "") { NavigateNextStep(item_id, po_id, 0); } } if (e.CommandName == "Update") //edit { if (e.Item is GridDataItem) { string role_id = getRoleID(); GridDataItem item = e.Item as GridDataItem; string po_id = item.GetDataKeyValue("po_id").ToString(); string po_number = Controller.Clean(((TextBox)item.FindControl("po_numberTXT")).Text); string official_number = Controller.Clean(((TextBox)item.FindControl("official_numberTXT")).Text); RadDatePicker po_dateRDP = ((RadDatePicker)item.FindControl("po_dateRDPTXT")); //string po_contactPerson = Controller.Clean(((TextBox)item.FindControl("po_contactPersonTXT")).Text); //string po_address = ((TextBox)item.FindControl("po_addressTXT")).Text; string po_date = po_dateRDP.SelectedDate.ToString(); using (SqlConnection con = new SqlConnection(Controller.connection)) { using (SqlCommand cmd = new SqlCommand()) { Dictionary <string, string> fields = new Dictionary <string, string>(); Dictionary <string, string> conditions = new Dictionary <string, string>(); conditions.Add("po_id", po_id); con.Open(); if (role_id == "3") // Secretary { fields.Add("official_number", official_number); //fields.Add("po_date_secretary", DateTime.Now.ToString()); Controller.Update(cmd, con, "CNRS_PurchaseOrder", fields, conditions); return; } else if (role_id == "5") // Head of Department { fields.Add("po_number", po_number); fields.Add("po_date_headOfDepartment", DateTime.Now.ToString()); Controller.Update(cmd, con, "CNRS_PurchaseOrder", fields, conditions); return; } fields.Clear(); if (role_id == "1") { fields.Add("po_number", po_number); fields.Add("official_number", official_number); } fields.Add("po_date", po_date); fields.Add("user_name", Session["user_name"].ToString()); fields.Add("modifedBy", Session["user_name"].ToString()); fields.Add("modifiedOn", DateTime.Now.ToString()); //fields.Add("po_address", po_address); //fields.Add("po_contactPerson", Session["user_name"].ToString()); Controller.Update(cmd, con, "CNRS_PurchaseOrder", fields, conditions); AlertJS(); } } } } else if (e.CommandName == "Delete") // inactivate { if (e.Item is GridDataItem) { GridDataItem item = e.Item as GridDataItem; Label item_idLBL = (Label)item.FindControl("item_idLBL"); string item_id = item_idLBL.Text; int po_id = (int)item.GetDataKeyValue("po_id"); using (SqlConnection con = new SqlConnection(Controller.connection)) { using (SqlCommand cmd = new SqlCommand()) { con.Open(); Controller.Inactivate(cmd, con, "CNRS_PurchaseOrder", "po_id", po_id.ToString(), Session["user_name"].ToString()); Dictionary <string, string> fields = new Dictionary <string, string>(); fields.Add("active", false.ToString()); Dictionary <string, string> conditions = new Dictionary <string, string>(); conditions.Add("po_id", po_id.ToString()); if (item_id == "1") //TLD { Controller.Update(cmd, con, "CNRS_TLDDetails", fields, conditions); } else if (item_id == "2") //SSDL { Controller.Update(cmd, con, "CNRS_SSDLServiceFees", fields, conditions); } AlertJS(); } } } } } catch (Exception ex) { Controller.SaveErrors(Path.GetFileName(Request.PhysicalPath), ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name); } }
protected void gvLog_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { }
protected void gvDiscountCodes_OnCancelCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { IsPageDirty = false; }
protected void rgCourier_EditCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { }
protected void gvDiscountCodes_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { if (Page.IsValid) { ClearUI(); uplAddDisCode.Update(); //Get the GridEditableItem of the RadGrid GridEditableItem editedItem = e.Item as GridEditableItem; TextBox txtDiscountCode = (TextBox)editedItem.FindControl("txtDiscountCode"); RadNumericTextBox txtDuration = (RadNumericTextBox)editedItem.FindControl("txtDuration"); RadNumericTextBox txtInstanceCount = (RadNumericTextBox)editedItem.FindControl("txtInstanceCount"); RadNumericTextBox txtDiscountPercentage = (RadNumericTextBox)editedItem.FindControl("txtDiscountPercentage"); RadDatePicker dtExpireDate = (RadDatePicker)editedItem.FindControl("dtExpireDate"); int discountCodeID = (int)editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["DiscountCode.DiscountCodeID"]; int discountCodeUsageCount = GetDiscountUsageCount(discountCodeID); DateTime originalLastUpdatedDate = (DateTime)editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["DiscountCode.LastUpdatedDate"]; DiscountCode discountCode = (from dc in DataContext.DiscountCodes where dc.DiscountCodeID == discountCodeID select dc).FirstOrDefault(); if (dtExpireDate.SelectedDate.HasValue && dtExpireDate.SelectedDate.Value < Today) { Image imgExpireDate = (Image)editedItem.FindControl("imgExpireDate"); imgExpireDate.Visible = true; imgExpireDate.ToolTip = string.Format("Expiry date cannot be a past date."); e.Canceled = true; return; } if (discountCode == null) { StageBitzException.ThrowException(new ConcurrencyException(ExceptionOrigin.ManageDiscounts, discountCodeID)); } if (discountCodeUsageCount > 0) { if (discountCodeUsageCount > txtInstanceCount.Value.Value) { Image imgInstanceCountError = (Image)editedItem.FindControl("imgInstanceCountError"); imgInstanceCountError.Visible = true; imgInstanceCountError.ToolTip = string.Format("Instance count cannot be reduced below the used count {0}.", discountCodeUsageCount); e.Canceled = true; return; } discountCode.InstanceCount = (int)txtInstanceCount.Value.Value; } else { if (!IsValidtoSave(txtDiscountCode.Text, discountCodeID, false)) { Image imgDiscountCodeError = (Image)editedItem.FindControl("imgDiscountCodeError"); imgDiscountCodeError.Visible = true; imgDiscountCodeError.ToolTip = "Please choose a different Discount Code."; e.Canceled = true; return; } discountCode.Code = txtDiscountCode.Text.Trim(); discountCode.Discount = (decimal)txtDiscountPercentage.Value.Value; discountCode.InstanceCount = (int)txtInstanceCount.Value.Value; discountCode.Duration = (int)txtDuration.Value.Value; discountCode.ExpireDate = dtExpireDate.SelectedDate.Value; } discountCode.LastUpdatedByUserId = UserID; discountCode.LastUpdatedDate = Now; DataContext.SaveChanges(); IsPageDirty = false;//Clear the page dirty gvDiscountCodes.EditIndexes.Clear(); gvDiscountCodes.MasterTableView.IsItemInserted = false; gvDiscountCodes.Rebind(); } }
protected void rGridSeason_InsertCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { rGridSeason_UpdIns(sender, e, "Insert"); }
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { string id = e.CommandArgument.ToString(); if (e.CommandName == "Chanel") { Response.Redirect("RepairEdit.aspx?ID=" + e.CommandArgument + "");//跳转修改页面 } if (e.CommandName == "UP") { Declaration_Mol = Declaration_Bll.GetModel(e.CommandArgument.ToString()); Declaration_Mol.DeclarationState = "装备中心待受理"; Declaration_Bll.Update(Declaration_Mol); DataLoad(); RadGrid1.Rebind(); } if (e.CommandName == "Return") { Declaration_Mol = Declaration_Bll.GetModel(e.CommandArgument.ToString()); Declaration_Mol.DeclarationState = "未上报"; Declaration_Bll.Update(Declaration_Mol); DataLoad(); RadGrid1.Rebind(); } if (e.CommandName == "CheckOK") { Declaration_Mol = Declaration_Bll.GetModel(e.CommandArgument.ToString()); Declaration_Mol.DeclarationState = "维修完成"; Declaration_Bll.Update(Declaration_Mol); DataLoad(); RadGrid1.Rebind(); } if (e.CommandName == "CheckBack") { Declaration_Mol = Declaration_Bll.GetModel(e.CommandArgument.ToString()); Replacement_Mol = Replacement_Bll.GetModelJYF(Declaration_Mol.ReplacementID); if (Declaration_Mol.ReplacementUse != "否") { Replacement_Mol.ReplacementState = "未借出"; Replacement_Bll.Update(Replacement_Mol); ReplacementRecord_Mol = ReplacementRecord_Bll.GetModelJYF2(Declaration_Mol.ReplacementID); ReplacementRecord_Mol.ReplacementBackTime = DateTime.Now; ReplacementRecord_Bll.Update(ReplacementRecord_Mol); } Declaration_Mol.DeclarationState = "报修单位已取回"; Declaration_Bll.Update(Declaration_Mol); DataLoad(); RadGrid1.Rebind(); } if (e.CommandName == "Repair2") { Lable_xxx.Text = e.CommandArgument.ToString(); //Response.Redirect("RepairBackAdd.aspx?ID=" + e.CommandArgument + ""); } if (e.CommandName == "CheckRepair2Back") { Declaration_Mol = Declaration_Bll.GetModel(e.CommandArgument.ToString()); Replacement_Mol = Replacement_Bll.GetModelJYF(Declaration_Mol.ReplacementID); if (Declaration_Mol.ReplacementUse != "否") { Replacement_Mol.ReplacementState = "未借出"; Replacement_Bll.Update(Replacement_Mol); ReplacementRecord_Mol.ReplacementBackTime = DateTime.Now; ReplacementRecord_Bll.Update(ReplacementRecord_Mol); } Declaration_Mol.DeclarationState = "报修单位已取回(返修)"; Declaration_Bll.Update(Declaration_Mol); DataLoad(); RadGrid1.Rebind(); } if (e.CommandName == "CheckRepair2OK") { Declaration_Mol = Declaration_Bll.GetModel(e.CommandArgument.ToString()); Declaration_Mol.DeclarationState = "返修完成"; Declaration_Bll.Update(Declaration_Mol); DataLoad(); RadGrid1.Rebind(); } if (e.CommandName == "Down") { Response.Redirect("RepairReport.aspx?ID=" + e.CommandArgument + "");//跳转报表页面 } }