Exemplo n.º 1
0
        private void btn上一条记录_Click(object sender, EventArgs e)
        {
            DataTable         dtOuter1;
            SqlDataAdapter    daOuter1;
            BindingSource     bsOuter1;
            SqlCommandBuilder cbOuter1;
            List <int>        idList = new List <int>();

            daOuter1 = new SqlDataAdapter("SELECT * FROM " + tablename1 + " WHERE 生产指令编号='" + __生产指令编号 + "' ORDER BY ID ASC;", conn);
            cbOuter1 = new SqlCommandBuilder(daOuter);
            dtOuter1 = new DataTable(tablename1);
            bsOuter1 = new BindingSource();
            daOuter1.Fill(dtOuter1);
            for (int i = 0; i < dtOuter1.Rows.Count; i++)
            {
                idList.Add(Convert.ToInt32(dtOuter1.Rows[i]["ID"]));
            }
            int nowLocateion = idList.IndexOf(Convert.ToInt32(dtOuter.Rows[0]["ID"]));

            if (0 == nowLocateion)
            {
                MessageBox.Show("此消息为第一条");
                return;
            }
            try
            {
                HandOver previous = new HandOver(mainform, idList[nowLocateion - 1]);
                previous.ShowDialog();
            }
            catch
            { }
        }
Exemplo n.º 2
0
        private void Btn交接班_Click(object sender, EventArgs e)
        {
            Boolean b = checkUser(Parameter.userName, Parameter.userRole, "岗位交接班记录");

            if (b)
            {
                CS.HandOver myform = new CS.HandOver(mainform);
                myform.ShowDialog();
            }
            else
            {
                MessageBox.Show("您无权查看该页面!");
                return;
            }
        }