private void Login() { dto thongtin = new dto(txtName.Text, txtPass.Text); //thong tin de tim kiem tra ton tai dto thongtin2 = new dto(txtName.Text); //Thong tin de kiem tra if (txtName.Text != "" && txtPass.Text != "") { if (b.KiemTraAccountTonTai(thongtin2)) { if (b.KiemTraAccount(thongtin)) { load_Splash(); frm = new FrmMain2(); frm.Show(); this.Hide(); } else { MessageBox.Show("Sai Mật Khẩu", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Tai Khoan Khong Ton Tai!!!", "Thong Bao", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { MessageBox.Show("Moi Nhap Day Du !!!", "Thong Bao", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public string ConvertMarketStatusToString(dto.endpoint.type.MarketStatus marketStatus) { string strMarketStatus; switch (marketStatus) { case dto.endpoint.type.MarketStatus.CLOSED: strMarketStatus = "Closed"; break; case dto.endpoint.type.MarketStatus.EDITS_ONLY: strMarketStatus = "Edits Only"; break; case dto.endpoint.type.MarketStatus.OFFLINE: strMarketStatus = "Offline"; break; case dto.endpoint.type.MarketStatus.ON_AUCTION: strMarketStatus = "On Auction"; break; case dto.endpoint.type.MarketStatus.ON_AUCTION_NO_EDITS: strMarketStatus = "On Auction no edits"; break; case dto.endpoint.type.MarketStatus.SUSPENDED: strMarketStatus = "Suspended"; break; default: strMarketStatus = "Closed"; break; } return strMarketStatus; }
//Dang ki private void bunifuFlatButton1_Click(object sender, EventArgs e) { if (ckKiemtra.Checked) { if (txtPassword.Text != "" && txtPasswordComfirm.Text != "" && txtUserName.Text != "") { if (txtPassword.Text == txtPasswordComfirm.Text) { dto thongtin = new dto(txtName.Text, txtUserName.Text, txtPassword.Text); func = new bus(); if (func.AddTv(thongtin)) { MessageBox.Show("Đăng kí thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("Đăng kí thất bại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { MessageBox.Show("Mật khẩu không giống nhau !", "Thông Báo"); } } else { MessageBox.Show("Mời bạn nhập đầy đủ !!!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Mời Bạn Nhập Mọi Thứ", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
internal static Image getGenericIcon(dto.ProductDto product) { switch (product.GenericType) { case GenericTypeDto.GENERIC:return Resource1.genericLarge; case GenericTypeDto.REFERENT:return Resource1.genericReferenceLarge; } return Resource1.genericLargeOff; }
internal static Image getVigilanceIcon(dto.ProductDto product) { switch (product.Vigilance) { case VigilanceDto.UNSPECIFIED: return Resource1.vigilanceOff; case VigilanceDto.VIGILANCE_0: return Resource1.vigilance0; case VigilanceDto.VIGILANCE_1: return Resource1.vigilance1; case VigilanceDto.VIGILANCE_2: return Resource1.vigilance2; case VigilanceDto.VIGILANCE_3: return Resource1.vigilance3; case VigilanceDto.VIGILANCE_5: return Resource1.vigilance4; } return Resource1.unknownType; }
public int insert(dto.OtpremnicaDTO otpremnica) { int rows = new MySqlStavkaKnjigeTrgovineNaVeliko().insert(otpremnica); if (rows > 0) { MySqlConnection connection = ConnectionPool.checkOutConnection(); MySqlCommand command = connection.CreateCommand(); command.CommandText = qInsert; command.Parameters.AddWithValue("RedniBroj", otpremnica.RedniBroj); int rows1=command.ExecuteNonQuery(); ConnectionPool.checkInConnection(connection); return rows; } return rows; }
void OnMouseEvent(object sender, MousePosArgs e) { if (IsClosing) { return; } if (e.Message == MousePosArgs.MouseMessages.WM_LBUTTONDOWN) { mouseLBtnDown = true; } if (e.Message == MousePosArgs.MouseMessages.WM_LBUTTONUP) { mouseLBtnDown = false; found = true; } if (e.Message == MousePosArgs.MouseMessages.WM_RBUTTONDOWN) { mouseRBtnDown = true; } if (e.Message == MousePosArgs.MouseMessages.WM_RBUTTONUP) { mouseRBtnDown = false; } dto temp = new dto(); IntPtr hwnd = WindowFromPoint(new POINT(e.X, e.Y)); if (hwnd.ToInt64() > 0) { temp.name = GetCaptionOfWindow(hwnd); temp.value = GetCaptionOfWindow(hwnd); temp.value = GetValueFromNativeElementFromPoint2((new Point(e.X, e.Y))); temp.flag = true; } if (temp.flag && found) { IntPtr windowHandle = new WindowInteropHelper(this).Handle; if (hwnd == windowHandle) { temp.flag = false; } MVM.MouseUpCommand.Execute(temp); found = false; } }
private void bunifuThinButton21_Click(object sender, EventArgs e) { string len = txtPassword.Text; //Lay chieu dai thongtin = new dto(txtUsername.Text, txtPassword.Text); thongtin2 = new dto(txtUsername.Text); if (txtUsername.Text != "" && txtPassword.Text != "" && txtConfirm.Text != "") { if (txtPassword.Text == txtConfirm.Text) { if (len.Length > 3) { if (func.KiemTraAccountTonTai(thongtin2)) { try { func.ResetPassWord(thongtin); MessageBox.Show("thanh Cong"); } catch { MessageBox.Show("That Bai"); } // MessageBox.Show("Password đã được Reset", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("Tài khoản không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Mật khẩu phải có độ dài từ 3 kí tự trở lên", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Mật khẩu không trùng nhau", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Xin nhập đầy đủ", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public bool KtTaiKhoan(dto tv) { try { LinQBaseDataContext context = new LinQBaseDataContext(connection); var linq = from person in context.tbl_users where person.user_name == tv.User && person.pass == tv.Psw select person; var list = linq.ToList(); if (list.Count > 0) { return(true); } } catch { } return(false); }
public bool KiemTraTonTai(dto tv) { try { LinQBaseDataContext context = new LinQBaseDataContext(connection); var linq = from person in context.tbl_users where person.user_name == tv.User select person; var list = linq.ToList(); if (list.Count > 0) { return(true); } } catch (Exception) { } return(false); }
public static void datetimeoff() { DateTimeOffset dt = new DateTimeOffset(DateTime.Now); BJSON.RegisterCustomType(typeof(DateTimeOffset), (x) => { return(x.ToString()); }, (x) => { return(DateTimeOffset.Parse(x)); } ); var t = new dto(); t.date = dt; var s = BJSON.ToBJSON(t); var d = BJSON.ToObject(s); s = BJSON.ToBJSON(dt); d = BJSON.ToObject <DateTimeOffset>(s); //Assert.AreEqual(dt, d); }
public bool addNewUser(dto tv) { LinQBaseDataContext context = new LinQBaseDataContext(connection); tbl_user course = new tbl_user { name_user = tv.Name, user_name = tv.User, pass = tv.Psw, }; context.tbl_users.InsertOnSubmit(course); try { context.SubmitChanges(); return(true); } catch { } return(false); }
public bool Add(dto tv) { try { connection.Open(); string sql = string.Format("INSERT INTO tbl_user(name_user,user_name,pass) VALUES('{0}', '{1}', '{2}')", tv.Name, tv.User, tv.Psw); SqlCommand cmd = new SqlCommand(sql, connection); if (cmd.ExecuteNonQuery() > 0) { return(true); } } catch (Exception) { } finally { connection.Close(); } return(false); }
public bool UpdatePassword(dto tv) { LinQBaseDataContext context = new LinQBaseDataContext(); var linq = from person in context.tbl_users where person.user_name == tv.User select person; foreach (var user in linq) { user.pass = tv.Psw; } try { context.SubmitChanges(); return(true); } catch (Exception) { } return(false); }
public bool KiemTraAccountTonTai(dto tv) { return(data.KiemTraTonTai(tv)); }
=> !(GetPropertyInfo(dto, property).GetValue(dto) is null);
private static void HandleToEnricher(XElement step, dto.Route routeObj, Exchange exchange) { EnricherPattern.Enrich(step, exchange, routeObj); }
public bool ResetPassWord(dto tv) { return(data.UpdatePassword(tv)); }
///<Summary> ///Updates an OTC position ///@pathParam dealId Deal reference identifier ///@param editPositionRequest the request for updating a position ///@return OTC edit position response ///</Summary> public async Task<IgResponse<EditPositionResponse>> editPositionV1(string dealId, dto.endpoint.positions.edit.v1.EditPositionRequest editPositionRequest) { return await _igRestService.RestfulService<EditPositionResponse>("/gateway/deal/positions/otc/" + dealId, HttpMethod.Put, "1", _conversationContext, editPositionRequest); }
///<Summary> ///Creates an OTC working order ///@param createWorkingOrderRequest Create working order request data ///</Summary> public async Task<IgResponse<CreateWorkingOrderResponse>> createWorkingOrderV2(dto.endpoint.workingorders.create.v2.CreateWorkingOrderRequest createWorkingOrderRequest) { return await _igRestService.RestfulService<CreateWorkingOrderResponse>("/gateway/deal/workingorders/otc", HttpMethod.Post, "2", _conversationContext, createWorkingOrderRequest); }
///<Summary> ///Updates an OTC working order ///@pathParam dealId Deal identifier ///@param editWorkingOrderRequest Update working order request data ///</Summary> public async Task<IgResponse<EditWorkingOrderResponse>> editWorkingOrderV2(string dealId, dto.endpoint.workingorders.edit.v2.EditWorkingOrderRequest editWorkingOrderRequest) { return await _igRestService.RestfulService<EditWorkingOrderResponse>("/gateway/deal/workingorders/otc/" + dealId, HttpMethod.Put, "2", _conversationContext, editWorkingOrderRequest); }
///<Summary> ///Creates a trading session, obtaining session tokens for subsequent API access. ///<p> /// Please note that region-specific <a href=/loginrestrictions>login restrictions</a> may apply. ///</p> ///@param authenticationRequest Client login credentials ///@return Client summary account information ///</Summary> public async Task<IgResponse<dto.colibri.endpoint.auth.v2.AuthenticationResponse>> authenticate(dto.colibri.endpoint.auth.v2.AuthenticationRequest authenticationRequest) { return await _igRestService.RestfulService<dto.colibri.endpoint.auth.v2.AuthenticationResponse>("/gateway/deal/session", HttpMethod.Post, "2", _conversationContext, authenticationRequest); }
protected void Button1_Click(object sender, EventArgs e) { dto p= new dto(); p.x= FileUpload1.FileBytes; }
public bool KiemTraAccount(dto tv) { return(data.KtTaiKhoan(tv)); }
public bool AddTv(dto tv) { return(data.addNewUser(tv)); }
public async Task <IHttpActionResult> PostFormularioRolPermiso(dto form) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } //1 Leer //2 Adicionar //3 Editar //4 Eliminar int idRol = form.FormulariosPermisos.IdRol; int IdFormulario = form.FormulariosPermisos.IdFormulario; var lstEnt = (from a in db.formulaiorolpermiso.Where(x => x.idrol == idRol && x.idformulario == IdFormulario) select a) .ToList(); foreach (var item in lstEnt) { db.formulaiorolpermiso.Remove(item); } if (form.FormulariosPermisos.Leer.Value) { db.formulaiorolpermiso.Add(new formulaiorolpermiso() { idformulario = form.FormulariosPermisos.IdFormulario, idpermiso = 1, idrol = form.FormulariosPermisos.IdRol }); } if (form.FormulariosPermisos.Adicionar.Value) { db.formulaiorolpermiso.Add(new formulaiorolpermiso() { idformulario = form.FormulariosPermisos.IdFormulario, idpermiso = 2, idrol = form.FormulariosPermisos.IdRol }); } if (form.FormulariosPermisos.Editar.Value) { db.formulaiorolpermiso.Add(new formulaiorolpermiso() { idformulario = form.FormulariosPermisos.IdFormulario, idpermiso = 3, idrol = form.FormulariosPermisos.IdRol }); } if (form.FormulariosPermisos.Eliminar.Value) { db.formulaiorolpermiso.Add(new formulaiorolpermiso() { idformulario = form.FormulariosPermisos.IdFormulario, idpermiso = 4, idrol = form.FormulariosPermisos.IdRol }); } try { await db.SaveChangesAsync(); } catch (Exception ex) { return(BadRequest(ModelState)); } return(Ok(new permisosrolDto())); }
///<Summary> ///Creates an OTC position ///@param createPositionRequest the request for creating a position ///@return OTC create position response ///</Summary> public async Task<IgResponse<CreatePositionResponse>> createPositionV2(dto.endpoint.positions.create.otc.v2.CreatePositionRequest createPositionRequest) { return await _igRestService.RestfulService<CreatePositionResponse>("/gateway/deal/positions/otc", HttpMethod.Post, "2", _conversationContext, createPositionRequest); }