public static bool ModificaDelega(DocsPaWR.InfoDelega delega, string tipoDelega, string idRuoloOld, string idUtenteOld, string dataScadenzaOld, string dataDecorrenzaOld, string idRuoloDeleganteOld) { bool retValue = false; DocsPaWR.InfoUtente infoUtente = UserManager.GetInfoUser(); retValue = docsPaWS.DelegaModifica(infoUtente, delega, tipoDelega, idRuoloOld, idUtenteOld, dataScadenzaOld, dataDecorrenzaOld, idRuoloDeleganteOld); return(retValue); }
public static bool CreaNuovaDelega(DocsPaWR.InfoDelega delega) { bool retValue = false; DocsPaWR.InfoUtente infoUtente = UserManager.GetInfoUser(); retValue = docsPaWS.DelegaCreaNuova(infoUtente, delega); return(retValue); }
public static bool VerificaUnicaDelega(DocsPaWR.InfoDelega delega) { bool retValue = false; DocsPaWR.InfoUtente infoUtente = UserManager.GetInfoUser(); retValue = docsPaWS.DelegaVerificaUnicaAssegnata(infoUtente, delega); return(retValue); }
private void ReadRetValueFromPopup() { if (!string.IsNullOrEmpty(this.proceed_delete.Value)) { //Crea la lista delle deleghe da revocare, dopo averle revocate si ricarica //l'elenco delle deleghe assegnate ArrayList listaDeleghe = new ArrayList(); for (int i = 0; i < this.gridViewResult.Rows.Count; i++) { CheckBox chkSelection = this.gridViewResult.Rows[i].Cells[0].FindControl("cbSel") as CheckBox; if (chkSelection != null && chkSelection.Checked) { DocsPaWR.InfoDelega delega = (DocsPaWR.InfoDelega) this.ListaDeleghe[i]; listaDeleghe.Add(delega); } } string msg = string.Empty; if (DelegheManager.RevocaDelega(this, (DocsPaWR.InfoDelega[])listaDeleghe.ToArray(typeof(DocsPaWR.InfoDelega)), out msg)) { this.fillDeleghe("assegnate", this.MandateDdlState.SelectedValue); } else { string messaggio = string.Empty; if (string.IsNullOrEmpty(msg)) { messaggio = "ErrorMandateBtnDelete"; } else { messaggio = "ErrorCustom"; } this.disabilitaCheckDataGrid(); ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "ajaxDialogModal('" + messaggio + "', 'error', '', '" + utils.FormatJs(msg) + "');", true); return; } this.proceed_delete.Value = string.Empty; this.UpPnlButtons.Update(); } if (!string.IsNullOrEmpty(this.NewMandate.ReturnValue)) { this.fillDeleghe("assegnate", this.MandateDdlState.SelectedValue); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setReturnValue", "SetRetValue('NewMandate','');", true); } if (!string.IsNullOrEmpty(this.EditMandate.ReturnValue)) { this.fillDeleghe("assegnate", this.MandateDdlState.SelectedValue); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setReturnValue", "SetRetValue('EditMandate','');", true); } }
private void ReadRetValueFromPopup() { if (!string.IsNullOrEmpty(this.proceed_permanent.Value)) { if (this.DelegaSel == null) { DocsPaWR.InfoDelega delega = (DocsPaWR.InfoDelega)(ViewState["delega"]); if (DelegheManager.CreaNuovaDelega(delega)) { this.CloseMask(true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "ajaxDialogModal('ErrorMandateInserting', 'error', '');", true); this.proceed_permanent.Value = string.Empty; this.UpPnlButtons.Update(); } } else { this.Modifica(); } } }
/// <summary> /// Creazione di una nuova delega /// </summary> private void CreaDelega() { DocsPaWR.InfoDelega delega = new DocsPaWR.InfoDelega(); if (this.MandateDdlRole.Items.Count > 1 && this.MandateDdlRole.SelectedIndex == 0) { delega.id_ruolo_delegante = "0"; delega.cod_ruolo_delegante = "TUTTI"; } else { string[] valoriRuolo = this.MandateDdlRole.SelectedValue.ToString().Split('_'); delega.id_ruolo_delegante = valoriRuolo[0]; delega.cod_ruolo_delegante = this.MandateDdlRole.SelectedItem.Text; } delega.id_utente_delegante = UserManager.GetInfoUser().idPeople; DocsPaWR.Corrispondente corr = new DocsPaWR.Corrispondente(); DocsPaWR.Ruolo ruolo = RoleManager.getRuoloByIdGruppo(RoleManager.getRuoloById(this.DdlMandateUserRole.SelectedValue).idGruppo); corr = UserManager.getCorrispondenteByIdPeople(this, UserManager.GetInfoUser().idPeople, DocsPaWR.AddressbookTipoUtente.INTERNO); delega.cod_utente_delegante = corr.codiceRubrica; delega.id_ruolo_delegato = ruolo.systemId; delega.id_uo_delegato = ruolo.uo.systemId; delega.cod_ruolo_delegato = ruolo.codiceRubrica; delega.id_utente_delegato = this.idPeople.Value; delega.cod_utente_delegato = this.txtCodiceProprietario.Text; string ora; if (this.ddlHourFrom.SelectedIndex == 0) { ora = System.DateTime.Now.Hour.ToString(); } else { ora = this.ddlHourFrom.SelectedValue; } if (ora.Length == 1) { ora = "0" + this.ddlHourFrom.SelectedValue; } if (Convert.ToDateTime(this.txtDateFrom.Text).Date.ToShortDateString().Equals(DateTime.Now.ToShortDateString()) && ora.Equals(DateTime.Now.Hour.ToString())) { delega.dataDecorrenza = Convert.ToDateTime(this.txtDateFrom.Text).Date.ToShortDateString() + " " + ora + "." + (DateTime.Now.Minute).ToString() + ".00"; } else { delega.dataDecorrenza = Convert.ToDateTime(this.txtDateFrom.Text).Date.ToShortDateString() + " " + ora + ".00.00"; } if (this.ddlHourTo.SelectedIndex == 0) { ora = System.DateTime.Now.Hour.ToString(); } else { ora = this.ddlHourTo.SelectedValue; } if (ora.Length == 1) { ora = "0" + this.ddlHourTo.SelectedValue; } if (!string.IsNullOrEmpty(this.txtDateTo.Text)) { delega.dataScadenza = Convert.ToDateTime(this.txtDateTo.Text).Date.ToShortDateString() + " " + ora + ".00.00"; } else { delega.dataScadenza = string.Empty; } if (System.Globalization.DateTimeFormatInfo.CurrentInfo.TimeSeparator.Contains(":")) { delega.dataDecorrenza = delega.dataDecorrenza.Replace('.', ':'); delega.dataScadenza = delega.dataScadenza.Replace('.', ':'); } //Verifica che non sia stata già creata una delega nello stesso periodo (univocità dell'assegnazione di responsabilità) if (DelegheManager.VerificaUnicaDelega(delega)) { if (string.IsNullOrEmpty(this.txtDateTo.Text)) { ViewState.Add("delega", delega); ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxConfirmModal", "ajaxConfirmModal('ConfirmMandatePermanent', 'proceed_permanent', '');", true); return; } else { if (DelegheManager.CreaNuovaDelega(delega)) { this.CloseMask(true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "ajaxDialogModal('ErrorMandateInserting', 'error', '');", true); return; } } } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "ajaxDialogModal('ErrorMandateOverlappingPeriods', 'warning', '');", true); return; } }