private void simpleButton1_Click(object sender, EventArgs e)
        {
            foreach (DataRow rws in dt.Rows)
            {
                rws["C"] = false;
            }

            PowerPicSelect ppsn = new PowerPicSelect();

            ppsn.EachListID = _obj.UID;

            IList <PowerPicSelect> liss = Services.BaseService.GetList <PowerPicSelect>("SelectPowerPicSelectList", ppsn);

            foreach (PowerPicSelect pps in liss)
            {
                foreach (DataRow rw in dt.Rows)
                {
                    if (pps.PicSelectID == rw["A"].ToString())
                    {
                        rw["C"] = true;
                    }
                }
            }



            FrmPicTypeSelect fpt = new FrmPicTypeSelect();

            fpt.DT = dt;
            if (fpt.ShowDialog() == DialogResult.OK)
            {
                dt = fpt.DT;

                int c = 0;
                foreach (PowerPicSelect pps1 in liss)
                {
                    c = 0;
                    foreach (DataRow rw in dt.Rows)
                    {
                        if (pps1.PicSelectID == rw["A"].ToString() && (bool)rw["C"])
                        {
                            c = 1;
                        }
                    }
                    if (c == 0)
                    {
                        Services.BaseService.Delete <PowerPicSelect>(pps1);
                    }
                }


                foreach (DataRow rw1 in dt.Rows)
                {
                    c = 0;
                    if ((bool)rw1["C"])
                    {
                        foreach (PowerPicSelect pps2 in liss)
                        {
                            if (pps2.PicSelectID == rw1["A"].ToString())
                            {
                                c = 1;
                            }
                        }
                        if (c == 0)
                        {
                            PowerPicSelect pp3 = new PowerPicSelect();
                            pp3.EachListID  = _obj.UID;
                            pp3.PicSelectID = rw1["A"].ToString();

                            Services.BaseService.Create <PowerPicSelect>(pp3);
                        }
                    }
                }
            }
        }
Пример #2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            foreach (DataRow rws in dt.Rows)
            {
                rws["C"] = false;
            }

            PowerPicSelect ppsn = new PowerPicSelect();
            ppsn.EachListID = _obj.UID;

            IList<PowerPicSelect> liss = Services.BaseService.GetList<PowerPicSelect>("SelectPowerPicSelectList", ppsn);

            foreach (PowerPicSelect pps in liss)
            {
                foreach (DataRow rw in dt.Rows)
                {
                    if (pps.PicSelectID == rw["A"].ToString())
                        rw["C"] = true;
                }
            }

            FrmPicTypeSelect fpt = new FrmPicTypeSelect();
            fpt.DT = dt;
            if (fpt.ShowDialog() == DialogResult.OK)
            {
                dt = fpt.DT;

                int c = 0;
                foreach (PowerPicSelect pps1 in liss)
                {
                    c = 0;
                    foreach (DataRow rw in dt.Rows)
                    {
                        if (pps1.PicSelectID == rw["A"].ToString() && (bool)rw["C"])
                            c = 1;
                    }
                    if (c == 0)
                    {
                        Services.BaseService.Delete<PowerPicSelect>(pps1);
                    }
                }

                foreach (DataRow rw1 in dt.Rows)
                {
                    c = 0;
                    if ((bool)rw1["C"])
                    {
                        foreach (PowerPicSelect pps2 in liss)
                        {
                            if (pps2.PicSelectID == rw1["A"].ToString())
                                c = 1;
                        }
                        if (c == 0)
                        {
                            PowerPicSelect pp3 = new PowerPicSelect();
                            pp3.EachListID = _obj.UID;
                            pp3.PicSelectID = rw1["A"].ToString();

                            Services.BaseService.Create<PowerPicSelect>(pp3);
                        }
                    }
                }
            }
        }
Пример #3
0
        private void 关联图层ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ctrlPowerEachList1.FocusedObject == null)
                return;

            foreach (DataRow rws in dt.Rows)
            {
                rws["C"] = false;
            }

            string sid = ctrlPowerEachList1.FocusedObject.UID;

            PowerPicSelect ppsn = new PowerPicSelect();
            ppsn.EachListID = sid;

            IList<PowerPicSelect> liss = Services.BaseService.GetList<PowerPicSelect>("SelectPowerPicSelectList", ppsn);

            foreach (PowerPicSelect pps in liss)
            {
                foreach (DataRow rw in dt.Rows)
                {
                    if (pps.PicSelectID == rw["A"].ToString())
                        rw["C"] = true;
                }
            }
            FrmPicTypeSelect fpt = new FrmPicTypeSelect();
            fpt.DT = dt;
            if (fpt.ShowDialog() == DialogResult.OK)
            {
                dt = fpt.DT;

                int c=0;
                foreach (PowerPicSelect pps1 in liss)
                {
                    c=0;
                    foreach (DataRow rw in dt.Rows)
                    {
                        if (pps1.PicSelectID == rw["A"].ToString() && (bool)rw["C"])
                            c = 1;
                    }
                    if (c == 0)
                    {
                        Services.BaseService.Delete<PowerPicSelect>(pps1);
                    }
                }

                foreach (DataRow rw1 in dt.Rows)
                {
                    c = 0;
                    if ((bool)rw1["C"])
                    {
                        foreach (PowerPicSelect pps2 in liss)
                        {
                            if (pps2.PicSelectID == rw1["A"].ToString())
                                c = 1;
                        }
                        if (c == 0)
                        {
                            PowerPicSelect pp3 = new PowerPicSelect();
                            pp3.EachListID = sid;
                            pp3.PicSelectID = rw1["A"].ToString();

                            Services.BaseService.Create<PowerPicSelect>(pp3);
                        }
                    }
                }
                InitSodata();
            }
        }