示例#1
0
 private int updateLine()
 {
     return(SqlCEHelper.ExecuteNonQuery("UPDATE lines SET line=@line,tag=@tag WHERE id=@id",
                                        new SqlCeParameter("@line", txtName.Text.ToUpper()),
                                        new SqlCeParameter("@tag", txtTag.Text),
                                        new SqlCeParameter("@id", txtId.Text.ToString())));
 }
示例#2
0
 private int addShift()
 {
     return(SqlCEHelper.ExecuteNonQuery("INSERT INTO shifts (shift_desc, time_from, time_to) VALUES(@shift_desc, @time_from, @time_to)",
                                        new SqlCeParameter("@shift_desc", txtShift.Text.ToUpper()),
                                        new SqlCeParameter("@time_from", dtpFrom.Text),
                                        new SqlCeParameter("@time_to", dtpTo.Text)));
 }
示例#3
0
 private int updateShift()
 {
     return(SqlCEHelper.ExecuteNonQuery("UPDATE shifts SET shift_desc=@shift_desc,time_from=@time_from,time_to=@time_to WHERE id=@id",
                                        new SqlCeParameter("@shift_desc", txtShift.Text.ToUpper()),
                                        new SqlCeParameter("@time_from", dtpFrom.Text),
                                        new SqlCeParameter("@time_to", dtpTo.Text),
                                        new SqlCeParameter("@id", txtId.Text.ToString())));
 }
示例#4
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to delete this record?", "Delete Line", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

            if (result == DialogResult.OK)
            {
                int retVal = SqlCEHelper.ExecuteNonQuery("DELETE FROM lines where id ='" + txtId.Text + "'");
                if (retVal == 1)
                {
                    loadGrid();
                }
                else
                {
                    MessageBox.Show("Erorr deleting record.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                }
            }
        }
示例#5
0
        private int addUser()
        {
            int active;

            if (chkActive.Checked)
            {
                active = 1;
            }
            else
            {
                active = 0;
            }

            string level = cmbLevel.SelectedValue.ToString();

            return(SqlCEHelper.ExecuteNonQuery("INSERT INTO users (name, password, active, level) VALUES(@name, @password, @active, @level)",
                                               new SqlCeParameter("@name", txtName.Text.ToUpper()),
                                               new SqlCeParameter("@password", txtPassword.Text),
                                               new SqlCeParameter("@active", active),
                                               new SqlCeParameter("@level", level)));
        }
示例#6
0
        private int updateUser()
        {
            int active;

            if (chkActive.Checked)
            {
                active = 1;
            }
            else
            {
                active = 0;
            }

            string level = cmbLevel.SelectedValue.ToString();

            return(SqlCEHelper.ExecuteNonQuery("UPDATE users SET name=@name,password=@password,active=@active,level=@level WHERE id=@id",
                                               new SqlCeParameter("@name", txtName.Text.ToUpper()),
                                               new SqlCeParameter("@password", txtPassword.Text),
                                               new SqlCeParameter("@active", active),
                                               new SqlCeParameter("@level", level),
                                               new SqlCeParameter("@id", txtId.Text.ToString())));
        }
示例#7
0
 private int addLine()
 {
     return(SqlCEHelper.ExecuteNonQuery("INSERT INTO lines (line, tag) VALUES(@line, @tag)",
                                        new SqlCeParameter("@line", txtName.Text.ToUpper()),
                                        new SqlCeParameter("@tag", txtTag.Text)));
 }