Esempio n. 1
0
        /// <summary>
        /// 获取笔记本使用记录
        /// </summary>
        /// <returns></returns>
        /// <remarks></remarks>
        private DataTable GetNootBooksData()
        {
            COMSSmobilerDemo.common.NBInfo NBInfo = new COMSSmobilerDemo.common.NBInfo();
            DataTable table = NBInfo.GetNootBooksData(pageIndex, pagesize);

            return(table);
        }
Esempio n. 2
0
        private void btnState_Click(object sender, EventArgs e)
        {
            try
            {
                btnName = sender;
                PopList1.Groups.Clear();
                PopListGroup poli = new PopListGroup();
                PopList1.Groups.Add(poli);
                COMSSmobilerDemo.common.NBInfo NBInfo = new COMSSmobilerDemo.common.NBInfo();
                switch (((Button)sender).Name)
                {
                case "btnNB_OWNER":
                case "btnNB_OWNER2":
                    DataTable table = NBInfo.OwnerData();
                    poli.Text = "所有者选择";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["NB_OWNER1"].ToString(), rowli["NB_OWNER"].ToString());
                        if (string.IsNullOrWhiteSpace(Owner) == false)
                        {
                            if (Owner.Equals(rowli["NB_OWNER"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnState":
                case "btnState2":
                    DataTable table1 = NBInfo.StateData();
                    poli.Text = "状态选择";
                    foreach (DataRow rowli in table1.Rows)
                    {
                        poli.Items.Add(rowli["StateName"].ToString(), rowli["State"].ToString());
                        if (string.IsNullOrWhiteSpace(State.ToString()) == false)
                        {
                            if (State.Equals(rowli["State"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnNB_LOCATION":
                case "btnNB_LOCATION2":
                    DataTable table2 = NBInfo.AddressData();
                    poli.Text = "所在位置";
                    foreach (DataRow rowli in table2.Rows)
                    {
                        poli.Items.Add(rowli["Address"].ToString(), rowli["ID"].ToString());
                        if (Address.Trim().Length > 0)
                        {
                            if (Address.Equals(rowli["Address"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;
                }
                PopList1.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 3
0
        private void btnpop_Click(object sender, EventArgs e)
        {
            try
            {
                btnName = sender;
                COMSSmobilerDemo.common.NBRecordInfo NBRecordInfo = new COMSSmobilerDemo.common.NBRecordInfo();
                COMSSmobilerDemo.common.NBInfo       NBInfo       = new COMSSmobilerDemo.common.NBInfo();

                DataTable table = new DataTable();
                PopList1.Groups.Clear();
                PopListGroup poli = new PopListGroup();
                PopList1.Groups.Add(poli);
                switch (((Button)btnName).Name)
                {
                case "btnCODE2":

                    table     = NBInfo.GetNootBooksData(0, 3);
                    poli.Text = "笔记本序列号选择";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["NB_EQNO"].ToString(), rowli["NB_EQNO"].ToString());
                        if (string.IsNullOrWhiteSpace(NB_EQNO) == false)
                        {
                            if (NB_EQNO.Equals(rowli["NB_EQNO"].ToString()))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnUser":
                case "btnUser2":
                    table     = NBRecordInfo.GetUserData();
                    poli.Text = "用户选择";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["USER_NAME"].ToString(), rowli["USER_ID"].ToString());
                        if (string.IsNullOrWhiteSpace(User) == false)
                        {
                            if (User.Trim().ToUpper() == rowli["USER_ID"].ToString().Trim().ToUpper())
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnType":
                case "btnType2":
                    table     = NBRecordInfo.StateData();
                    poli.Text = "操作类型选择";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["StateName"].ToString(), rowli["State"].ToString());
                        if (Type.ToString().Length > 0)
                        {
                            if (Type.Equals(rowli["State"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnNBR_LOCATION":
                case "btnNBR_LOCATION2":
                    table     = NBInfo.AddressData();
                    poli.Text = "所在位置";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["Address"].ToString(), rowli["ID"].ToString());
                        if (btnNBR_LOCATION.Text.Trim().Length > 0)
                        {
                            if (btnNBR_LOCATION.Text.Equals(rowli["Address"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;
                }
                PopList1.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// toolbar事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks></remarks>
        private void frmNBDetail_ToolbarItemClick(object sender, ToolbarClickEventArgs e)
        {
            try
            {
                switch (e.Name)
                {
                case "Edit":
                    frmNBEdit frm = new frmNBEdit();
                    this.Redirect(frm, (MobileForm form, object args) =>
                    {
                        if (frm.ShowResult == Smobiler.Core.ShowResult.Yes)
                        {
                            ShowResult = Smobiler.Core.ShowResult.Yes;
                            Bind();
                        }
                    });
                    break;

                case "Scrap":
                    MessageBox.Show("是否确定报废笔记本?", "报废", MessageBoxButtons.YesNo, (object s, MessageBoxHandlerArgs args) =>
                    {
                        if (args.Result == Smobiler.Core.ShowResult.Yes)
                        {
                            MessageBox.Show("笔记本已报废!");
                        }
                    });
                    break;

                case "Transfer":
                    PopList1.Groups.Clear();
                    PopListGroup poli = new PopListGroup();
                    PopList1.Groups.Add(poli);
                    COMSSmobilerDemo.common.NBInfo NBInfo = new COMSSmobilerDemo.common.NBInfo();
                    DataTable table = NBInfo.AddressData();
                    poli.Text = "转移位置";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["Address"].ToString(), rowli["ID"].ToString());
                    }

                    PopList1.ShowDialog();
                    break;

                case "Record":
                    frmNBRecordMain frm1 = new frmNBRecordMain();
                    this.Redirect(frm1, (MobileForm form, object args) =>
                    {
                        try
                        {
                            if (frm1.ShowResult == Smobiler.Core.ShowResult.Yes)
                            {
                                Bind();
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    });
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }