Ejemplo n.º 1
1
        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);
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 //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);
     }
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
        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;
            }
        }
Ejemplo n.º 8
0
        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);
            }
        }
Ejemplo n.º 9
0
 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);
 }
Ejemplo n.º 10
0
 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);
 }
Ejemplo n.º 11
0
    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);
    }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
 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);
 }
Ejemplo n.º 14
0
        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);
        }
Ejemplo n.º 15
0
 public bool KiemTraAccountTonTai(dto tv)
 {
     return(data.KiemTraTonTai(tv));
 }
Ejemplo n.º 16
0
 => !(GetPropertyInfo(dto, property).GetValue(dto) is null);
Ejemplo n.º 17
0
 private static void HandleToEnricher(XElement step, dto.Route routeObj, Exchange exchange)
 {
     EnricherPattern.Enrich(step, exchange, routeObj);
 }
Ejemplo n.º 18
0
 public bool ResetPassWord(dto tv)
 {
     return(data.UpdatePassword(tv));
 }
Ejemplo n.º 19
0
		///<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);
		}
Ejemplo n.º 20
0
		///<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);
		}
Ejemplo n.º 21
0
		///<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);
		}
Ejemplo n.º 22
0
		///<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);
		}
Ejemplo n.º 23
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     dto p= new dto();
     p.x= FileUpload1.FileBytes;
 }
Ejemplo n.º 24
0
 public bool KiemTraAccount(dto tv)
 {
     return(data.KtTaiKhoan(tv));
 }
Ejemplo n.º 25
0
 public bool AddTv(dto tv)
 {
     return(data.addNewUser(tv));
 }
Ejemplo n.º 26
0
        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()));
        }
Ejemplo n.º 27
0
		///<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);
		}