/// <summary>
        /// <description></description>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void onRegisterClick(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtUserName.Text) || string.IsNullOrEmpty(txtName.Text) || string.IsNullOrEmpty(txtPassword.Text) || string.IsNullOrEmpty(txtDate.Text) || string.IsNullOrEmpty(checkboxText) || string.IsNullOrEmpty(selectedDesignation) || string.IsNullOrEmpty(encodedImgString))
                {
                    Snackbar.Make(txtUserName, GetString(Resource.String.require_all_Details), Snackbar.LengthLong).Show();
                    //GlobalConst.alertMessageBox(this, "Requir", "Please Enter All the Details..!!");
                }
                else
                {
                    EmployeeRegisterData employeeRegisterData = new EmployeeRegisterData()
                    {
                        imgUrl      = encodedImgString,
                        name        = txtName.Text,
                        userName    = txtUserName.Text,
                        password    = txtPassword.Text,
                        date        = txtDate.Text,
                        gender      = rdGender.Text,
                        hobbies     = checkboxText,
                        designation = selectedDesignation
                    };

                    GlobalConst.insertEmployee(employeeRegisterData);
                    Finish();
                }
            }
            catch (Exception ex)
            {
                Toast.MakeText(this, GetString(Resource.String.somthing_wrong), ToastLength.Short).Show();
            }
        }
Ejemplo n.º 2
0
 //Add Employee Details
 public static bool insertEmployee(EmployeeRegisterData empRegisterData)
 {
     try
     {
         employeeInfo.Add(empRegisterData);
     }
     catch (Exception)
     {
     }
     return(true);
 }
Ejemplo n.º 3
0
 //Update Employee Details
 public static bool updateEmployee(EmployeeRegisterData empRegisterData, int Id)
 {
     try
     {
         employeeInfo.RemoveAt(Id);
         employeeInfo.Insert(Id, empRegisterData);
     }
     catch (Exception)
     {
     }
     return(true);
 }