コード例 #1
0
ファイル: Attendance.cs プロジェクト: ideaztech/ideaz
        private bool PunchIn()
        {
            //punchin a second time on same date only if they punched out the previous time
            if (sol_EmployeesLog.PunchInTime.ToShortDateString() == Main.rc.FechaActual.ToShortDateString())
            {
                if (sol_EmployeesLog.PunchOutTime.ToShortDateString() != sol_EmployeesLog.PunchInTime.ToShortDateString())
                {
                    MessageBox.Show("Cannot punch in the same date without punch out first!");
                    return(false);
                }
            }

            sol_EmployeesLog              = new Sol_EmployeesLog();
            sol_EmployeesLog.UserId       = userId;
            sol_EmployeesLog.PunchInTime  = Main.rc.FechaActual;
            sol_EmployeesLog.PunchOutTime = DateTime.Parse("1753-1-1 12:00:00");
            try
            {
                sol_EmployeesLog_Sp.Insert(sol_EmployeesLog);
            }
            catch (Exception e)
            {
                CajaDeMensaje.Show("", "Unable to Punch In, try again later please...", e.Message, CajaDeMensajeImagen.Error);
                return(false);
            }
            return(true);
        }
コード例 #2
0
ファイル: AttendanceDetails.cs プロジェクト: ideaztech/ideaz
 private void buttonSaveComments_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(textBoxComments.Text) || Attendance.sol_EmployeesLog.LogId < 1)
     {
         MessageBox.Show("Nothing to save or you have not punch in yet!");
         return;
     }
     Attendance.sol_EmployeesLog.Comments = textBoxComments.Text;
     try
     {
         Attendance.sol_EmployeesLog_Sp.Update(Attendance.sol_EmployeesLog);
     }
     catch (Exception ex)
     {
         CajaDeMensaje.Show("", "Unable to save comments, try again later please...", ex.Message, CajaDeMensajeImagen.Error);
     }
 }
コード例 #3
0
ファイル: AttendanceDetails.cs プロジェクト: ideaztech/ideaz
        private void buttonSaveNewPin_Click(object sender, EventArgs e)
        {
            //validar formato clave
            if (!Funciones.validarClave(textBoxPassword.Text.Trim()))
            {
                MessageBox.Show("Use at least 4 characters or numbers please.");
                textBoxReTypePassword.Text = "";
                textBoxPassword.SelectAll();
                textBoxPassword.Focus();
                return;
            }

            if (textBoxPassword.Text.Trim() != textBoxReTypePassword.Text.Trim())
            {
                MessageBox.Show("PIN and new PIN don't match, verify please.");
                textBoxReTypePassword.SelectAll();
                textBoxReTypePassword.Focus();
                return;
            }

            try
            {
                MembershipUser u = Membership.GetUser(Attendance.userName, false);
                if (u.ChangePassword(currentPassword, textBoxPassword.Text))
                {
                    MessageBox.Show("PIN changed!");
                    textBoxPassword.Text       = "";
                    textBoxReTypePassword.Text = "";
                }
                else
                {
                    MessageBox.Show("Unable to change your PIN. Try another please.!");
                    textBoxPassword.SelectAll();
                    textBoxPassword.Focus();
                    return;
                }
            }
            catch (Exception e2)
            {
                CajaDeMensaje.Show("", "Unable to change your PIN, try again later please...", e2.Message, CajaDeMensajeImagen.Error);
                textBoxPassword.SelectAll();
                textBoxPassword.Focus();
                return;
            }
        }
コード例 #4
0
ファイル: Attendance.cs プロジェクト: ideaztech/ideaz
        private bool PunchOut()
        {
            //cannot punchout without a previous punchin
            if (sol_EmployeesLog.PunchInTime.Year == 1753 || sol_EmployeesLog.PunchOutTime.Year != 1753)
            {
                MessageBox.Show("Cannot punch out without punch in first!");
                return(false);
            }

            //sol_EmployeesLog.UserId = userId;
            //sol_EmployeesLog.PunchInTime = ;
            sol_EmployeesLog.PunchOutTime = Main.rc.FechaActual;
            try
            {
                sol_EmployeesLog_Sp.Update(sol_EmployeesLog);
            }
            catch (Exception e)
            {
                CajaDeMensaje.Show("", "Unable to Punch Out, try again later please...", e.Message, CajaDeMensajeImagen.Error);
                return(false);
            }
            return(true);
        }
