SafeDispatch/SubscriberAndUserManager/PopupForm.cs

54 lines
1.7 KiB
C#
Raw Permalink Normal View History

2024-02-22 16:43:59 +00:00
using SafeMobileLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SubscriberAndUserManager
{
public partial class PopupForm : Telerik.WinControls.UI.RadForm
{
public DBuserManager db4users;
public PopupForm(string user, Int32 GeoCount, Int32 LandCount)
{
InitializeComponent();
this.ControlBox = false;
db4users = new DBuserManager(MainForm.DBServer, MainForm.DBSchema, MainForm.DBUser, MainForm.DBPass, MainForm.DBPort);
List<string> usrList = db4users.getAllUsersNames();
foreach (string userName in usrList)
{
if (userName != user)
radDropDownList1.Items.Add(userName);
}
radDropDownList1.Text = radDropDownList1.Items.FirstOrDefault().ToString();
labelChooseDisp.Text = String.Format(MainForm.returnLNGString("chooseDisp"), GeoCount, LandCount);
}
private void radCheckedDropDownList1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
btOK.PerformClick();
}
private void btOK_Click(object sender, EventArgs e)
{
Name = radDropDownList1.Text;
this.DialogResult = System.Windows.Forms.DialogResult.OK;
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
Name = null;
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
Close();
}
}
}