示例#1
0
文件: FrmMain.cs 项目: pirder/sgusyem
        private void button3_Click(object sender, EventArgs e)
        {
            int       i = 0;
            FrmSelect f = new FrmSelect(i, toolStripMain.Text, limit);

            f.Show();
        }
示例#2
0
        public FrmAdd(FrmSelect f1)
        {
            this.f1 = f1;
            InitializeComponent();

            addbtn.Visible    = false;
            updatebtn.Visible = true;
            this.Text         = "修改专利";
            bindCbox();
            patent_name.Text    = UpdateClass.upatent_name;
            patent_type.Text    = UpdateClass.upatent_type;
            first_designer.Text = UpdateClass.ufirst_designer;
            patent_num.Text     = UpdateClass.upatent_num;
            if (UpdateClass.uconfirm_date != "")
            {
                confirm_date.Value = Convert.ToDateTime(UpdateClass.uconfirm_date);
            }
            else
            {
                patentckb.Checked = true;
            }

            if (UpdateClass.uapply_date != "")
            {
                apply_date.Value = Convert.ToDateTime(UpdateClass.uapply_date);
            }
            else
            {
                appckb.Checked = true;
            }

            if (UpdateClass.ugrant_date != "")
            {
                grant_date.Value = Convert.ToDateTime(UpdateClass.ugrant_date);
            }
            else
            {
                grantackb.Checked = true;
            }
            other_designer.Text = UpdateClass.uother_designer;
            agency.Text         = UpdateClass.uagency;
            comboBox2.Text      = UpdateClass.uisgrant;
            comboBox1.Text      = UpdateClass.uinstitute_num;
            // id + 1,

            giFullname = UpdateClass.ugifullname;
            ciFullname = UpdateClass.ucifullname;
        }
示例#3
0
        private void patentSearchPB_Click(object sender, EventArgs e)
        {
            int       i = 0;
            FrmSelect f = new FrmSelect(i, toolStripStatusLabel.Text, limit);

            f.WindowState = FormWindowState.Maximized;

            //去掉边框
            f.FormBorderStyle = FormBorderStyle.None;

            f.MdiParent = this;

            //设置新窗体的Parent
            f.Parent = panel2;
            f.Show();
        }
        /// <summary>
        /// Método que muetra la pantalla para insertar una nueva lección aprendida
        /// </summary>
        private async void InsertarNuevaLeccion(Usuario ModelUsuario)
        {
            DialogService dialog = new DialogService();

            MetroDialogSettings setting = new MetroDialogSettings();

            setting.AffirmativeButtonText = "+2";
            setting.NegativeButtonText    = "1";

            MessageDialogResult resul = await dialog.SendMessage(StringResources.ttlAlerta, StringResources.lblDescripcionSimilar, setting, MessageDialogStyle.AffirmativeAndNegative);

            if (resul == MessageDialogResult.Affirmative)
            {
                FrmSelect frmLista = new FrmSelect();
                frmLista.DataContext = this;
                bool result = (bool)frmLista.ShowDialog();

                if (result)
                {
                    InsertarComponentes    Descripcion = new InsertarComponentes();
                    InsertarNuevaLeccionVW Context     = new InsertarNuevaLeccionVW(ModelUsuario, true, MotivoSelected);
                    Descripcion.DataContext = Context;
                    Descripcion.ShowDialog();
                }

                Lista = DataManagerControlDocumentos.GetLec("");
            }
            else
            {
                FrmSelect frmLista = new FrmSelect();
                frmLista.DataContext = this;

                bool result = (bool)frmLista.ShowDialog();

                if (result)
                {
                    InsertarNuevaLeccion   Insertar   = new InsertarNuevaLeccion();
                    InsertarNuevaLeccionVW InsertarVW = new InsertarNuevaLeccionVW(ModelUsuario, false, MotivoSelected);
                    Insertar.DataContext = InsertarVW;
                    Insertar.ShowDialog();
                }

                Lista = DataManagerControlDocumentos.GetLec("");
            }
        }
