Beispiel #1
0
        private void FrmPersonEdit_Load(object sender, EventArgs e)
        {
            if (dataClass == null)
                dataClass = new Smmprog();
            else {

            }

            tbProgId.DataBindings.Add("Text", dataClass, "progid");
            tbProgName.DataBindings.Add("Text", dataClass, "progname");
            tbRemark.DataBindings.Add("Text", dataClass, "remark");
            tbAssemblyName.DataBindings.Add("Text", dataClass, "AssemblyName");
            tbClassName.DataBindings.Add("Text", dataClass, "ClassName");
            tbMethodName.DataBindings.Add("Text", dataClass, "MethodName");
            tbIndex.DataBindings.Add("Text", dataClass, "Index");
            Tico.DataBindings.Add("Text", dataClass, "ProgIco");
            //tbProgType.DataBindings.Add("Text", dataClass, "ProgType");
            //tbProgModuleType.DataBindings.Add("Text", dataClass, "ProgModuleType");
            switch (dataClass.ProgType)
            {
                case "m":
                    tbProgType.SelectedIndex = 0;
                    break;
                case "f":
                    tbProgType.SelectedIndex = 1;
                    break;
                default:
                    tbProgType.SelectedIndex = 0;
                    break;
            }

            //switch (dataClass.ProgModuleType)
            //{
            //    case "0":
            //        tbProgModuleType.SelectedIndex = 0;
            //        break;
            //    case "1":
            //        tbProgModuleType.SelectedIndex = 1;
            //        break;
            //    default:
            //        tbProgModuleType.SelectedIndex = 0;
            //        break;
            //}
        }
