public int DoInsert(Regist rg) { int result = 0; string connectStr = string.Format("Server={0};Database={1};Uid={2};Pwd={3};", DaoStr.server, DaoStr.db, DaoStr.user, DaoStr.pass); string tbl = "regist_user"; try { MySqlConnection connect = new MySqlConnection(connectStr); MySqlCommand command = new MySqlCommand("insert into " + tbl + " (name,gender,birth,birth_kj,tell,mail,create_date,update_date) values (@name,@gender,@birth,@birth_kj,@tell,@mail,@create_date,@update_date)", connect); command.Parameters.Add(new MySqlParameter("name", rg.Name)); command.Parameters.Add(new MySqlParameter("gender", rg.Gender)); command.Parameters.Add(new MySqlParameter("birth", rg.Birth)); command.Parameters.Add(new MySqlParameter("birth_kj", rg.Birth_kj)); command.Parameters.Add(new MySqlParameter("tell", rg.Tell)); command.Parameters.Add(new MySqlParameter("mail", rg.Mail)); command.Parameters.Add(new MySqlParameter("create_date", rg.CreateDate)); command.Parameters.Add(new MySqlParameter("update_date", rg.UpdateDate)); command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); } catch (Exception e) { result = 1; Console.WriteLine("error:" + e.Message); } return(result); }
private async void Regist() { this.IsBusy = true; var mth = new Regist() { Info = new RegistInfo() { Phone = this.Phone, Pwd = this.Pwd, ConfirmPwd = this.ConfirmPwd, Code = this.Code, DeviceID = this.DeviceID } }; await Task.Delay(5000); var result = await ApiClient.ApiClient.Instance.Value.Execute(mth); if (!mth.HasError) { await App.Current.MainPage.DisplayAlert("消息", result.Msg, "OK"); if (result.IsSuccess) { await this.NS.GoBackAsync(); } } this.IsBusy = false; }
public async Task <IActionResult> SendAsyncRegister(Regist regist) { // Call asynchronous network methods in a try/catch block to handle exceptions. var json = JsonSerializer.Serialize(regist); var DataToSever = new StringContent(json, Encoding.UTF8, "application/json"); var url = "http://localhost:8080/BusinessLogicProofOfConcept_war_exploded/api/account/login/"; var response = await client.PostAsync(url, DataToSever); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); var ResultFromServer = JsonSerializer.Deserialize <Boolean>(responseBody); Console.WriteLine(ResultFromServer + "################"); if (ResultFromServer) { Console.WriteLine("I came here"); return(RedirectToPage("./Popup")); } return(RedirectToPage("./homepage")); }
public IActionResult DoRegist() { Dictionary <string, string> errList = new Dictionary <string, string>(); InputData id = new InputData(Request); string view = ""; if (id.DoCheckInput(errList) == 0) { if (id.DoCheckDetailsOfDate(errList) == 0) { Regist rg = new Regist(); RegistData rd = new RegistData(); int flg = 1; rd.DoRegistData(id, rg, flg); ConvertObjToArray <Regist> cvtota = new ConvertObjToArray <Regist>(); HttpContext.Session.Set("regist", cvtota.DoConvert(rg)); ViewData["regist"] = rg; view = "Confirm"; } else { view = "Index"; } } else { view = "Index"; } ViewData["errlist"] = errList; return(View(view)); }
/// <summary> /// 类型:方法 /// 名称:OnOperationRequest /// 作者:taixihuase /// 作用:响应并处理客户端发来的请求 /// 编写日期:2015/7/14 /// </summary> /// <param name="operationRequest"></param> /// <param name="sendParameters"></param> protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters) { switch (operationRequest.OperationCode) { // 账号注册 case (byte)OperationCode.Regist: Regist.OnRequest(operationRequest, sendParameters, this); break; // 账号登陆 case (byte)OperationCode.Login: Login.OnRequest(operationRequest, sendParameters, this); break; // 创建新角色 case (byte)OperationCode.CreateCharacter: CreateCharacter.OnRequest(operationRequest, sendParameters, this); break; // 角色进入场景 case (byte)OperationCode.WorldEnter: WorldEnter.OnRequest(operationRequest, sendParameters, this); break; } }
private void saveButton_Click(object sender, EventArgs e) { try { regist = new Regist(); regist.Date = dateTimePicker1.Value; regist.Description = richTextBox1.Text; regist.Code = textBox3.Text; SampleGenericDelegate <Regist, int> del = new SampleGenericDelegate <Regist, int>(serverClient.InsertRegist); IAsyncResult result = del.BeginInvoke(regist, null, null); regist.Id = del.EndInvoke(result); SarcIntelService.PersonView.PersonEditor person = new SarcIntelService.PersonView.PersonEditor(serverClient, regist); person.ShowDialog(this); person.Close(); } catch (Exception exc) { var info = new InfoForm(); info.Add(exc.Message); info.ShowDialog(this); info.Dispose(); } }
public void DoRegistData(InputData id, Regist rd, int flg) { rd.Name = id.Name; rd.Gender = int.Parse(id.Gender); ChangeDate cd = new ChangeDate(); cd.DoChange(id); rd.Birth = cd.ParseDate; rd.Birth_kj = cd.JpCalender; rd.Tell = id.Tell; rd.Mail = id.Mail; if (flg == 1) { rd.CreateDate = DateTime.Today; rd.UpdateDate = default; } else { rd.CreateDate = default; rd.UpdateDate = DateTime.Today; } }
public string getConnStr(Model.Synergismlogdt dt) { DAL.Regist rdal = new Regist(); Model.Regist rmdoel = rdal.GetModel(dt.Accid); if (rmdoel != null) { return(string.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID=sa;Password={2};Current Language=Simplified Chinese", rmdoel.Caddress, rmdoel.Caccname, rmdoel.Cdbpwd)); } else { return(""); } }
public MainWindow() { InitializeComponent(); //ThemeManager.ApplicationThemeName = "MetropolisLight"; this.SizeChanged += new System.Windows.SizeChangedEventHandler(MainWindow_Resize); DocumentGroupTitleDic = new Dictionary <string, int>(); for (int a = 0; a < documentGroup.Items.Count; a++) { var document = documentGroup.Items[a]; DocumentGroupTitleDic.Add(document.Caption as string, a); } documentGroup.Items.CollectionChanged += DocumentGropChange; Regist regist = new Regist(); string zcm = regist.Fun(); if (zcm != null) { IsRegist = false; ///弹出注册窗口 ZhuCeMaPage zuCeMaPage = new ZhuCeMaPage(zcm); int index; string title = zuCeMaPage.Uid as string; if (DocumentGroupTitleDic.TryGetValue(title, out index)) { documentGroup.SelectedTabIndex = index; return; } index = documentGroup.GetChildrenCount(); DocumentGroupTitleDic.Add(title, index); DocumentPanel panel = new DocumentPanel(); panel.Caption = title; documentGroup.Add(panel); panel.Content = zuCeMaPage; documentGroup.SelectedTabIndex = index; } else { IsRegist = true; //ZJDDataSourcePage page = new ZJDDataSourcePage(); //AddDocument(page); mainWindow = this; } }
private void AddRegist(Regist r) { SampleGenericDelegate <int, CrimeType[]> del = new SampleGenericDelegate <int, CrimeType[]>(serverClient.GetAllCrimeTypeByRegist); IAsyncResult result = del.BeginInvoke(r.Id, null, null); var crimes = del.EndInvoke(result); DataGridViewComboBoxColumn comb = (DataGridViewComboBoxColumn)dataGridView2.Columns[1]; foreach (CrimeType c in crimes) { comb.Items.Add(c.Name); } dataGridView2.Rows.Add(new object[] { r.Id, crimes[0].Name, r.Date.ToShortDateString() }); }
void _RegCli_LoginCompleted(object sender, Regist.LoginCompletedEventArgs e) { IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication(); myIsolatedStorage.DeleteFile("settings.txt"); GlobalSettings.UserGuid = e.Result; if (GlobalSettings.IsUserRegistered()) { if (_Contacts != null) { _RegCli.PublishContactDetailsAsync(GetContactDetails()); } NavigationService.Navigate(new Uri("/MsgPage.xaml", UriKind.Relative)); } else { MessageBox.Show("Login invalid !"); } }
public Participants(ServerServiceClient serverClient,Regist regist) { InitializeComponent(); this.serverClient = serverClient; SampleGenericDelegate<int, Person[]> del = new SampleGenericDelegate<int, Person[]>(serverClient.GetAllPersonByIdRegist); IAsyncResult result= del.BeginInvoke(regist.Id, null, null); this.persons=del.EndInvoke(result); this.regist = regist; foreach (Person p in persons) dataGridView1.Rows.Add(new object[] { p.Nif, p.Name, p.Address, p.Birthday.ToShortDateString(), p.Birthplace, }); }
// // Insert a Regist // public int InsertRegist(Regist val) { try { using (var c = new Connect()) { c.BeginTrx(); var registMapper = new RegistDataMapper(c.GetConnection()); registMapper.SetTransaction(c.Transaction); int result = registMapper.Insert(val); c.Commit(); return(result); } } catch (Exception exception) { throw new FaultException <ServerError>(new ServerError()); } }
private void AddRegist(Regist r) { SampleGenericDelegate<int,CrimeType[]> del = new SampleGenericDelegate<int,CrimeType[]>(serverClient.GetAllCrimeTypeByRegist); IAsyncResult result = del.BeginInvoke(r.Id,null, null); CrimeType[] crimes = del.EndInvoke(result); DataGridViewComboBoxColumn comb = (DataGridViewComboBoxColumn)dataGridView1.Columns[1]; foreach (CrimeType c in crimes) comb.Items.Add(c.Name); SampleGenericDelegate<int, int> dele = new SampleGenericDelegate<int, int>(serverClient.GetNumberOfParticipants); IAsyncResult result2 = dele.BeginInvoke(r.Id, null, null); int count = dele.EndInvoke(result2); dataGridView1.Rows.Add(new object[] {r.Id,crimes[0].Name,r.Date.ToShortDateString(),count}); }
private void RegistButton_Click(object sender, RoutedEventArgs e) { Regist newUser = new Regist(); DataBase db = new DataBase(); const string codeForAdmin = "TakeThisManOnJob"; db.openConnect(); if (ForAdminField.Text == codeForAdmin) { MySqlCommand command = new MySqlCommand("INSERT INTO `users` (`ID`, `Login`, `Password`, `Root`) VALUES(NULL, @newLogin, @newPass, @root)", db.GetConnection()); command.Parameters.Add("@newLogin", MySqlDbType.VarChar).Value = NewLoginField.Text; command.Parameters.Add("@newPass", MySqlDbType.VarChar).Value = NewPasswordField.Text; command.Parameters.Add("@root", MySqlDbType.VarChar).Value = "admin"; if (command.ExecuteNonQuery() == 1) { MessageBox.Show("Поздравляем, вы успешно зарегистрировались!"); } else { MessageBox.Show("Аккаунт не был зарегистрирован.Прошу повоторите попытку"); } } else { MySqlCommand command = new MySqlCommand("INSERT INTO `users` (`ID`, `Login`, `Password`, `Root`) VALUES(NULL, @newLogin, @newPass, @root)", db.GetConnection()); command.Parameters.Add("@newLogin", MySqlDbType.VarChar).Value = NewLoginField.Text; command.Parameters.Add("@newPass", MySqlDbType.VarChar).Value = NewPasswordField.Text; command.Parameters.Add("@root", MySqlDbType.VarChar).Value = "user"; if (command.ExecuteNonQuery() == 1) { MessageBox.Show("Поздравляем, вы успешно зарегистрировались!"); } else { MessageBox.Show("Аккаунт не был зарегистрирован. Пожалуйста повоторите попытку"); } } db.closedConnect(); }
public IActionResult Index(int id) { ConvertArrayToObj <Regist> cato = new ConvertArrayToObj <Regist>(); byte[] array = HttpContext.Session.Get("regist"); Regist rg = cato.DoConvert(array); MsgClass mc = new MsgClass(); if (id == 1) { InsDao idao = new InsDao(); if (idao.DoInsert(rg) == 0) { mc.Msg = "new registration is done"; } } ViewData["msg"] = mc; return(View()); }
public Participants(ServerServiceClient serverClient, Regist regist) { InitializeComponent(); this.serverClient = serverClient; SampleGenericDelegate <int, Person[]> del = new SampleGenericDelegate <int, Person[]>(serverClient.GetAllPersonByIdRegist); IAsyncResult result = del.BeginInvoke(regist.Id, null, null); this.persons = del.EndInvoke(result); this.regist = regist; foreach (Person p in persons) { dataGridView1.Rows.Add(new object[] { p.Nif, p.Name, p.Address, p.Birthday.ToShortDateString(), p.Birthplace, }); } }
public PersonEditor(ServerServiceClient serverClient, Regist regist) { InitializeComponent(); this.serverClient = serverClient; photoDialog = new OpenFileDialog(); _regist = regist; p = new Person(); photoDialog.Filter = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif) | *.jpg; *.jpeg; *.jpe; *.jfif;"; //photoDialog.InitialDirectory = @"C:\"; photoDialog.Title = "Seleccione uma foto correspondente "; Closed += (sender, args) => { photoDialog.Dispose(); if (fileStream != null) { fileStream.Dispose(); } Dispose(true); }; }
private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { //quando ocorrer esse evento ir buscar todos os participantes ou pessoas associadas a esse ocorrencia if (e.RowIndex >= registos.Length) { return; } Regist regist = registos[e.RowIndex]; //registos.FirstOrDefault(r=> r.Id == (int) dataGridView1.Rows[e.RowIndex].Cells[0].Value); if (regist == null) { return; } var person_view = new Participants(serverClient, regist); person_view.Visible = true; }
public PersonEditor(ServerServiceClient serverClient,Regist regist) { InitializeComponent(); this.serverClient = serverClient; photoDialog = new OpenFileDialog(); _regist = regist; p = new Person(); photoDialog.Filter = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif) | *.jpg; *.jpeg; *.jpe; *.jfif;"; //photoDialog.InitialDirectory = @"C:\"; photoDialog.Title = "Seleccione uma foto correspondente "; Closed += (sender, args) => { photoDialog.Dispose(); if (fileStream != null) { fileStream.Dispose(); } Dispose(true); }; }
public Model.ConnectInfo getConnectStr(Model.Synergismlogdt dt) { DAL.Regist rdal = new Regist(); Model.Regist rmdoel = rdal.GetModel(dt.Accid); if (rmdoel != null) { Model.ConnectInfo cimodel = new Model.ConnectInfo(); cimodel.AccId = rmdoel.Cacc_id; cimodel.Source = rmdoel.Datasource; cimodel.Password = rmdoel.Cpassword; cimodel.Srv = rmdoel.Caddress; //应用服务器 add by wangdd cimodel.sSrv = rmdoel.Cservername; cimodel.SubId = "DP"; //测试 cimodel.UserId = rmdoel.Cuser_id; cimodel.YearId = rmdoel.Ibeginyear.ToString(); cimodel.Serial = BLL.Common.GetSerial(); cimodel.BEnable = rmdoel.Benable == "1" || rmdoel.Benable == "是"; cimodel.Constring = string.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID=sa;Password={2};Current Language=Simplified Chinese", rmdoel.Caddress, rmdoel.Caccname, rmdoel.Cdbpwd); return(cimodel); } return(null); }
private void AddRegist(Regist r) { SampleGenericDelegate <int, CrimeType[]> del = new SampleGenericDelegate <int, CrimeType[]>(serverClient.GetAllCrimeTypeByRegist); IAsyncResult result = del.BeginInvoke(r.Id, null, null); CrimeType[] crimes = del.EndInvoke(result); DataGridViewComboBoxColumn comb = (DataGridViewComboBoxColumn)dataGridView1.Columns[1]; foreach (CrimeType c in crimes) { comb.Items.Add(c.Name); } SampleGenericDelegate <int, int> dele = new SampleGenericDelegate <int, int>(serverClient.GetNumberOfParticipants); IAsyncResult result2 = dele.BeginInvoke(r.Id, null, null); int count = dele.EndInvoke(result2); dataGridView1.Rows.Add(new object[] { r.Id, crimes[0].Name, r.Date.ToShortDateString(), count }); }
private void Regist(object sender, RoutedEventArgs e) { ResponseMessage result = new ResponseMessage(); Regist user = new Regist(); user.username = RegUserName.Text.Trim(); user.password = RegPassword.Text.Trim(); user.number = RegNumber.Text.Trim(); user.truename = RegTrueName.Text.Trim(); user.id = RegID.Text.Trim(); result = service.Regist(user); if (result.code == "0") { loginUser.UserName = user.username; loginUser.UserType = 0; System.Windows.Forms.MessageBox.Show("注册成功,请等待管理员审核"); } else { System.Windows.Forms.MessageBox.Show("存在相同用户名,请更改用户名后重试"); } CloseReg(sender, e); }
static void Main(string[] args) { //Console.WriteLine(Calculate()); const string constring = @"Data source=localhost; initial catalog=Client; Integrated Security=True"; SqlConnection con = new SqlConnection(constring); Console.WriteLine(@" Если вы уже регистрированый в приложении введите 1: иначе чтобы регистрироваться введите 2: Если хотите войти в качестве Admina то выводите 3: "); string n = Console.ReadLine(); T22 : int t = 0; if (n == "1") { while (t != 1) { con.Open(); Console.WriteLine("Введите Login:"******"Введите Parol:"); string s1 = Console.ReadLine(); string selectParol = "Select * from Registraciya"; SqlCommand commandText1 = new SqlCommand(selectParol, con); SqlDataReader reader = commandText1.ExecuteReader(); while (reader.Read()) { if (Convert.ToString(reader.GetValue("login")) == s && Convert.ToString(reader.GetValue("Parol")) == s1) { t = 1; Console.WriteLine("Добро пожаловать в свой личный кабинет"); Console.WriteLine(@" выводите 1 чтобы подать заявку выводите 2 если хотите посмотреть свои заявки выводите 3 если хотите оплатить кредита выводите 4 если хотите видит свои графики выводите 5 если хотите погащать свой кредит выводите 6 если хотите посмотреть остаток кредита выводите 6"); con.Close(); string s3 = Console.ReadLine(); if (s3 == "1") { Zayavka(s); } if (s3 == "2") { ProsmotrZayavka(s); } if (s3 == "4") { string selectSrok = $"Select * from Zayavka where [серийный номер]='{s}'"; SqlCommand commandText3 = new SqlCommand(selectSrok, con); con.Open(); SqlDataReader reader3 = commandText3.ExecuteReader(); reader3.Read(); int a = Convert.ToInt32(reader3.GetValue("срок кредита")); con.Close(); reader3.Close(); string selectSum = $"Select * from Zayavka where [серийный номер]='{s}'"; SqlCommand commandText4 = new SqlCommand(selectSum, con); con.Open(); SqlDataReader reader4 = commandText4.ExecuteReader(); reader4.Read(); int b = Convert.ToInt32(reader4.GetValue("сумма кредита")); reader4.Close(); con.Close(); int c = b / a; Console.WriteLine($"В течении {a} месяцов вы должни каждый месяц погашать по {c} сомони"); string addkredit = $"insert into KREDIT12([каждый месяц сколько должни],[остаток кредита],[серыйный номер]) Values('{c}','{b}','{s}')"; SqlCommand commandText5 = new SqlCommand(addkredit, con); con.Open(); var result = commandText5.ExecuteNonQuery(); goto T45; } if (s3 == "5") { string selectSrok = $"Select * from KREDIT12 where [серыйный номер]='{s}'"; SqlCommand commandText3 = new SqlCommand(selectSrok, con); con.Open(); SqlDataReader reader3 = commandText3.ExecuteReader(); reader3.Read(); int a = Convert.ToInt32(reader3.GetValue("остаток кредита")); int b = Convert.ToInt32(reader3.GetValue("каждый месяц сколько должни")); int c = a - b; if (a - b <= 0) { Console.WriteLine("У вас больше нету остатков кредита"); } con.Close(); string updateSrok = $"update KREDIT12 set [остаток кредита]={c} WHERE [серыйный номер]='{s}'"; SqlCommand commandText5 = new SqlCommand(updateSrok, con); con.Open(); var result = commandText5.ExecuteNonQuery(); con.Close(); goto T89; } if (s3 == "6") { showspisok(s); goto T19; } } } if (t == 0) { Console.WriteLine("Вы неправильно ввели Parol или Login"); } con.Close(); } } T89: Console.WriteLine(455464654646); T45: T19: if (n == "2")///////// Здесь заполняем поля для регистрации { string[] s2 = new string[] { "Firstname:", "Lastname:", "Middlename:", "BirthDate:", "Date of issue:", "Date of expire:", "Document №:", "Addres:", "Marital status", "Pol", "login", "Parol" }; string[] S = new string[] {}; string s1 = ""; Array.Resize(ref S, 12); int t1 = 0, k = 0; for (int j = 0; j < 10; j++) { t1 = 0; while (t1 != 1) { Console.WriteLine($"Выводите {s2[j]}"); s1 = Console.ReadLine(); if (string.IsNullOrWhiteSpace(s1)) { Console.WriteLine("Этот поля не должно быть пустым"); } else { t1 = 1; S[j] = s1; } } } t1 = 0; while (t1 != 1) { con.Open(); string selectParol = "Select * from Registraciya"; SqlCommand commandText1 = new SqlCommand(selectParol, con); SqlDataReader reader = commandText1.ExecuteReader(); string n13 = ""; Console.WriteLine($"Выводите {s2[10]}"); n13 = Console.ReadLine(); k = 0; while (reader.Read()) { if (Convert.ToString(reader.GetValue("login")) == n13) { k = 1; } } if (k != 1) { S[10] = n13; t1 = 1; } else { Console.WriteLine("Такой Login уже существуеть"); } con.Close(); } Console.WriteLine($"Введите {s2[11]}"); S[11] = Console.ReadLine(); Regist Client = new Regist(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[8], S[9], S[10], S[11]); Client.addRegistr(); t = 0; /////////////////////////////////////////////////////////////////////////////////////////////////////////// Console.WriteLine("Для дальнейший регистрации нужно запольнить анкету нажмите любую клавишу"); Console.ReadKey(); string[] s8 = new string[] {};///////Массив для сохранения данных Анкет; string n12; Array.Resize(ref s8, 10); int i = 0; t = 0; s8[i] = S[10]; // con.Close(); i++; T20 : Console.WriteLine($"Выберите пол"); Console.WriteLine(@"выводите 1 если муж выводите 2 если жен"); n12 = Console.ReadLine(); switch (n12) { case "1": s8[i] = "муж"; break; case "": s8[i] = "жен"; break; default: { Console.WriteLine("Неверная команда повторите пожалуйста еще раз"); goto T20; } } i++; T10 : Console.WriteLine("Выберите Семейное положение"); Console.WriteLine(@"Выводите 1 если холост 2 если семянин 3 если вразвоед 4 если вдовец/вдова"); n12 = Console.ReadLine(); switch (n12) { case "1": { s8[i] = "холост"; break; } case "2": { s8[i] = "семеянин"; break; } case "3": { s8[i] = "вразводе"; break; } case "4": { s8[i] = "вдовец/вдова"; break; } default: { Console.WriteLine("Пожалуйста вывоводите правильно то что требуется "); goto T10; } } t = 0; i++; Console.WriteLine("Введите возраст"); s8[i] = Console.ReadLine(); T11 : Console.WriteLine(@"Введите 1 если вы Гражданин Таджикистана 2 если вы гражданин другого государство"); n12 = Console.ReadLine(); i++; switch (n12) { case "1": s8[i] = "Таджикистан"; break; case "2": s8[i] = "Таджикистан"; break; default: { Console.WriteLine("Пожалуйста введите правильно то что требуется"); goto T11; } } i++; int number; T : Console.WriteLine("Введите Сумма кредита от общего дохода в %"); string input = Console.ReadLine(); if (int.TryParse(input, out number)) { s8[i] = input; } else { goto T; } i++; T1 : Console.WriteLine("Выводите кредитную историю"); string input1 = Console.ReadLine(); if (int.TryParse(input1, out number)) { s8[i] = input1; } else { goto T1; } i++; T5 : Console.WriteLine("Выводите просрока в кредитной истории"); string input3 = Console.ReadLine(); if (int.TryParse(input3, out number)) { s8[i] = input1; } else { Console.WriteLine("Непрвильно ввели число"); goto T5; } i++; T2 : Console.WriteLine(@"Цель Кредита введите 1 если это бытовая техника 2 если это ремонт 3 если телефон 4 если прочее"); string n1 = Console.ReadLine(); switch (n1) { case "1": { s8[i] = "бытовая техника"; break; } case "2": { s8[i] = "ремонт"; break; } case "3": { s8[i] = " телефон"; break; } case "4": { s8[i] = "прочее"; break; } default: { Console.WriteLine("Не правилно ввели команду повторите еще раз"); goto T2; } } i++; T3 : Console.WriteLine("Введите срок кредита"); string input2 = Console.ReadLine(); if (int.TryParse(input1, out number)) { s8[i] = input2; } else { goto T3; } Anceta p1 = new Anceta(s8[0], s8[1], s8[2], s8[3], s8[4], s8[5], s8[6], s8[7], s8[8], s8[9]); t = 0; //Calculate(s8[0]); p1.addanceta(); if (Calculate() > 11) { Console.WriteLine("Чтобы подать заявку нужно войти вличный кабинет для этого надо нажать любую клавищу"); Console.ReadKey(); n = "1"; goto T22; } else { Console.WriteLine(Calculate()); Console.WriteLine("Извенити что мы не сможем вам заполнить заявку на кредите т.к ваш бали нехватает"); } } string s5 = "", s6 = ""; t = 0; if (n == "3") { T1 : Console.WriteLine("Введите Login:"******"Введите Parol:"); s6 = Console.ReadLine(); con.Open(); string selectParol = "Select * from Admin1"; SqlCommand commandText1 = new SqlCommand(selectParol, con); SqlDataReader reader = commandText1.ExecuteReader(); while (reader.Read()) { if (Convert.ToString(reader.GetValue("login")) == s5 && Convert.ToString(reader.GetValue("Parol")) == s6) { t = 1; Console.WriteLine("Добро пожаловать в личный кабинет Админа"); Console.WriteLine("Если хотите посмотреть заявок всех клиентов выводите 1"); Console.WriteLine("Если хотите добавить Админа введите 2"); n = Console.ReadLine(); //reader.Close(); con.Close(); if (n == "1") { ProsmotrZayavkaAdmin(); reader.Close(); con.Close(); } if (n == "2")///////////////////// { Console.WriteLine("Вводите Firstname"); string s1 = Console.ReadLine(); Console.WriteLine("Вводите Lastname"); string s2 = Console.ReadLine(); Console.WriteLine("Вводите Middlename"); string s3 = Console.ReadLine(); T9 : Console.WriteLine("Вводите Login"); string s4 = Console.ReadLine(); con.Open(); string SelectAdmin1 = $"select Login from Admin1"; SqlCommand commandText13 = new SqlCommand(SelectAdmin1, con); reader = commandText13.ExecuteReader(); while (reader.Read()) { if (Convert.ToString(reader.GetValue("Login")) == s4) { Console.WriteLine("Такой Login уже существует"); con.Close(); goto T9; } } con.Close(); Console.WriteLine("Вводите Parol"); string s51 = Console.ReadLine(); reader.Close(); Admin1 p = new Admin1(s1, s2, s3, s4, s51); p.addAdmin(); reader.Close(); goto T26; } } goto T56; } T26: T56: if (t == 1) { } else { Console.WriteLine("Не правильный Parol или Login"); //reader.Close(); con.Close(); goto T1; } } }
private void AddRegist(Regist r) { SampleGenericDelegate<int, CrimeType[]> del = new SampleGenericDelegate<int, CrimeType[]>(serverClient.GetAllCrimeTypeByRegist); IAsyncResult result = del.BeginInvoke(r.Id, null, null); var crimes = del.EndInvoke(result); DataGridViewComboBoxColumn comb = (DataGridViewComboBoxColumn)dataGridView2.Columns[1]; foreach (CrimeType c in crimes) comb.Items.Add(c.Name); dataGridView2.Rows.Add(new object[] { r.Id, crimes[0].Name, r.Date.ToShortDateString() }); }
private void saveButton_Click(object sender, EventArgs e) { try { regist = new Regist(); regist.Date = dateTimePicker1.Value; regist.Description = richTextBox1.Text; regist.Code = textBox3.Text; SampleGenericDelegate<Regist,int> del = new SampleGenericDelegate<Regist,int>(serverClient.InsertRegist); IAsyncResult result = del.BeginInvoke(regist,null, null); regist.Id = del.EndInvoke(result); SarcIntelService.PersonView.PersonEditor person = new SarcIntelService.PersonView.PersonEditor(serverClient,regist); person.ShowDialog(this); person.Close(); } catch (Exception exc) { var info = new InfoForm(); info.Add(exc.Message); info.ShowDialog(this); info.Dispose(); } }
private void RegistBtn_Click(object sender, RoutedEventArgs e) { Regist r = new Regist(Client); r.ShowDialog(); }
// // Insert a Regist // public int InsertRegist(Regist val) { try { using (var c = new Connect()) { c.BeginTrx(); var registMapper = new RegistDataMapper(c.GetConnection()); registMapper.SetTransaction(c.Transaction); int result = registMapper.Insert(val); c.Commit(); return result; } } catch (Exception exception) { throw new FaultException<ServerError>(new ServerError()); } }