コード例 #5
0
        private bool AddStagedContanier()
        {
            if (sol_Agency != null &&
                sol_Agency.AutoGenerateTagNumber
                )
            {
                AutoGenerateTagNumber();
            }

            sol_Stage = new Sol_Stage();
            if (membershipUser == null)
            {
                membershipUser = Membership.GetUser(Properties.Settings.Default.UsuarioNombre);
            }
            if (membershipUser == null)
            {
                MessageBox.Show("User does not exits, cannot close the Container");
                return(false);
            }
            sol_Stage.UserID               = (Guid)membershipUser.ProviderUserKey;
            sol_Stage.UserName             = Properties.Settings.Default.UsuarioNombre;
            sol_Stage.Date                 = Main.rc.FechaActual; // ; // Properties.Settings.Default.FechaActual;;
            sol_Stage.TagNumber            = textBoxTagNumber.Text;
            sol_Stage.ContainerID          = Int32.Parse(comboBoxContainers.SelectedValue.ToString());
            sol_Stage.ContainerDescription = comboBoxContainers.Text;
            sol_Stage.ProductID            = Int32.Parse(comboBoxProducts.SelectedValue.ToString());
            sol_Stage.ProductName          = comboBoxProducts.Text;
            sol_Stage.Quantity             = Int32.Parse(textBoxQuantity.Text);
            sol_Stage.Dozen                = 0;   //not using it anymore
            sol_Stage.Status               = "I"; //InProcess
            sol_Stage.Remarks              = textBoxRemarks.Text.Trim();

            ////include product price
            //Sol_Product_Sp sol_Product_Sp = new Sol_Product_Sp(Properties.Settings.Default.WsirDbConnectionString);
            //Sol_Product sol_Product = sol_Product_Sp.Select(sol_Stage.ProductID);
            //sol_Stage.Price = sol_Product.Price;
            sol_Stage.Price = 0.00m;

            //in case there is no default value in the db
            sol_Stage.DateClosed = DateTime.Parse("1753-01-01 12:00:00.000");

            try
            {
                sol_Stage_Sp.Insert(sol_Stage);
            }
            catch
            {
                if (sol_Agency != null &&
                    sol_Agency.AutoGenerateTagNumber
                    )
                {
                    AutoGenerateTagNumber();
                }
                try
                {
                    sol_Stage_Sp.Insert(sol_Stage);
                }
                catch (Exception e)
                {
                    CajaDeMensaje.Show("SqlError", "Error trying to add a new Staging, try again later please", e.Message, CajaDeMensajeImagen.Error);
                    sol_Stage = null;
                    return(false);
                }
            }

            //textBoxStageID.Text = sol_Stage.StageID.ToString();
            textBoxUserName.Text = sol_Stage.UserName;
            //dateTimePicker1.Value = sol_Stage.Date;
            textBoxDate.Text = sol_Stage.Date.ToString("G");



            return(true);
        }
コード例 #6
0
        private bool AddStagedRow()
        {
            //if(osi == null)
            //    osi = new SirLib.ObtenerSiguienteId(Properties.Settings.Default.WsirDbConnectionString);

            sol_Stage = new Sol_Stage();


            if (sol_Agency != null &&
                sol_Agency.AutoGenerateTagNumber
                )
            {
                AutoGenerateTagNumber();
                sol_Stage.TagNumber = textBoxTagNumber.Text;
            }

            //sol_Stage.StageID = osi.Id("Sol_Stage", "StageId", null, null);

            if (membershipUser == null)
            {
                membershipUser = Membership.GetUser(Properties.Settings.Default.UsuarioNombre);
            }
            if (membershipUser == null)
            {
                MessageBox.Show("User does not exits, cannot close the Container");
                return(false);
            }
            sol_Stage.UserID   = (Guid)membershipUser.ProviderUserKey;
            sol_Stage.UserName = Properties.Settings.Default.UsuarioNombre;
            sol_Stage.Date     = Main.rc.FechaActual; // ; // Properties.Settings.Default.FechaActual;;
            sol_Stage.Status   = "I";                 //InProcess

            //sol_Stage.TagNumber = osi.Id("Sol_Stage", "Cast(TagNumber as int)", null, null).ToString();

            //in case there is no default value in the db
            sol_Stage.DateClosed = DateTime.Parse("1753-01-01 12:00:00.000");

            try
            {
                sol_Stage_Sp.Insert(sol_Stage);
            }
            catch
            {
                //try once more
                if (sol_Agency != null &&
                    sol_Agency.AutoGenerateTagNumber
                    )
                {
                    AutoGenerateTagNumber();
                }
                try
                {
                    sol_Stage_Sp.Insert(sol_Stage);
                }
                catch (Exception e)
                {
                    CajaDeMensaje.Show("SqlError", "Error trying to add a new Staged Container row, try again later please", e.Message, CajaDeMensajeImagen.Error);
                    sol_Stage = null;
                    return(false);
                }
            }


            return(true);
        }