Exemplo n.º 1
0
        private void Insert_LoginUser_From_View()
        {
            DataAccessPOS dbPOS = new DataAccessPOS();

            //if (String.IsNullOrEmpty(txt_ConfigName.Text)) txt_ConfigName.Text = "";
            //if (String.IsNullOrEmpty(txt_ConfigValue.Text)) txt_ConfigValue.Text = "";
            if (String.IsNullOrEmpty(txt_Wage.Text))
            {
                txt_Wage.Text = "0";
            }

            loginUsers.Clear();
            loginUsers.Add(new POS_LoginUserModel()
            {
                //Id = int.Parse(txt_LoginID.Text),
                FirstName       = txt_FirstName.Text,
                LastName        = txt_LastName.Text,
                NickName        = txt_NickName.Text,
                Department      = txt_Dept.Text,
                DOB             = dtp_DOB.Value,
                MobilePhone     = txt_Mobile.Text,
                Address         = txt_Addr.Text,
                PassWord        = txt_PassWord.Text,
                Grade           = txt_Grade.Text,
                Wage            = float.Parse(txt_Wage.Text),
                IsActive        = check_Active.Checked,
                DateTimeCreated = DateTime.Now,
                DateTimeUpdated = DateTime.Now
            });
            int iProdCnt = dbPOS.Insert_LoginUser(loginUsers[0]);

            txtMessage.Text      = "User successfully Added : " + txt_LoginID.Text;
            txtMessage.ForeColor = Color.White;
        }