示例#5
0
        //尝试一下是否拉去成功

        /*     private void button1_Click(object sender, EventArgs e)
         *   {
         *       FrmAdd f = new FrmAdd();
         *       f.Show();
         *
         *   }
         *
         *   private void button2_Click(object sender, EventArgs e)
         *   {
         *       int i = 0;
         *       FrmSelect f = new FrmSelect(i, toolStripMain.Text);
         *       f.Show();
         *   }
         *
         *   private void button3_Click(object sender, EventArgs e)
         *   {
         *       int i = 0;
         *       FrmSelect f = new FrmSelect(i, toolStripMain.Text,limit);
         *       f.Show();
         *   }*/


        private void 数据查询ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frm[fmusermanggerindex] = null;
            frm[fmaddindex]         = null;
            if (frm[fmselectindex] != null)
            {
                frm[fmselectindex].Activate();
                return;
            }
            fmselect             = new FrmSelect(0, limit);
            frm[fmselectindex]   = fmselect;
            fmselect.WindowState = FormWindowState.Maximized;
            //去掉边框
            fmselect.FormBorderStyle = FormBorderStyle.None;
            fmselect.MdiParent       = this;
            //设置新窗体的Parent
            fmselect.Parent = mdiPanel;
            fmselect.Show();
        }
 /// <summary>
 /// 选择产品事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSelectCode_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.frmSelect == null || this.frmSelect.IsDisposed)
         {
             frmSelect = new FrmSelect(SelectType.ScanPedal, this);
         }
         else if (!this.frmSelect.IsDisposed)
         {
             frmSelect.Dispose();
             frmSelect = new FrmSelect(SelectType.ScanPedal, this);
         }
         Scanner.Disable();    //禁用扫描
         frmSelect.ShowDialog();
     }
     catch (Exception ex)
     {
         CLog.WriteErrLog("[FrmScan.Select]" + ex.Message);
     }
 }
示例#7
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string userNum      = txtNum.Text;
            string userPassword = txtPassword.Text;

            txtPassword.Text = "123456";
            int  limit       = 1;
            bool resultnum   = false;
            bool resultlimit = false;
            bool resultlogin = false;

            prompt1.Text = "";
            prompt2.Text = "";
            if (txtNum.Text == "")
            {
                prompt1.Text      = "账号不能为空";
                prompt1.ForeColor = Color.Red;
                return;
            }
            if (txtPassword.Text == "")
            {
                prompt2.Text      = "密码不能为空";
                prompt2.ForeColor = Color.Red;
                return;
            }
            string checkname = "select count(*) from users where users_num = '" + userNum + "'";

            resultnum = Program.SearchSql(checkname);
            if (!resultnum)
            {
                prompt1.Text      = "手机号不存在";
                prompt1.ForeColor = Color.Red;
                return;
            }
            if (btnManager.Checked == true)
            {
                limit = 2;
                string checklimit = "select count(*) from users where users_num = '" + userNum + "' and users_limit = 2";
                resultlimit = Program.SearchSql(checklimit);
                if (!resultlimit)
                {
                    prompt3.Text      = "该账号不是管理员账号";
                    prompt3.ForeColor = Color.Red;
                    return;
                }
                resultlogin = login(userNum, userPassword, limit);
                if (resultlogin)
                {
                    Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                    cfa.AppSettings.Settings["usernum"].Value = userNum;
                    cfa.Save();
                    ConfigurationManager.RefreshSection("appSettings");
                    FrmMain f = new FrmMain(userNum, limit);
                    f.Show();
                    this.Hide();
                }
                else
                {
                    prompt2.Text      = "密码错误";
                    prompt2.ForeColor = Color.Red;
                    return;
                }
            }
            if (btnUser.Checked == true)
            {
                limit = 1;
                string checklimit = "select count(*) from users where users_num = '" + userNum + "' and users_limit = 1";
                resultlimit = Program.SearchSql(checklimit);
                if (!resultlimit)
                {
                    prompt3.Text      = "该账号不是用户账号";
                    prompt3.ForeColor = Color.Red;
                    return;
                }
                resultlogin = login(userNum, userPassword, limit);
                if (resultlogin)
                {
                    Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                    cfa.AppSettings.Settings["usernum"].Value = userNum;
                    cfa.Save();
                    ConfigurationManager.RefreshSection("appSettings");
                    FrmSelect f = new FrmSelect(userNum, limit);
                    f.Show();
                    this.Hide();
                }
                else
                {
                    prompt2.Text      = "密码错误";
                    prompt2.ForeColor = Color.Red;
                    return;
                }
            }
        }
