Exemple #1
0
        private void btnSex_Click(object sender, EventArgs e)
        {
            PopList1.Groups.Clear();
            DataTable    table = new DataTable();
            PopListGroup poli  = new PopListGroup();

            PopList1.Groups.Add(poli);
            poli.Text = "性别";
            table.Columns.Add("sex", typeof(System.Int32));
            table.Columns.Add("sexDesc", typeof(System.String));
            table.Rows.Add(0, "男");
            table.Rows.Add(1, "女");
            foreach (DataRow rowli in table.Rows)
            {
                poli.Items.Add(rowli["sexDesc"].ToString(), rowli["sex"].ToString());

                if (sex.ToString().Length > 0)
                {
                    if (sex.Equals(rowli["sex"]))
                    {
                        PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                    }
                }
            }
            PopList1.ShowDialog();
        }
        /// <summary>
        /// 类型选择
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btntype_Click(object sender, EventArgs e)
        {
            PopList1.Groups.Clear();
            WorkDInfo frmWorkDocument = new WorkDInfo();
            DataTable table           = frmWorkDocument.GetWorkDType();

            PopListGroup poli = new PopListGroup();

            PopList1.Groups.Add(poli);

            poli.Text = "类型";
            //显示样式
            foreach (DataRow rowli in table.Rows)
            {
                poli.Items.Add(rowli["WDOCTYPE_NAME"].ToString(), rowli["WDOC_TYPE"].ToString());

                if (Type.Equals(rowli["WDOC_TYPE"]))
                {
                    PopListItem popitem = new PopListItem();
                    popitem.Value = rowli["WDOC_TYPE"].ToString();
                    PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                }
            }
            PopList1.ShowDialog();
        }
        /// <summary>
        /// FooterBarDialog点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmCostCenter_FooterBarDialogLayoutItemClick(object sender, MobileFormLayoutItemEventArgs e)
        {
            try
            {
                switch (e.CellItem.Name)
                {
                case "btnchoice":
                    DataTable cctable = new DataTable();
                    cctable.Columns.Add("USER_ID", typeof(System.String));
                    cctable.Rows.Add("MobilerUser");
                    cctable.Rows.Add("MUser");
                    PopListGroup poli = new PopListGroup();
                    PopList1.Groups.Add(poli);
                    int liindex = 0;
                    //设置PopListTitle
                    poli.Text = "成本中心责任人筛选";
                    //显示样式
                    foreach (DataRow rowli in cctable.Rows)
                    {
                        poli.Items.Add(rowli["USER_ID"].ToString(), liindex.ToString());
                        liindex += 1;
                    }

                    PopList1.ShowDialog();
                    break;

                case "btnsearch":
                    string confirmUser = this.FooterBarDialogData.Items["txtCCUser"].Text;
                    string CCNAME      = this.FooterBarDialogData.Items["txtCCName"].Text;
                    Bind(confirmUser, CCNAME);
                    this.CloseFooterBar();
                    //隐藏FooterBarLayout
                    break;

                case "btncurrentUser":
                    this.FooterBarDialogData.Items["txtCCUser"].Text = "Demo";
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        /// <summary>
        /// 类型和打卡类型选择
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btntype2_Click(object sender, EventArgs e)
        {
            try
            {
                btn = sender;
                PopList1.Groups.Clear();
                PopListGroup popg = new PopListGroup();
                PopList1.Groups.Add(popg);
                SignIninfo SignIninfo = new SignIninfo();
                DataTable  table      = new DataTable();
                switch (((Button)sender).Name)
                {
                case "btntype":
                case "btntype2":
                    popg.Text = "类型";
                    table     = SignIninfo.StateData1();
                    break;

                case "btnPunchCardType":
                case "btnPunchCardType2":
                    popg.Text = "打卡类型";
                    table     = SignIninfo.StateData();
                    break;
                }
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        popg.Items.Add(row["StateName"].ToString(), row["State"].ToString());
                        switch (((Button)sender).Name)
                        {
                        case "btntype":
                        case "btntype2":
                            if (Type.Trim().Length > 0)
                            {
                                if (Type.Trim().Equals(row["State"].ToString().Trim()))
                                {
                                    PopList1.SetSelections(popg.Items[(popg.Items.Count - 1)]);
                                }
                            }
                            break;

                        case "btnPunchCardType":
                        case "btnPunchCardType2":
                            if (PunchCardType.Trim().Length > 0)
                            {
                                if (PunchCardType.Trim().Equals(row["State"].ToString().Trim()))
                                {
                                    PopList1.SetSelections(popg.Items[(popg.Items.Count - 1)]);
                                }
                            }
                            break;
                        }
                    }
                }
                PopList1.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #5
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);
            }
        }
        /// <summary>
        /// ÏÂÀ­Ñ¡Ôñ
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks></remarks>
        private void btnpop_Click(object sender, EventArgs e)
        {
            try
            {
                btnName = sender;
                PopList1.Groups.Clear();
                PopListGroup poli = new PopListGroup();
                PopList1.Groups.Add(poli);
                COMSSmobilerDemo.common.BookLogInfo BookLogInfo = new COMSSmobilerDemo.common.BookLogInfo();
                COMSSmobilerDemo.common.BookSNInfo  BookSNInfo  = new COMSSmobilerDemo.common.BookSNInfo();
                DataTable table = new DataTable();
                switch (((Button)btnName).Name)
                {
                case "btnBOOKSN2":
                    table     = BookSNInfo.GetBookSNbyBookID();
                    poli.Text = "ͼÊéÐòºÅÑ¡Ôñ";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["BOOKSNID"].ToString(), rowli["BOOKSNID"].ToString());
                        if (txtBOOKSNID.Text.Trim().Length > 0)
                        {
                            if (txtBOOKSNID.Text.Trim().Equals(rowli["BOOKSNID"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnState":
                case "btnState2":
                    table     = BookLogInfo.StateData();
                    poli.Text = "״̬ѡÔñ";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["StateName"].ToString(), rowli["State"].ToString());
                        if (state.ToString().Length > 0)
                        {
                            if (state.Equals(rowli["State"]))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;

                case "btnBORROWER2":
                    table     = BookLogInfo.GetUserData();
                    poli.Text = "Óû§Ñ¡Ôñ";
                    foreach (DataRow rowli in table.Rows)
                    {
                        poli.Items.Add(rowli["USER_NAME"].ToString(), rowli["USER_ID"].ToString());
                        if (string.IsNullOrWhiteSpace(txtBORROWER.Text) == false)
                        {
                            if (txtBORROWER.Text.Trim().ToUpper() == rowli["USER_ID"].ToString().Trim().ToUpper())
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                    }

                    break;
                }
                switch (((Button)btnName).Name)
                {
                case "btnState":
                case "btnState2":
                    PopList1.ShowDialog();
                    break;

                default:
                    PopList1.Show();
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        /// <summary>
        /// 客户,处理结果,审批人选择
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnpop_Click(object sender, EventArgs e)
        {
            try
            {
                PopList1.Groups.Clear();
                //获取审批人
                btnmode = sender;
                OperationalInfo OperationalR = new OperationalInfo();
                DataTable       table        = new DataTable();
                PopListGroup    poli         = new PopListGroup();
                PopList1.Groups.Add(poli);

                switch (((Button)sender).Name)
                {
                case "btnCU":
                case "btnCU2":
                    poli.Text = "客户选择";
                    table     = OperationalR.GetCUData();
                    break;

                case "btnOR_PROCESSRESULT":
                case "btnOR_PROCESSRESULT2":
                    poli.Text = "处理方式选择";
                    table     = OperationalR.GetProcessResultData();
                    break;

                case "btnOR_MAINTAINER":
                case "btnOR_MAINTAINER2":
                    poli.Text = "维护人员选择";
                    table     = OperationalR.GetUserData();
                    break;
                }

                foreach (DataRow rowli in table.Rows)
                {
                    switch (((Button)sender).Name)
                    {
                    case "btnCU":
                    case "btnCU2":
                        poli.Items.Add(rowli["CUST_NAME"].ToString(), rowli["CUST_ID"].ToString());
                        if (CUST_ID.Trim().Length > 0)
                        {
                            if (CUST_ID.Trim().Equals(rowli["CUST_ID"].ToString().Trim()))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                        break;

                    case "btnOR_PROCESSRESULT":
                    case "btnOR_PROCESSRESULT2":
                        poli.Items.Add(rowli["ProcessResultStateName"].ToString(), rowli["ProcessResultState"].ToString());
                        if (OR_PROCESSRESULT.Trim().Length > 0)
                        {
                            if (OR_PROCESSRESULT.Trim().Equals(rowli["ProcessResultState"].ToString().Trim()))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                        break;

                    case "btnOR_MAINTAINER":
                    case "btnOR_MAINTAINER2":
                        poli.Items.Add(rowli["USER_ID"].ToString(), rowli["USER_ID"].ToString());
                        if (OR_MAINTAINER.Trim().Length > 0)
                        {
                            if (OR_MAINTAINER.Trim().ToUpper().Equals(rowli["USER_ID"].ToString().Trim().ToUpper()))
                            {
                                PopList1.SetSelections(poli.Items[(poli.Items.Count - 1)]);
                            }
                        }
                        break;
                    }
                }
                switch (((Button)sender).Name)
                {
                case "btnCU":
                case "btnCU2":
                case "btnOR_MAINTAINER":
                case "btnOR_MAINTAINER2":
                    PopList1.Show();
                    poli.Text = "客户选择";
                    table     = OperationalR.GetCUData();
                    break;

                case "btnOR_PROCESSRESULT":
                case "btnOR_PROCESSRESULT2":
                    PopList1.ShowDialog();
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #8
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);
            }
        }