Beispiel #2
0
        private void SetListView(Smmprog prog,int m)
        {
            if (prog == null)
                return;
            listViewdown.Groups.Clear();
            listViewdown.Items.Clear();
            IList list = SysService.GetList<Smmprog>();
            DataRow[] rowsf = null;
            if (m==3)
            {
                rowsf = smmprogTable.Select(string.Format("ProgId='{0}' and ProgType='{1}'", prog.ProgId, "f"));
            }
            else
            {
                rowsf = smmprogTable.Select(string.Format("parentid='{0}' and ProgType='{1}'", prog.ProgId, "f"));
            }
            DataRow[] rowsm = smmprogTable.Select(string.Format("parentid='{0}' and ProgType='{1}'", prog.ProgId, "m"));
            if (rowsm.Length > 0)
            {
                ListViewGroup listgroup = listViewdown.Groups.Add(prog.ProgId, prog.ProgName);
                foreach (DataRow rows1 in rowsf)
                {
                    VsmdgroupProg smdgroup2 = new VsmdgroupProg();
                    smdgroup2 = MIS.GetProgRight(rows1["ProgId"].ToString(), MIS.ProgUID);
                    if (smdgroup2 != null && Convert.ToInt32(smdgroup2.run) <= 0)
                        continue;

                    ListViewItem item = new ListViewItem();
                    item.Text = rows1["progname"].ToString();
                    item.Tag = DataConverter.RowToObject<Smmprog>(rows1);
                    item.ToolTipText = rows1["progname"].ToString();
                    item.ImageKey = rows1["ProgIco"].ToString();
                    item.ToolTipText = rows1["Remark"].ToString();
                    item.Group = listgroup;
                    listViewdown.Items.Add(item);
                }
                foreach (DataRow rows2 in rowsm)
                {
                    ListViewGroup listgroupm = listViewdown.Groups.Add(rows2["ProgId"].ToString(), prog.ProgName+">>"+rows2["progname"].ToString());
                    DataRow[] rowsmf = smmprogTable.Select(string.Format("parentid='{0}' and ProgType='{1}'", rows2["ProgId"].ToString(), "f"));
                    foreach (DataRow rows3 in rowsmf)
                    {

                        VsmdgroupProg smdgroup2 = new VsmdgroupProg();
                        smdgroup2 = MIS.GetProgRight(rows3["ProgId"].ToString(), MIS.ProgUID);
                        if (smdgroup2 != null && Convert.ToInt32(smdgroup2.run) <= 0)
                            continue;

                        ListViewItem item = new ListViewItem();
                        item.Text = rows3["progname"].ToString();
                        item.Tag = DataConverter.RowToObject<Smmprog>(rows3);
                        item.ToolTipText = rows3["progname"].ToString();
                        item.ImageKey = rows3["ProgIco"].ToString();
                        item.ToolTipText = rows3["Remark"].ToString();
                        item.Group = listgroupm;
                        listViewdown.Items.Add(item);
                    }

                }

            }
            else
            {
                if (m==1)
                {
                    ListViewGroup listgroup = listViewdown.Groups.Add(prog.ProgId, prog.ProgName);
                    foreach (DataRow rows1 in rowsf)
                    {
                        VsmdgroupProg smdgroup2 = new VsmdgroupProg();
                        smdgroup2 = MIS.GetProgRight(rows1["ProgId"].ToString(), MIS.ProgUID);
                        if (smdgroup2 != null && Convert.ToInt32(smdgroup2.run) <= 0)
                            continue;

                        ListViewItem item = new ListViewItem();
                        item.Text = rows1["progname"].ToString();
                        item.Tag = DataConverter.RowToObject<Smmprog>(rows1);
                        item.ToolTipText = rows1["progname"].ToString();
                        item.ImageKey = rows1["ProgIco"].ToString();
                        item.ToolTipText = rows1["Remark"].ToString();
                        item.Group = listgroup;
                        listViewdown.Items.Add(item);
                    }
                }
                else if(m==2)
                {
                    ListViewGroup listgroup = listViewdown.Groups.Add(prog.ProgId, nbctSystem.ActiveGroup.Caption + ">>" + prog.ProgName);

                    foreach (DataRow rows1 in rowsf)
                    {
                        VsmdgroupProg smdgroup2 = new VsmdgroupProg();
                        smdgroup2 = MIS.GetProgRight(rows1["ProgId"].ToString(), MIS.ProgUID);
                        if (smdgroup2 != null && Convert.ToInt32(smdgroup2.run) <= 0)
                            continue;

                        ListViewItem item = new ListViewItem();
                        item.Text = rows1["progname"].ToString();
                        item.Tag = DataConverter.RowToObject<Smmprog>(rows1);
                        item.ToolTipText = rows1["progname"].ToString();
                        item.ImageKey = rows1["ProgIco"].ToString();
                        item.ToolTipText = rows1["Remark"].ToString();
                        item.Group = listgroup;
                        listViewdown.Items.Add(item);
                    }

                }
                else
                {
                    ListViewGroup listgroup = listViewdown.Groups.Add(prog.ProgId, nbctSystem.ActiveGroup.Caption );

                    foreach (DataRow rows1 in rowsf)
                    {
                        VsmdgroupProg smdgroup2 = new VsmdgroupProg();
                        smdgroup2 = MIS.GetProgRight(rows1["ProgId"].ToString(), MIS.ProgUID);
                        if (smdgroup2 != null && Convert.ToInt32(smdgroup2.run) <= 0)
                            continue;

                        ListViewItem item = new ListViewItem();
                        item.Text = rows1["progname"].ToString();
                        item.Tag = DataConverter.RowToObject<Smmprog>(rows1);
                        item.ToolTipText = rows1["progname"].ToString();
                        item.ImageKey = rows1["ProgIco"].ToString();
                        item.ToolTipText = rows1["Remark"].ToString();
                        item.Group = listgroup;
                        listViewdown.Items.Add(item);
                    }
                }

            }
        }
Beispiel #3
0
        /// <summary>
        /// ��ʼ��׼���ݷ���
        /// </summary>
        /// <param name="pl"></param>
        /// <param name="sm"></param>
        /// <param name="smmp"></param>
        public virtual bool InitData(List<Project> pl, VsmdgroupProg sm, Smmprog smmp)
        {
            project = pl;
            smdgroup = sm;
            smmprog = smmp;

            this.ShowInTaskbar = false;
            this.StartPosition = FormStartPosition.CenterScreen;
            if(this.Owner!=null)
                this.StartPosition = FormStartPosition.CenterParent;
            this.Text = pl[1].ProjectName + " - " + pl[0].ProjectName + " - " + smmprog.ProgName;
            this.Owner = (System.Windows.Forms.Form)Itop.Client.MIS.MainForm;

            return true;
        }