public ActionResult Edit(ServiceLevel model) { return(formSubmit(model, "Edit")); }
private void BindSettings() { try { // get settings OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); litDisplayName.Text = PortalAntiXSS.Encode(user.DisplayName); lblUserDomainName.Text = user.DomainUserName; // bind form lblDisplayName.Text = user.DisplayName; chkDisable.Checked = user.Disabled; lblFirstName.Text = user.FirstName; lblInitials.Text = user.Initials; lblLastName.Text = user.LastName; lblJobTitle.Text = user.JobTitle; lblCompany.Text = user.Company; lblDepartment.Text = user.Department; lblOffice.Text = user.Office; if (user.Manager != null) { lblManager.Text = user.Manager.DisplayName; } lblBusinessPhone.Text = user.BusinessPhone; lblFax.Text = user.Fax; lblHomePhone.Text = user.HomePhone; lblMobilePhone.Text = user.MobilePhone; lblPager.Text = user.Pager; lblWebPage.Text = user.WebPage; lblAddress.Text = user.Address; lblCity.Text = user.City; lblState.Text = user.State; lblZip.Text = user.Zip; lblCountry.Text = user.Country; lblNotes.Text = user.Notes; lblExternalEmailAddress.Text = user.ExternalEmail; lblExternalEmailAddress.Enabled = user.AccountType == ExchangeAccountType.User; lblUserDomainName.Text = user.DomainUserName; lblSubscriberNumber.Text = user.SubscriberNumber; lblUserPrincipalName.Text = user.UserPrincipalName; PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) { locSubscriberNumber.Visible = false; lblSubscriberNumber.Visible = false; } } if (user.LevelId > 0 && secServiceLevels.Visible) { secServiceLevels.IsCollapsed = false; ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); litServiceLevel.Visible = true; litServiceLevel.Text = serviceLevel.LevelName; litServiceLevel.ToolTip = serviceLevel.LevelDescription; lblServiceLevel.Text = serviceLevel.LevelName; } chkVIP.Checked = user.IsVIP && secServiceLevels.Visible; imgVipUser.Visible = user.IsVIP && secServiceLevels.Visible; if (cntx.Quotas.ContainsKey(Quotas.ORGANIZATION_ALLOWCHANGEUPN)) { if (cntx.Quotas[Quotas.ORGANIZATION_ALLOWCHANGEUPN].QuotaAllocatedValue != 1) { chkInherit.Visible = false; } else { chkInherit.Visible = true; } } if (user.Locked) { chkLocked.Enabled = true; } else { chkLocked.Enabled = false; } chkLocked.Checked = user.Locked; } catch (Exception ex) { messageBox.ShowErrorMessage("ORGANIZATION_GET_USER_SETTINGS", ex); } }
public ActionResult Create(ServiceLevel model) { return(formSubmit(model, "Create")); }
/// <summary> /// Send a service level (LEVE) command asynchronously. /// <para>If this command is not issued the default service level is "Normal".</para> /// </summary> /// <param name="serviceLevel">The service level.</param> /// <returns>The response.</returns> public async Task<SnppResponse> LevelAsync(ServiceLevel serviceLevel) { return await SendAsync(String.Format(CultureInfo.InvariantCulture, "LEVE {0}", (int)serviceLevel)); }
/// <summary> /// Send a service level (LEVE) command. /// <para>If this command is not issued the default service level is "Normal".</para> /// </summary> /// <param name="serviceLevel">The service level.</param> /// <returns>The response.</returns> public SnppResponse Level(ServiceLevel serviceLevel) { return Send(String.Format(CultureInfo.InvariantCulture, "LEVE {0}", (int)serviceLevel)); }
private void SaveSettings() { if (!Page.IsValid) { return; } try { int result = ES.Services.Organizations.SetUserGeneralSettings( PanelRequest.ItemID, PanelRequest.AccountID, txtDisplayName.Text, string.Empty, false, chkDisable.Checked, chkLocked.Checked, txtFirstName.Text, txtInitials.Text, txtLastName.Text, txtAddress.Text, txtCity.Text, txtState.Text, txtZip.Text, country.Country, txtJobTitle.Text, txtCompany.Text, txtDepartment.Text, txtOffice.Text, manager.GetAccount(), txtBusinessPhone.Text, txtFax.Text, txtHomePhone.Text, txtMobilePhone.Text, txtPager.Text, txtWebPage.Text, txtNotes.Text, txtExternalEmailAddress.Text, txtSubscriberNumber.Text, string.IsNullOrEmpty(ddlServiceLevels.SelectedValue) ? 0 : int.Parse(ddlServiceLevels.SelectedValue), chkVIP.Checked, chkUserMustChangePassword.Checked); if (result < 0) { messageBox.ShowResultMessage(result); return; } // update title litDisplayName.Text = txtDisplayName.Text; if (!chkLocked.Checked) { chkLocked.Enabled = false; } litServiceLevel.Visible = !string.IsNullOrEmpty(ddlServiceLevels.SelectedValue) && secServiceLevels.Visible; if (litServiceLevel.Visible) { ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(int.Parse(ddlServiceLevels.SelectedValue)); litServiceLevel.Text = serviceLevel.LevelName; litServiceLevel.ToolTip = serviceLevel.LevelDescription; } imgVipUser.Visible = chkVIP.Checked && secServiceLevels.Visible; messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_USER_SETTINGS"); } catch (Exception ex) { messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_USER_SETTINGS", ex); } }
private void BindSettings() { try { BindPasswordSettings(); // get settings OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); litDisplayName.Text = PortalAntiXSS.Encode(user.DisplayName); lblUserDomainName.Text = user.DomainUserName; // bind form txtDisplayName.Text = user.DisplayName; chkDisable.Checked = user.Disabled; txtFirstName.Text = user.FirstName; txtInitials.Text = user.Initials; txtLastName.Text = user.LastName; txtJobTitle.Text = user.JobTitle; txtCompany.Text = user.Company; txtDepartment.Text = user.Department; txtOffice.Text = user.Office; manager.SetAccount(user.Manager); txtBusinessPhone.Text = user.BusinessPhone; txtFax.Text = user.Fax; txtHomePhone.Text = user.HomePhone; txtMobilePhone.Text = user.MobilePhone; txtPager.Text = user.Pager; txtWebPage.Text = user.WebPage; txtAddress.Text = user.Address; txtCity.Text = user.City; txtState.Text = user.State; txtZip.Text = user.Zip; country.Country = user.Country; txtNotes.Text = user.Notes; txtExternalEmailAddress.Text = user.ExternalEmail; txtExternalEmailAddress.Enabled = user.AccountType == ExchangeAccountType.User; lblUserDomainName.Text = user.DomainUserName; txtSubscriberNumber.Text = user.SubscriberNumber; lblUserPrincipalName.Text = user.UserPrincipalName; PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) { locSubscriberNumber.Visible = false; txtSubscriberNumber.Visible = false; } } if (user.LevelId > 0 && secServiceLevels.Visible) { secServiceLevels.IsCollapsed = false; ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId); litServiceLevel.Visible = true; litServiceLevel.Text = serviceLevel.LevelName; litServiceLevel.ToolTip = serviceLevel.LevelDescription; bool addLevel = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) == null; addLevel = addLevel && cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName); addLevel = addLevel ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue != 0 : addLevel; if (addLevel) { ddlServiceLevels.Items.Add(new ListItem(serviceLevel.LevelName, serviceLevel.LevelId.ToString())); } bool levelInDDL = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) != null; if (levelInDDL) { ddlServiceLevels.Items.FindByValue(string.Empty).Selected = false; ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()).Selected = true; } } chkVIP.Checked = user.IsVIP && secServiceLevels.Visible; imgVipUser.Visible = user.IsVIP && secServiceLevels.Visible; if (cntx.Quotas.ContainsKey(Quotas.ORGANIZATION_ALLOWCHANGEUPN)) { if (cntx.Quotas[Quotas.ORGANIZATION_ALLOWCHANGEUPN].QuotaAllocatedValue != 1) { lblUserPrincipalName.Visible = true; upn.Visible = false; ddlEmailAddresses.Visible = false; btnSetUserPrincipalName.Visible = false; chkInherit.Visible = false; } else { lblUserPrincipalName.Visible = false; upn.Visible = false; ddlEmailAddresses.Visible = false; btnSetUserPrincipalName.Visible = true; chkInherit.Visible = true; if (user.AccountType == ExchangeAccountType.Mailbox) { ddlEmailAddresses.Visible = true; WebsitePanel.EnterpriseServer.ExchangeEmailAddress[] emails = ES.Services.ExchangeServer.GetMailboxEmailAddresses(PanelRequest.ItemID, PanelRequest.AccountID); foreach (WebsitePanel.EnterpriseServer.ExchangeEmailAddress mail in emails) { ListItem li = new ListItem(); li.Text = mail.EmailAddress; li.Value = mail.EmailAddress; li.Selected = mail.IsPrimary; ddlEmailAddresses.Items.Add(li); } foreach (ListItem li in ddlEmailAddresses.Items) { if (li.Value == user.UserPrincipalName) { ddlEmailAddresses.ClearSelection(); li.Selected = true; break; } } } else { upn.Visible = true; if (!string.IsNullOrEmpty(user.UserPrincipalName)) { string[] Tmp = user.UserPrincipalName.Split('@'); upn.AccountName = Tmp[0]; if (Tmp.Length > 1) { upn.DomainName = Tmp[1]; } } } } } if (user.Locked) { chkLocked.Enabled = true; } else { chkLocked.Enabled = false; } chkLocked.Checked = user.Locked; password.ValidationEnabled = true; password.Password = string.Empty; var settings = ES.Services.Organizations.GetWebDavSystemSettings(); btnResetUserPassword.Visible = settings != null && Utils.ParseBool(settings[EnterpriseServer.SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY], false); chkUserMustChangePassword.Checked = user.UserMustChangePassword; } catch (Exception ex) { messageBox.ShowErrorMessage("ORGANIZATION_GET_USER_SETTINGS", ex); } }
public void StartServiceDialog(IntPtr windowHandle, ServiceLevel serviceLevel) { throw new NotImplementedException(); }
public void Init() { instance = new ServiceLevel(); }
/// <summary> /// Send a service level (LEVE) command. /// <para>If this command is not issued the default service level is "Normal".</para> /// </summary> /// <param name="serviceLevel">The service level.</param> /// <returns>The response.</returns> public SnppResponse Level(ServiceLevel serviceLevel) { return(Send(String.Format(CultureInfo.InvariantCulture, "LEVE {0}", (int)serviceLevel))); }
/// <summary> /// Send a service level (LEVE) command asynchronously. /// <para>If this command is not issued the default service level is "Normal".</para> /// </summary> /// <param name="serviceLevel">The service level.</param> /// <returns>The response.</returns> public async Task <SnppResponse> LevelAsync(ServiceLevel serviceLevel) { return(await SendAsync(String.Format(CultureInfo.InvariantCulture, "LEVE {0}", (int)serviceLevel))); }
public KeyValuePair <int, String> ServiceLevel_Update(ServiceLevel model) { var param = new SqlParameter[] { new SqlParameter("@ServiceLevelID", SqlDbType.UniqueIdentifier) { Value = model.ServiceLevelID }, new SqlParameter("@ModifiedBy", SqlDbType.UniqueIdentifier) { Value = model.ModifiedBy }, new SqlParameter("@CategoryID", SqlDbType.UniqueIdentifier) { Value = model.CategoryID }, new SqlParameter("@CategoryIDName", SqlDbType.NVarChar, 100) { Value = model.CategoryIDName }, new SqlParameter("@ProductID", SqlDbType.UniqueIdentifier) { Value = model.ProductID }, new SqlParameter("@ProductIDName", SqlDbType.NVarChar, 100) { Value = model.ProductIDName }, new SqlParameter("@SLADays", SqlDbType.Int) { Value = model.SLADays }, new SqlParameter("@WorkgroupID", SqlDbType.UniqueIdentifier) { Value = model.WorkgroupID }, new SqlParameter("@KotaID", SqlDbType.UniqueIdentifier) { Value = CheckForDbNull(model.KotaID) }, new SqlParameter("@ParentID", SqlDbType.UniqueIdentifier) { Value = CheckForDbNull(model.ParentID) }, new SqlParameter("@SegmentationID", SqlDbType.UniqueIdentifier) { Value = CheckForDbNull(model.SegmentationID) }, new SqlParameter("@RetVal", SqlDbType.Int) { Direction = ParameterDirection.Output }, new SqlParameter("@Message", SqlDbType.NVarChar, 100) { Direction = ParameterDirection.Output } }; int rc = ((IObjectContextAdapter)this).ObjectContext.ExecuteStoreCommand("exec [CRM].[ServiceLevel_Update] @ServiceLevelID, @ModifiedBy, @CategoryID, @CategoryIDName, @ProductID, @ProductIDName, @SLADays, @WorkgroupID, @KotaID, @ParentID, @SegmentationID, @RetVal out, @Message out", param); int retVal = (int)param[11].Value; string valueRes = param[12].Value.ToString(); return(new KeyValuePair <int, string>(retVal, valueRes)); }
public void ServiceLevelDetail(DateTime start_dt, DateTime end_dt, string queues, string agents) { MySqlConnection con = GetConnection(); MySqlCommand com = new MySqlCommand(String.Format(@"SELECT qs.datetime AS datetime, q.queue AS qname, ag.agent AS qagent, ac.event AS qevent, qs.info1 AS info1, qs.info2 AS info2, qs.info3 AS info3 FROM queue_stats AS qs, qname AS q, qagent AS ag, qevent AS ac WHERE qs.qname = q.qname_id AND qs.qagent = ag.agent_id AND qs.qevent = ac.event_id AND qs.datetime >= '{0}' AND qs.datetime <= '{1}' AND q.queue IN ({2}) AND ag.agent in ({3}) AND ac.event IN ('COMPLETECALLER', 'COMPLETEAGENT','TRANSFER','CONNECT') ORDER BY qs.datetime", start_dt.ToString("yyyy-MM-dd HH:mm:ss"), end_dt.ToString("yyyy-MM-dd HH:mm:ss"), queues, agents), con); MySqlDataReader rdr = com.ExecuteReader(); if (rdr.HasRows) foreach (DbDataRecord record in rdr) { if (record["qevent"].ToString() == "CONNECT") { DateTime dt = Convert.ToDateTime(record["datetime"]); DateTime sdt = Convert.ToDateTime(dt.ToShortDateString()); bool fpoh = false; if (dt.Minute < 30) fpoh = true; ServiceLevel sl = SLPHH.Find(p => p.dt == sdt && p.hour == dt.Hour && p.fpoh == fpoh); ServiceLevel sld = SLPD.Find(p => p.dt == sdt); ServiceLevel slm = SLPM.Find(p => p.dt.Month == sdt.Month); if (sl == null) { sl = new ServiceLevel(); sl.dt = sdt; sl.hour = dt.Hour; sl.fpoh = fpoh; SLPHH.Add(sl); } if (sld == null) { sld = new ServiceLevel(); sld.dt = sdt; sld.hour = dt.Hour; sld.fpoh = fpoh; SLPD.Add(sld); } if (slm == null) { slm = new ServiceLevel(); slm.dt = sdt; slm.hour = dt.Hour; slm.fpoh = fpoh; SLPM.Add(slm); } if (Convert.ToInt32(record["info1"]) >= 0 && Convert.ToInt32(record["info1"]) <= 10) { sl.Sec10++; sld.Sec10++; slm.Sec10++; } if (Convert.ToInt32(record["info1"]) > 10) { sl.Sec20++; sl.Sec30++; sl.Sec40++; sl.Sec50++; sl.Sec60++; sl.Sec70++; sl.Sec80++; sl.Sec90++; sl.SecOver90++; sld.Sec20++; sld.Sec30++; sld.Sec40++; sld.Sec50++; sld.Sec60++; sld.Sec70++; sld.Sec80++; sld.Sec90++; sld.SecOver90++; slm.Sec20++; slm.Sec30++; slm.Sec40++; slm.Sec50++; slm.Sec60++; slm.Sec70++; slm.Sec80++; slm.Sec90++; slm.SecOver90++; } } } rdr.Close(); con.Close(); }
public ServiceLevelDTO Map(ServiceLevel entity) { var dto = LoadEntityData(entity); return(dto); }