示例#8
0
        protected override void PerformAdd()
        {
            TreeListNode n = trlMain.FocusedNode;
            if (n.ParentNode == null)
            {
                n.Checked = true;
                _idParent = (Guid)n.GetValue("ID");
            }
            else
            {
                n.ParentNode.Checked = true;
                _idParent = (Guid)n.ParentNode.GetValue("ID");
            }

            using (var frm = new FrmSelect() { Text = Text, Caption = "Họ tên", DataSource = _bll.Pol_User.Select() })
            {
                frm.ShowDialog();
                if (frm.ListInfo == null) return;

                foreach (var x in frm.ListInfo)
                {
                    var tmp = String.Format("UserId = '{0}' And ParentID = '{1}'", x.Id + "", _idParent + "");
                    var dtr = _dtb.Select(tmp);
                    if (dtr.Length > 0) continue;
                    else
                    {
                        var r = _dtb.NewRow();

                        r["ID"] = x.Id;
                        r["ParentID"] = _idParent;
                        r["Name"] = x.Descript;

                        _dtb.Rows.Add(r);
                    }
                }
            }

            base.PerformAdd();
        }
        private static void TitleMatchingEngineUserSelectsResult(IMDbOperations imdbOp, bool resultsFound)
        {


            #region show film selection dialog

            imdbOp.NotListed = false;
            Debugger.LogMessageToFile("[IMDb video identifier] Showing video match selection dialog...");

            FrmSelect tmpFrmSelect;

// ReSharper disable ConvertIfStatementToConditionalTernaryExpression
            if (resultsFound)
// ReSharper restore ConvertIfStatementToConditionalTernaryExpression
                tmpFrmSelect = new FrmSelect(imdbOp.Title, IMDbOperations.Country, imdbOp.ImdbList);
            else tmpFrmSelect = new FrmSelect(imdbOp.Title, IMDbOperations.Country, FrmSelect.SearchType.IMDb);

            var dlResult = tmpFrmSelect.ShowDialog();


            if (dlResult == DialogResult.OK)
            {
                //MessageBox.Show("User pressed Submit");

                imdbOp.ImdbResult = (IIMDbSearchResult)tmpFrmSelect.SelectedResult;
                imdbOp.ImdbId = imdbOp.ImdbResult.IMDb_ID;
                imdbOp.Title = imdbOp.ImdbResult.Title;
                imdbOp.IsCustom = tmpFrmSelect.IsCustom;
            }
            if (dlResult == DialogResult.Cancel)
            {
                //MessageBox.Show("passed in the Just Ignore case");
                imdbOp.NotListed = true;
                tmpFrmSelect.Close();
                tmpFrmSelect.Dispose();
                //tmpFrmSelect = null;
            }
            if (dlResult == DialogResult.Abort)
            {
                //MessageBox.Show("passed in the Delete Item case");
                imdbOp.NotListed = true;
                imdbOp.DeleteItem = true;
                tmpFrmSelect.Close();
                tmpFrmSelect.Dispose();
                //tmpFrmSelect = null;
            }

            #endregion




        }
示例#10
0
        protected override void PerformAdd()
        {
            TreeListNode n = trlMain.FocusedNode;
            if (n.ParentNode == null)
            {
                n.Checked = true;
                _idParent = (Guid)n.GetValue("ID");
            }
            else
            {
                n.ParentNode.Checked = true;
                _idParent = (Guid)n.ParentNode.GetValue("ID");
            }

            using (var frm = new FrmSelect() { Text = Text, Caption = "Tên form (chức năng)", Field = "Text", DataSource = _bll.Pol_Dictionary.SelectRights() })
            {
                frm.ShowDialog();
                if (frm.ListInfo == null) return;

                foreach (var x in frm.ListInfo)
                {
                    var tmp = String.Format("RightId = '{0}' And ParentID = '{1}'", x.Id + "", _idParent + "");
                    var dtr = _dtb.Select(tmp);
                    if (dtr.Length > 0) continue;
                    else
                    {
                        var r = _dtb.NewRow();

                        r["ID"] = x.Id;
                        r["ParentID"] = _idParent;
                        r["Name"] = x.Note;

                        r["Add"] = false;
                        r["Edit"] = false;
                        r["Delete"] = false;
                        r["Default"] = false;
                        r["Print"] = false;
                        r["Access"] = false;
                        r["Full"] = false;
                        r["None"] = true;

                        _dtb.Rows.Add(r);
                    }
                }
            }

            base.PerformAdd();
        }