protected void cbpGuardarScoring_Callback(object source, DevExpress.Web.CallbackEventArgs e) { if (!string.IsNullOrEmpty(e.Parameter)) { e.Result = ValidarScoring(e.Parameter); } }
protected void cbpScoring_Callback(object source, DevExpress.Web.CallbackEventArgs e) { LogicaNegocio Ln = new LogicaNegocio(); DataTable dt = new DataTable(); if (e.Parameter.Split(',')[0] == "actividad") { DataRow[] result = null; dt = ActividadEconomica(); result = dt.Select("ID = '" + e.Parameter.Split(',')[1].Trim() + "'"); e.Result = string.Format("{0}{1}{2}", e.Parameter.Split(',')[0].Trim(), "~", result[0]["Puntaje"].ToString().Trim()); } else { dt = Ln.ListarScoring(e.Parameter.Split(',')[1], "", "", "02"); if (dt.Rows.Count > 0) { e.Result = string.Format("{0}{1}{2}", e.Parameter.Split(',')[0], "~", dt.Rows[0]["Valor2"].ToString()); } else { e.Result = string.Format("{0}{1}{2}", e.Parameter.Split(',')[0], "~", "0"); } } }
private void callback_Callback(object source, CallbackEventArgs e) { String[] p = e.Parameter.Split('|'); Object key = TypeDescriptor.GetConverter(ObjectTypeInfo.KeyMember.MemberType).ConvertFromString(p[0]); IMemberInfo member = ObjectTypeInfo.FindMember(p[1]); Object value = null; if (typeof(IXPSimpleObject).IsAssignableFrom(member.MemberType)) { Type memberKeyType = XafTypesInfo.Instance.FindTypeInfo(member.MemberType).KeyMember.MemberType; int index1 = p[2].LastIndexOf("(", StringComparison.Ordinal); int index2 = p[2].LastIndexOf(")", StringComparison.Ordinal); if (index1 > 0 && index2 > index1) { string memberKeyText = p[2].Substring(index1 + 1, index2 - index1 - 1); value = ObjectSpace.GetObjectByKey(member.MemberType, Convert.ChangeType(memberKeyText, memberKeyType)); } } else { value = TypeDescriptor.GetConverter(member.MemberType).ConvertFromString(p[2]); } object obj = ObjectSpace.GetObjectByKey(ObjectTypeInfo.Type, key); member.SetValue(obj, value); ObjectSpace.CommitChanges(); }
protected void Handler_OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": int id; if (int.TryParse(values[1], out id)) { SelectedItem = Items.List.Where(f => f.Index == id).FirstOrDefault(); } break; } } if (EditValueChanged != null) { EditValueChanged(this, EventArgs.Empty); } InnerRender(); if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format(@"function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } }
protected void cbpCargarExcel_Callback(object source, DevExpress.Web.CallbackEventArgs e) { if (e.Parameter == "InsertarCalendario") { e.Result = InsertarCalendario(); } }
protected void ASPxCallback1_Callback(object source, DevExpress.Web.CallbackEventArgs e) { string[] split = e.Parameter.Split(';'); if (split[0].Equals("DblClick") && !String.IsNullOrEmpty(split[1])) { DevExpress.Web.ASPxWebControl.RedirectOnCallback(GenerateURI("ClientsForm.aspx", (int)Enums.UserAction.Edit, split[1])); } }
protected void cb_Callback(object source, DevExpress.Web.CallbackEventArgs e) { String[] p = e.Parameter.Split('|'); MyObject obj = session.GetObjectByKey <MyObject>(Convert.ToInt32(p[0])); // get the record from the Session obj.Active = Convert.ToInt32(p[1]); obj.Save(); }
void Handler_OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "Show": if (Helper != null) { var view = Helper.CreateListView(Helper.ObjectSpace.GetObject(Editor.CurrentObject)); var SVP = new ShowViewParameters(view); SVP.TargetWindow = TargetWindow.NewModalWindow; DialogController dc = Helper.Application.CreateController <DialogController>(); dc.Accepting += new EventHandler <DialogControllerAcceptingEventArgs>(delegate(object sender, DialogControllerAcceptingEventArgs ev) { var os = (Editor as XafBootstrapLookupPropertyEditor).ObjectSpace; foreach (var item in view.SelectedObjects) { Editor.PropertyValue = os.GetObject(item); } }); SVP.Controllers.Add(dc); Helper.Application.ShowViewStrategy.ShowView(SVP, new ShowViewSource(null, null)); } break; case "Link": if (Value != null) { DetailView detailView = Helper.Application.CreateDetailView(Helper.ObjectSpace, Helper.ObjectSpace.GetObject(Value)); var dSVP = new ShowViewParameters(detailView); dSVP.TargetWindow = TargetWindow.NewModalWindow; DialogController dc = Helper.Application.CreateController <DialogController>(); dc.CancelAction.Active["Visible"] = false; dSVP.Controllers.Add(dc); Helper.Application.ShowViewStrategy.ShowView(dSVP, new ShowViewSource(null, null)); } break; } } if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format("function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } }
protected void SendCallback_Callback(object source, DevExpress.Web.CallbackEventArgs e) { try { SmtpClient client = new SmtpClient(); client.Host = txtHost.Text; client.Port = CommonMethods.ParseInt(txtPort.Text);//Port 465 (SSL required) client.EnableSsl = EnableSSLCheckBox.Checked; client.DeliveryMethod = SmtpDeliveryMethod.Network; if (CredentialExistCheckBox.Checked) { client.Credentials = new NetworkCredential(txtUsername.Text, txtPassword.Text); } else { client.UseDefaultCredentials = true; } client.Timeout = 6000; MailMessage message; message = new MailMessage(); message.To.Add(new MailAddress(txtMailTo.Text)); message.Sender = new MailAddress(txtSender.Text); message.From = new MailAddress(txtSender.Text, "Test sending email"); message.Subject = txtSubject.Text; message.IsBodyHtml = false; message.Body = txtBody.Text; message.BodyEncoding = Encoding.UTF8; client.Send(message); SendCallback.JSProperties["cpMailSendError"] = "Elektornska pošta poslana ne " + txtMailTo.Text; } catch (SmtpFailedRecipientsException ex) { SendCallback.JSProperties["cpMailSendError"] = "SmtpFailedRecipientsException \r\n" + ex.Message + "\r\n " + ex.Source + "\r\n " + ex.StackTrace; CommonMethods.LogThis("SmtpFailedRecipientsException \r\n" + ex.Message + "\r\n " + ex.Source + "\r\n " + ex.StackTrace); } catch (SmtpException ex) { SendCallback.JSProperties["cpMailSendError"] = "SmtpException \r\n" + ex.Message + "\r\n " + ex.Source + "\r\n " + ex.StackTrace; CommonMethods.LogThis("SmtpException \r\n" + ex.Message + "\r\n " + ex.Source + "\r\n " + ex.StackTrace); } catch (Exception ex) { SendCallback.JSProperties["cpMailSendError"] = "Exception \r\n" + ex.Message + "\r\n " + ex.Source + "\r\n " + ex.StackTrace; CommonMethods.LogThis("Exception \r\n" + ex.Message + "\r\n " + ex.Source + "\r\n " + ex.StackTrace); } }
protected void ASPxCallback1_Callback(object source, DevExpress.Web.CallbackEventArgs e) { if (IsPostBack) { Thread.Sleep(3000); } if (e.Parameter == "SaveData") { ClientScript.RegisterStartupScript(this.GetType(), "alert", "ShowPopup();", true); } }
protected void cbpFinalizarScoring_Callback(object source, DevExpress.Web.CallbackEventArgs e) { if (e.Parameter == "guardar") { e.Result = GuardarScoring(); } if (e.Parameter == "finalizar") { e.Result = FinalizarScoring(); } if (e.Parameter == "imprimir") { Imprimir(); } }
protected void ASPxCallback1_Callback(object source, DevExpress.Web.CallbackEventArgs e) { try { ASPxCallback cb = source as ASPxCallback; List <MenuItemFunction> lstMenu = new List <MenuItemFunction>(); foreach (TreeListNode item in trl.GetSelectedNodes()) { MenuItemFunction item1 = new MenuItemFunction(); item1.Item_ID = item.Key; lstMenu.Add(item1); } ctlRole.insertMenuItemRoles(lstMenu, Convert.ToInt32(this.IdRole)); Utils.notifierCallBack(cb, Constant.NOTIFY_SUCCESS, "Lưu chức năng cho role thành công."); } catch (Exception ex) { Utils.notifierPage(Page, this.GetType(), Constant.NOTIFY_FAILURE, ex.Message + " " + ex.StackTrace, Constant.TIME_ERROR); } }
protected void cb_callback(object sender, DevExpress.Web.CallbackEventArgs e) { String[] parameters = e.Parameter.Split('|'); string id = parameters[0]; bool isChecked = Convert.ToBoolean(parameters[1]); DataTable dt = new DataTable(); if (Session["WindowsServices"] != null && Session["WindowsServices"] != "") { dt = (DataTable)Session["WindowsServices"]; } if (dt.Rows.Count > 0) { DataRow row = dt.Rows.Find(id); (dt.Rows.Find(id))["isSelected"] = isChecked; DataRow row2 = dt.Rows.Find(id); Session["WindowsServices"] = dt; } }
private void callback_Callback(object source, CallbackEventArgs e){ String[] p = e.Parameter.Split('|'); Object key = TypeDescriptor.GetConverter(ObjectTypeInfo.KeyMember.MemberType).ConvertFromString(p[0]); IMemberInfo member = ObjectTypeInfo.FindMember(p[1]); Object value = null; if (typeof (IXPSimpleObject).IsAssignableFrom(member.MemberType)){ Type memberKeyType = XafTypesInfo.Instance.FindTypeInfo(member.MemberType).KeyMember.MemberType; int index1 = p[2].LastIndexOf("(", StringComparison.Ordinal); int index2 = p[2].LastIndexOf(")", StringComparison.Ordinal); if (index1 > 0 && index2 > index1){ string memberKeyText = p[2].Substring(index1 + 1, index2 - index1 - 1); value = ObjectSpace.GetObjectByKey(member.MemberType, Convert.ChangeType(memberKeyText, memberKeyType)); } } else{ value = TypeDescriptor.GetConverter(member.MemberType).ConvertFromString(p[2]); } object obj = ObjectSpace.GetObjectByKey(ObjectTypeInfo.Type, key); member.SetValue(obj, value); ObjectSpace.CommitChanges(); }
protected void Handler_OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": int id; if (int.TryParse(values[1], out id)) { SelectedItem = Items.List.Where(f => f.Index == id).FirstOrDefault(); } break; } } if (EditValueChanged != null) { EditValueChanged(this, EventArgs.Empty); } InnerRender(); RegisterOnClickScript(); }
protected void clbProgress_Callback(object source, DevExpress.Web.CallbackEventArgs e) { e.Result = progressInPercent.ToString(); }
protected void Callback_Callback(object source, DevExpress.Web.CallbackEventArgs e) { Session.Remove(SessionKey); e.Result = "OK"; }
protected void ClearImageCallback_Callback(object source, DevExpress.Web.CallbackEventArgs e) { GetEmployeeDataProviderInstance().GetFullEmployeeModel().ProfileImage = ""; e.Result = "/Images/Profile5.png"; }
private void Handler_OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { DoProcessAction(e.Parameter); }
protected void Handler_OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": var newValues = values[1].Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries); int id; var oldValues = String.Concat(Value).Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries).ToList(); foreach (var item in newValues) { if (int.TryParse(item, out id)) { var SelectedItem = Items.List[id]; if (oldValues.IndexOf(SelectedItem.Value) == -1) { oldValues.Add(SelectedItem.Value); } } } Value = String.Join(Delimeter, oldValues); break; case "AddValue": newValues = values[1].Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries); foreach (var item in newValues) { if (Items.List.Where(f => f.Value == item).Count() == 0) { var newItem = Items.Add(); newItem.Text = newItem.Value = item; } } oldValues = String.Concat(Value).Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries).ToList(); foreach (var item in newValues) { if (oldValues.IndexOf(item) == -1) { oldValues.Add(item); } } Value = String.Join(Delimeter, oldValues); break; case "Remove": oldValues = String.Concat(Value).Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (int.TryParse(values[1], out id)) { var item = Items.List[id]; if (oldValues.IndexOf(item.Value) > -1) { oldValues.Remove(item.Value); } if (item.IsMissed) { Items.List.Remove(item); } } Value = String.Join(Delimeter, oldValues); break; } } if (EditValueChanged != null) { EditValueChanged(this, EventArgs.Empty); } InnerRender(); if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format(@"function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } if (OnCallback != null) { OnCallback(source, e); } }
protected void clbAtualizar_Callback(object source, DevExpress.Web.CallbackEventArgs e) { //********************************** //* É uma chamada de inicializãção? //********************************** if (e.Parameter == string.Empty) { //************** //* Declarações //************** Int32 Nro_Oportunidade = 0; //*************************** //* Edição ou novo registro? //*************************** if (Request.QueryString["codigo"] == null) { Nro_Oportunidade = 0; } else { Nro_Oportunidade = Convert.ToInt32(Request.QueryString["codigo"]); } //****************************** //* Popula dados no objeto JSON //****************************** PopulaJSON(Nro_Oportunidade); //******************************* //* Devolve estrutura JSON vazia //******************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); } else { //************************* //* Deserializa requisição //************************* JavaScriptSerializer oSerializer = new JavaScriptSerializer(); oJSON = oSerializer.Deserialize <Oportunidade_JSON>(e.Parameter); //****************************** //* Executa operação solicitada //****************************** switch (oJSON.operacao) { case "Salvar_Etapa1": //************************************* //* Coleta código da nova oportunidade //************************************* SalvaEtapa1(oJSON); //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; case "Salvar_Etapa2": //********************************** //* Coleta código do novo orçamento //********************************** SalvaEtapa2(oJSON); //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; case "Salvar_Etapa3": //******************************** //* Atualiza dados da etapa final //******************************** SalvaEtapa3(oJSON); //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; case "Excluir_Orcamento": //********************************** //* Coleta código do novo orçamento //********************************** ExcluiOrcamento(oJSON); //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; case "Enviar_Boas_Vindas": //********************************** //* Coleta código do novo orçamento //********************************** if (oJSON.oportunidade.PK_nro_oportunidade != 0) { //***************** //* Obtem resposta //***************** oJSON = EnviaBoasVindas(oJSON); //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); } break; case "Enviar_Orcamento": //********************************** //* Coleta código do novo orçamento //********************************** if (oJSON.orcamentos[0].PK_cod_orcamento != 0) { //***************** //* Obtem resposta //***************** oJSON = EnviaOrcamento(oJSON); //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); } break; case "Enviar_Orcamentos_Aceitos": //********************************** //* Coleta código do novo orçamento //********************************** if (oJSON.orcamentos[0].PK_cod_orcamento != 0) { //***************** //* Obtem resposta //***************** oJSON = EnviaOrcamentosAceitos(oJSON); //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); } break; case "Coletar_Resposta": //************** //* Declarações //************** Oportunidade_Orcamentos_Manager oManager; oManager = new Oportunidade_Orcamentos_Manager(DBConnection.GetConnectionFromSession(Session["Decision_LoginInfo"])); Oportunidade_Orcamentos_Fields oOrcamento = new Oportunidade_Orcamentos_Fields(); Int32 IndiceOrcamento = 0; Int32 CodOrcamento = 0; //********************************* //* Obtem dados do orçamento atual //********************************* CodOrcamento = Convert.ToInt32(oJSON.parametros["CodigoOrcamento"]); oOrcamento = oManager.GetRecord(CodOrcamento); //******************************* //* Foi possível obter os dados? //******************************* if (!oManager.Error && oOrcamento.PK_cod_orcamento != 0) { //*********************** //* O cliente respondeu? //*********************** if (oOrcamento.html_resposta != string.Empty) { //******************************** //* Desfaz pendência do orçamento //******************************** oOrcamento.pendencia = false; oManager.ApplyRecord(oOrcamento); //******************************* //* Devolve orçamento atualizado //******************************* for (IndiceOrcamento = 0; IndiceOrcamento < oJSON.orcamentos.Length; IndiceOrcamento++) { if (oJSON.orcamentos[IndiceOrcamento].PK_cod_orcamento == oOrcamento.PK_cod_orcamento) { oJSON.orcamentos[IndiceOrcamento] = oOrcamento; } } } } //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; case "Salvar_Comentario_Interno": //******************************** //* Atualiza dados da etapa final //******************************** SalvaComentarioInterno(oJSON); //************************* //* Devolve estrutura JSON //************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; } } }
protected void OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { e.Result = string.Format("{0};{1};{2}", spnLeft.Number, spnTop.Number, txtContentText.Text); }
protected void clbCancel_Callback(object source, DevExpress.Web.CallbackEventArgs e) { isCancelRequired = true; }
protected void cpLoadingShow_Callback(object source, DevExpress.Web.CallbackEventArgs e) { System.Threading.Thread.Sleep(200); }
protected void clbAtualizar_Callback(object source, DevExpress.Web.CallbackEventArgs e) { //********************************** //* É uma chamada de inicializãção? //********************************** if (e.Parameter == string.Empty) { //************** //* Declarações //************** Int32 CodigoUsuario = 0; //*************************** //* Edição ou novo registro? //*************************** if (Request.QueryString["codigo"] == null) { CodigoUsuario = 0; } else { CodigoUsuario = Convert.ToInt32(Request.QueryString["codigo"]); } //****************************** //* Popula dados no objeto JSON //****************************** if (CodigoUsuario != 0) { PopulaJSON(CodigoUsuario); } //******************************* //* Devolve estrutura JSON vazia //******************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); } else { //************************* //* Deserializa requisição //************************* JavaScriptSerializer oSerializer = new JavaScriptSerializer(); oJSON = oSerializer.Deserialize <Login_Fields>(e.Parameter); //**************************** //* Localiza container NAVBAR //**************************** switch (oJSON.Parametros["Operacao"]) { case "Validar_Usuario": //************************************* //* Coleta código da nova oportunidade //************************************* oJSON = Validar_Usuario(oJSON); //******************************* //* Devolve estrutura JSON vazia //******************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; case "Salvar_Registro": //************************************* //* Coleta código da nova oportunidade //************************************* oJSON = Salvar_Registro(oJSON); //******************************* //* Devolve estrutura JSON vazia //******************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; case "Teste_SMTP": //************************************* //* Coleta código da nova oportunidade //************************************* oJSON = Salvar_Registro(oJSON); //************************************* //* Coleta código da nova oportunidade //************************************* oJSON = Teste_SMTP(oJSON); //******************************* //* Devolve estrutura JSON vazia //******************************* e.Result = new JavaScriptSerializer().Serialize(oJSON); break; } } }
protected virtual void HandleCallback(object source, DevExpress.Web.CallbackEventArgs e) { if (OnCallback != null) { OnCallback(source, e); } String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "Show": if (Helper != null) { var view = Helper.CreateListView(Helper.ObjectSpace.GetObject(Editor.CurrentObject)); var SVP = new ShowViewParameters(view); SVP.TargetWindow = TargetWindow.NewModalWindow; DialogController dc = Helper.Application.CreateController <DialogController>(); dc.Accepting += new EventHandler <DialogControllerAcceptingEventArgs>(delegate(object sender, DialogControllerAcceptingEventArgs ev) { var os = (Editor as XafBootstrapLookupPropertyEditor).ObjectSpace; foreach (var item in view.SelectedObjects) { var newVal = os.GetObject(item); Editor.PropertyValue = (newVal == null ? item : newVal); } if (OnOk != null) { OnOk(this, EventArgs.Empty); } }); dc.Cancelling += new EventHandler(delegate { if (OnCancel != null) { OnCancel(this, EventArgs.Empty); } }); SVP.Controllers.Add(dc); Helper.Application.ShowViewStrategy.ShowView(SVP, new ShowViewSource(null, null)); } break; case "Link": if (Value != null) { DetailView detailView = Helper.Application.CreateDetailView(Helper.ObjectSpace, Helper.ObjectSpace.GetObject(Value)); var dSVP = new ShowViewParameters(detailView); dSVP.TargetWindow = TargetWindow.NewModalWindow; DialogController dc = Helper.Application.CreateController <DialogController>(); dc.CancelAction.Active["Visible"] = false; dSVP.Controllers.Add(dc); Helper.Application.ShowViewStrategy.ShowView(dSVP, new ShowViewSource(null, null)); } break; } } RegisterOnClickScript(); }
void Handler_OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { HandleCallback(source, e); }