Esempio n. 1
0
 static void CopyComputerSoftware(AssetComputerSoftwareData source, lib.bwa.bigWebDesk.LinqBll.Context.AssetComputerSoftwares dest, int DepartmentID, int AssetID)
 {
     dest.AssetId           = AssetID;
     dest.DepartmentId      = DepartmentID;
     dest.SoftwareName      = source.SoftwareName;
     dest.SoftwarePublisher = source.SoftwarePublisher;
     dest.SoftwareVersion   = source.SoftwareVersion;
 }
Esempio n. 2
0
        private static void CopySoftwares(lib.bwa.bigWebDesk.LinqBll.Context.MutiBaseDataContext dc, int DepartmentId, int OldAssetId, int NewAssetId)
        {
            var OldSoftwares = (from d in dc.AssetComputerSoftwares where d.DepartmentId == DepartmentId && d.AssetId == OldAssetId select d).ToList();

            foreach (var d in OldSoftwares)
            {
                var NewD = new lib.bwa.bigWebDesk.LinqBll.Context.AssetComputerSoftwares()
                {
                    DepartmentId      = DepartmentId,
                    AssetId           = NewAssetId,
                    SoftwareName      = d.SoftwareName,
                    SoftwarePublisher = d.SoftwarePublisher,
                    SoftwareVersion   = d.SoftwareVersion
                };
                dc.AssetComputerSoftwares.InsertOnSubmit(NewD);
            }
        }
Esempio n. 3
0
        static void SaveComputerSoftwares(int DepartmentID, lib.bwa.bigWebDesk.LinqBll.Context.MutiBaseDataContext dc, AssetComputerData data)
        {
            var lds = (
                from d in dc.AssetComputerSoftwares
                where d.DepartmentId == DepartmentID && d.AssetId == data.AssetNumber
                select d
                ).ToList();

            var ss = data.Softwares.ToList();

            foreach (var ld in lds)
            {
                bool exist = false;
                for (int i = 0; i < ss.Count; i++)
                {
                    var s = ss[i];
                    if (ld.SoftwareName == s.SoftwareName && ld.SoftwarePublisher == s.SoftwarePublisher && ld.SoftwareVersion == s.SoftwareVersion)
                    {
                        exist = true;
                        ss.Remove(s);
                        i--;
                    }
                }
                if (exist)
                {
                    continue;
                }
                dc.AssetComputerSoftwares.DeleteOnSubmit(ld);
            }

            foreach (var s in ss)
            {
                var New = new lib.bwa.bigWebDesk.LinqBll.Context.AssetComputerSoftwares();
                CopyComputerSoftware(s, New, DepartmentID, data.AssetNumber);
                dc.AssetComputerSoftwares.InsertOnSubmit(New);
            }
        }
Esempio n. 4
0
        static void SaveComputerSoftwares(int DepartmentID, lib.bwa.bigWebDesk.LinqBll.Context.MutiBaseDataContext dc, AssetComputerData data)
        {
            var lds = (
                from d in dc.AssetComputerSoftwares
                where d.DepartmentId == DepartmentID && d.AssetId == data.AssetNumber
                select d
                ).ToList();

            var ss = data.Softwares.ToList();
            foreach (var ld in lds)
            {
                bool exist = false;
                for (int i = 0; i < ss.Count; i++)
                {
                    var s = ss[i];
                    if (ld.SoftwareName == s.SoftwareName && ld.SoftwarePublisher == s.SoftwarePublisher && ld.SoftwareVersion == s.SoftwareVersion)
                    {
                        exist = true;
                        ss.Remove(s);
                        i--;
                    }
                }
                if (exist) continue;
                dc.AssetComputerSoftwares.DeleteOnSubmit(ld);
            }

            foreach (var s in ss)
            {
                var New = new lib.bwa.bigWebDesk.LinqBll.Context.AssetComputerSoftwares();
                CopyComputerSoftware(s, New, DepartmentID, data.AssetNumber);
                dc.AssetComputerSoftwares.InsertOnSubmit(New);
            }
        }
Esempio n. 5
0
 private static void CopySoftwares(lib.bwa.bigWebDesk.LinqBll.Context.MutiBaseDataContext dc, int DepartmentId, int OldAssetId, int NewAssetId)
 {
     var OldSoftwares = (from d in dc.AssetComputerSoftwares where d.DepartmentId == DepartmentId && d.AssetId == OldAssetId select d).ToList();
     foreach (var d in OldSoftwares)
     {
         var NewD = new lib.bwa.bigWebDesk.LinqBll.Context.AssetComputerSoftwares()
         {
             DepartmentId = DepartmentId,
             AssetId = NewAssetId,
             SoftwareName = d.SoftwareName,
             SoftwarePublisher = d.SoftwarePublisher,
             SoftwareVersion = d.SoftwareVersion
         };
         dc.AssetComputerSoftwares.InsertOnSubmit(NewD);
     }
 }