示例#1
0
 internal static void Update(EditableNode target)
 {
     //EditableNode target = (EditableNode)One(e => e.id == source.id);
     if (target != null)
     {
         var him = db.Nodes.Where(w => w.id == target.id).FirstOrDefault();
         him.notes = target.notes;
         db.SubmitChanges();
     }
 }
 public static void Update(EditableNode source)
 {
     EditableNode target = (EditableNode)One(e => e.id == source.id);
     if (target != null)
     {
                   target.id = source.id;
                   target.ip = source.ip;
                   target.mname = source.mname;
                   target.manu= source.manu;
                   target.landscape=source.landscape;
                   target.macaddress=source.macaddress;
                   target.notes=source.notes;
     }
 }
示例#3
0
        private void PSset_note(EditableNode orig)
        {
            //var shfile = "e:\\clikit\\vnmsh\\setnote.sh";
                var shfile = "c:\\temp\\setnote.sh";
                string mh = orig.mhandle;
                var ls = orig.landscape;
                var newtext = orig.notes;

                var sb = new System.Text.StringBuilder();

                mh = ls = ""; // for debugging only
                if (mh == "") { mh = "0x8b9e84"; }
                if (ls == "") { ls = "artemis"; }
                if (newtext == "") { newtext = "Default from||gregg"; }

                sb.AppendLine("CLISESSID=$$");
                sb.AppendLine("export CLISESSID");
                sb.AppendLine("cd e:");
                sb.AppendLine("cd clikit/vnmsh");
                sb.Append("./connect.exe ");
                sb.Append(ls);
                sb.Append("\r\n");
                sb.Append("./update.exe mh=");
                sb.Append(mh);
                sb.AppendLine(" attr=0x12c00,val=Exclusion");
                sb.Append("./update.exe mh=");
                sb.Append(mh);
                sb.Append(" attr=0x11564,val=");
                newtext = newtext.Replace("\"", " ");
                sb.Append("\"");
                sb.Append(newtext);
                sb.Append("\"");
                sb.AppendLine("\r\n");
                var ShellString = sb.ToString();
                if (System.IO.File.Exists(shfile))
                {
                    System.IO.File.Delete(shfile);
                }
                System.IO.File.WriteAllText(shfile, ShellString);
                try
                {
                    //System.IO.File.WriteAllText("c:\\temp\\setnote.sh", ShellString);
                }
                catch (Exception e)
                {
                    ViewData["WriteAllText"] = e.Message;
                }

                var result = CLI.CLITask.Execute(ls, mh, newtext);
                try
                {
                    //var result = CLI.CLITask.Execute(ShellString);
                }
                catch (Exception e)
                {
                    ViewData["Start"] = e.Message;
                }
        }