public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
        {
            settings[MailCleanerContants.APITitle] = txtServerName.Text.Trim();
            settings[MailCleanerContants.APIUrl]   = txtSimpleUrlBase.Text.Trim();

            settings["MailCleanerServiceID"] = MailCleanerServers;
        }
 public void BindSettings(System.Collections.Specialized.StringDictionary settings)
 {
     txtServerName.Text = settings[OCSConstants.PoolFQDN];
     EDGEServices       = settings[OCSConstants.EDGEServicesData];
     BindOCSEdgeServices(ddlEdgeServers);
     UpdateGrid();
 }
Example #3
0
        public static void predict_main(System.Collections.Specialized.StringDictionary args)
        {
            flaw   f    = new flaw(args["input"]);
            string root = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);

            System.IO.Directory.CreateDirectory(System.IO.Path.Combine(root, "tmp"));
            try
            {
                string[] keys = load_all_keys();
                Dictionary <string, object> d = new Dictionary <string, object>();
                foreach (string k in keys)
                {
                    if (f.Counts.ContainsKey(k))
                    {
                        d.Add(k, f.Counts[k]);
                    }
                    else
                    {
                        d.Add(k, 0);
                    }
                }
                var jss = new System.Web.Script.Serialization.JavaScriptSerializer();
                //ret = jss.Deserialize<List<Dictionary<string, object>>>(str);
                string str = jss.Serialize(d);
                System.IO.File.WriteAllText(System.IO.Path.Combine(root, "tmp", "test.json"), str);
                int      ret;
                string[] lines = runExe("dotnet.exe", $@"mlApp1.dll predict --input {System.IO.Path.Combine(root, "tmp", "test.json")}", out ret, systemapp: true,
                                        workdir: $@"{System.IO.Path.Combine(root, "publish")}");
                System.Console.WriteLine($"{string.Join(System.Environment.NewLine, lines)}");
            }
            catch (Exception) { }
        }
Example #4
0
 void IAttributesConfigurable.Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes["RecipeArgument"] != null)
     {
         RecipeArgument = attributes["RecipeArgument"];
     }
 }
        // Load configuration from file
        // Call at startup.
        public static void Load()
        {
            m_Data = new System.Collections.Specialized.StringDictionary();

            string config_file_path = Path.Combine(Globals.calc_application_data_dir(), CONFIG_FILE_NAME);
            using (System.IO.StreamReader file = new System.IO.StreamReader(config_file_path))
            {
                string Line;
                while ((Line = file.ReadLine()) != null)
                {
                    Line = Line.Trim();
                    if (Line.Length == 0)
                        continue;

                    int EqPos = Line.IndexOf('=');
                    if (EqPos == -1)
                        throw new Exception("Error in configuration file: " + config_file_path);
                    string Key = Line.Substring(0, EqPos);
                    string Value = Line.Substring(EqPos + 1);
                    if (Key.Length == 0)
                        throw new Exception("Error in configuration file: " + config_file_path);
                    m_Data.Add(Key, Value);
                }
            }
        }
Example #6
0
        public void BindSettings(System.Collections.Specialized.StringDictionary settings)
        {
            txtConnectionBroker.Text = settings["ConnectionBroker"];

            GWServers = settings["GWServrsList"];
            UpdateLyncServersGrid();

            txtRootOU.Text                  = settings["RootOU"];
            txtComputersRootOu.Text         = settings["ComputersRootOU"];
            txtPrimaryDomainController.Text = settings["PrimaryDomainController"];

            if (!string.IsNullOrEmpty(settings["UseCentralNPS"]) && bool.TrueString == settings["UseCentralNPS"])
            {
                chkUseCentralNPS.Checked = true;
                txtCentralNPS.Enabled    = true;
                txtCentralNPS.Text       = settings["CentralNPS"];
            }
            else
            {
                chkUseCentralNPS.Checked = false;
                txtCentralNPS.Enabled    = false;
                txtCentralNPS.Text       = string.Empty;
            }

            if (!string.IsNullOrEmpty(settings[RdsServerSettings.ALLOWCOLLECTIONSIMPORT]))
            {
                cbCollectionsImport.Checked = Convert.ToBoolean(settings[RdsServerSettings.ALLOWCOLLECTIONSIMPORT]);
            }
        }
        /// <summary>
        /// Runs the specified command.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="keyValues">The key values.</param>
        /// <param name="output">The output.</param>
        /// <returns></returns>
        public override int Execute(string command, System.Collections.Specialized.StringDictionary keyValues, out string output)
        {
            output = string.Empty;



            bool   compressFile         = !Params["nofilecompression"].UserTypedIn;
            string filename             = Params["filename"].Value;
            bool   quiet                = Params["quiet"].UserTypedIn;
            bool   haltOnWarning        = Params["haltonwarning"].UserTypedIn;
            bool   haltOnFatalError     = Params["haltonfatalerror"].UserTypedIn;
            bool   includeusersecurity  = Params["includeusersecurity"].UserTypedIn;
            bool   logFile              = !Params["nologfile"].UserTypedIn;
            bool   retainObjectIdentity = Params["retainobjectidentity"].UserTypedIn;
            bool   copySecurity         = Params["copysecuritysettings"].UserTypedIn;
            bool   suppressAfterEvents  = Params["suppressafterevents"].UserTypedIn;

            bool   retargetLinks = Params["retargetlinks"].UserTypedIn;
            string sourceUrl     = Params["sourceurl"].Value;
            string targetUrl     = Params["url"].Value;

            Common.Lists.ImportList importList = new Common.Lists.ImportList(sourceUrl, targetUrl, retargetLinks);

            SPUpdateVersions updateVersions = SPUpdateVersions.Append;

            if (Params["updateversions"].UserTypedIn)
            {
                updateVersions = (SPUpdateVersions)Enum.Parse(typeof(SPUpdateVersions), Params["updateversions"].Value);
            }

            importList.PerformImport(compressFile, filename, quiet, haltOnWarning, haltOnFatalError, includeusersecurity, logFile, retainObjectIdentity, copySecurity, suppressAfterEvents, updateVersions);
            return((int)ErrorCodes.NoError);
        }
        /// <summary>
        /// Runs the specified command.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="keyValues">The key values.</param>
        /// <param name="output">The output.</param>
        /// <returns></returns>
        public override int Execute(string command, System.Collections.Specialized.StringDictionary keyValues, out string output)
        {
            output = string.Empty;

            string sourceUrl             = Params["sourceurl"].Value.TrimEnd('/');
            string targetUrl             = Params["targeturl"].Value.TrimEnd('/');
            string sourceContentTypeName = null;

            if (Params["sourcename"].UserTypedIn)
            {
                sourceContentTypeName = Params["sourcename"].Value;
            }
            bool verbose = Params["verbose"].UserTypedIn;


            bool copyWorkflows      = !Params["noworkflows"].UserTypedIn;
            bool copyColumns        = !Params["nocolumns"].UserTypedIn;
            bool copyDocConversions = !Params["nodocconversions"].UserTypedIn;
            bool copyDocInfoPanel   = !Params["nodocinfopanel"].UserTypedIn;
            bool copyPolicies       = !Params["nopolicies"].UserTypedIn;
            bool copyDocTemplate    = !Params["nodoctemplate"].UserTypedIn;

            Logger.Verbose = verbose;
            Logger.Write("Start Time: {0}", DateTime.Now.ToString());

            Common.ContentTypes.CopyContentTypes ctCopier = new Common.ContentTypes.CopyContentTypes(
                copyWorkflows, copyColumns, copyDocConversions, copyDocInfoPanel, copyPolicies, copyDocTemplate);

            ctCopier.Copy(sourceUrl, targetUrl, sourceContentTypeName);

            Logger.Write("Finish Time: {0}", DateTime.Now.ToString());

            return((int)ErrorCodes.NoError);
        }
Example #9
0
        bool login_task(string u, string p)
        {
            bool ret = false;

            try
            {
                string dir = System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("FDHOME"), "AVIA", "hydra");
                System.IO.File.Delete(System.IO.Path.Combine(dir, "HydraLogin.xml"));
                string exe   = System.IO.Path.Combine(dir, "HydraLogin.exe");
                string param = $"-u={u} -p={p}";
                if (System.IO.File.Exists(exe))
                {
                    System.Collections.Specialized.StringDictionary envs = new System.Collections.Specialized.StringDictionary();
                    envs.Add("APSTHOME", System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("FDHOME"), "AVIA"));
                    //Tuple<int, string[]> res = Program.run_exe(@"c:\windows\system32\notepad.exe", param, envs);
                    Tuple <int, string[]> res = Program.run_exe(exe, param, envs);
                    if (res.Item1 == 0)
                    {
                        if (System.IO.File.Exists(System.IO.Path.Combine(dir, "HydraLogin.xml")))
                        {
                            utility.IniFile config = new utility.IniFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("FDHOME"), "AVIA", "config.ini"));
                            // load xml
                            try
                            {
                                XmlDocument doc = new XmlDocument();
                                doc.Load(System.IO.Path.Combine(dir, "HydraLogin.xml"));
                                string uid = doc.DocumentElement?["id"]?.InnerText;
                                config.WriteValue("config", "uid", uid);
                                // clear ini device section
                                utility.IniFile ini = new utility.IniFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("FDHOME"), "AVIA", "aviaDevice.ini"));
                                ini.DeleteSection("device");
                                // OE Control start
                                //OEControl.start();
                                ret = true;
                            }
                            catch (Exception) { }
                        }
                    }
                    else
                    {
                        this.Invoke(new Action(() =>
                        {
                            labelLoginStatus.Text    = $"Fail to login, error code: {res.Item1}";
                            labelLoginStatus.Visible = true;
                        }));
                    }
                }
            }
            catch (Exception)
            { }
            finally
            {
                this.Invoke(new Action(() =>
                {
                    this.UseWaitCursor = false;
                    this.Enabled       = true;
                }));
            }
            return(ret);
        }
Example #10
0
 static void handle_QueryISP_Command(System.Collections.Specialized.StringDictionary args)
 {
     if (args.ContainsKey("start-service"))
     {
         bool own;
         System.Threading.EventWaitHandle e = new System.Threading.EventWaitHandle(false, System.Threading.EventResetMode.ManualReset, eventName, out own);
         if (own)
         {
             AVIAGetPhoneSize.start(e);
         }
         else
         {
             // device monitor already started.
         }
     }
     else if (args.ContainsKey("kill-service"))
     {
         try
         {
             System.Threading.EventWaitHandle e = System.Threading.EventWaitHandle.OpenExisting(eventName);
             e.Set();
         }
         catch (Exception) { }
     }
 }
Example #11
0
 /// <summary>
 /// Parse a rfc 2822 header field with parameters
 /// </summary>
 /// <param name="field">field name</param>
 /// <param name="fieldbody">field body to parse</param>
 /// <returns>A <see cref="System.Collections.Specialized.StringDictionary" /> from the parsed field body</returns>
 public static System.Collections.Specialized.StringDictionary parseHeaderFieldBody(System.String field, System.String fieldbody)
 {
     if (fieldbody == null)
     {
         return(null);
     }
     // FIXME: rewrite parseHeaderFieldBody to being regexp based.
     fieldbody = MimeTools.uncommentString(fieldbody);
     System.Collections.Specialized.StringDictionary fieldbodycol = new System.Collections.Specialized.StringDictionary();
     System.String[] words = fieldbody.Split(new Char[] { ';' });
     if (words.Length > 0)
     {
         fieldbodycol.Add(field.ToLower(), words[0].ToLower());
         for (int i = 1; i < words.Length; i++)
         {
             System.String[] param = words[i].Trim(new Char[] { ' ', '\t' }).Split(new Char[] { '=' }, 2);
             if (param.Length == 2)
             {
                 param[0] = param[0].Trim(new Char[] { ' ', '\t' });
                 param[1] = param[1].Trim(new Char[] { ' ', '\t' });
                 if (param[1].StartsWith("\"") && !param[1].EndsWith("\""))
                 {
                     do
                     {
                         param[1] += ";" + words[++i];
                     } while  (!words[i].EndsWith("\"") && i < words.Length);
                 }
                 fieldbodycol.Add(param[0], MimeTools.parserfc2047Header(param[1].TrimEnd(';').Trim('\"')));
             }
         }
     }
     return(fieldbodycol);
 }
Example #12
0
 /// <summary>
 /// Configures the component using the dictionary of attributes specified
 /// in the configuration file.
 /// </summary>
 /// <param name="attributes">The attributes in the configuration element.</param>
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes.ContainsKey(FileExtensionAttribute))
     {
         fileExtension = attributes[FileExtensionAttribute];
     }
 }
 /// <summary>
 /// Configures the component using the dictionary of attributes specified
 /// in the configuration file.
 /// </summary>
 /// <param name="attributes">The attributes in the configuration element.</param>
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes.ContainsKey(ProjectTypeArgument))
     {
         language = (LanguageType)Enum.Parse(typeof(LanguageType), attributes[ProjectTypeArgument]);
     }
 }
Example #14
0
 static void wait_for_exit(System.Collections.Specialized.StringDictionary args)
 {
     System.Console.WriteLine("press any key to terminate.");
     System.Console.ReadKey();
     //m_service.Browse(0, 0, "_airplay", null, m_eventManager);
     System.Windows.Forms.Application.Exit();
 }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the P4Connection class.
 /// </summary>
 public P4Connection()
 {
     this._Initialized           = false;
     this._CallingProgram        = "P4.Net API";
     this._CallingProgramVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
     cachedSpecDefs = new System.Collections.Specialized.StringDictionary();
 }
 /// <summary>
 /// Configures the component using the dictionary of attributes specified
 /// in the configuration file.
 /// </summary>
 /// <param name="attributes">The attributes in the configuration element.</param>
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes.ContainsKey(ConfigurationItemArgument))
     {
         configurationArgument = attributes[ConfigurationItemArgument];
     }
 }
Example #17
0
        /// <summary>
        /// Connect to the Perforce server
        /// </summary>
        public void Connect()
        {
            // reset the cached SpecDefs
            cachedSpecDefs = new System.Collections.Specialized.StringDictionary();

            EstablishConnection(_tagged);
        }
        public override void Load(System.Collections.Specialized.StringDictionary nodeDictionary)
        {
            string subj = GetURI(nodeDictionary["ClassCode"]);

            this.LDGraph().SetNamespace("xhv", new Uri("http://www.w3.org/1999/xhtml/vocab#"));
            this.LDGraph().SetNamespace("skos", new Uri("http://www.w3.org/2004/02/skos/core#"));
            this.LDGraph().SetNamespace("rdf", new Uri("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
            this.LDGraph().CreateTriple(subj, null, "rdf:type", null, "skos:concept", null);
            this.LDGraph().CreateTriple(subj, null, "xhv:licence", null, "http://creativecommons.org/licenses/by-nc-nd/3.0/", null);
            this.LDGraph().CreateTriple(subj, null, "skos:inScheme", null, "http://mvcrq.strands.de/rqld/rqkos/rqc-scheme", null);
            if (nodeDictionary["ClassCode"] != null)
            {
                this.LDGraph().CreateTriple(subj, null, "skos:notation", null, nodeDictionary["ClassCode"], "http://mvcrq.strands.de/rqld/rqkos/rqc-schema#Notation");
            }
            if (nodeDictionary["ClassLongTitle"] != null)
            {
                this.LDGraph().CreateTriple(subj, null, "skos:prefLabel", null, nodeDictionary["ClassLongTitle"], "de");
            }
            if (nodeDictionary["ClassShortTitle"] != null)
            {
                this.LDGraph().CreateTriple(subj, null, "skos:altLabel", null, nodeDictionary["ClassShortTitle"], "de");
            }
            if (nodeDictionary["Broader"] != null)
            {
                this.LDGraph().CreateTriple(subj, null, "skos:broader", null, "http://mvcrq.strands.de/rqld/rqkos/rqc_" + nodeDictionary["Broader"], null);
            }
        }
Example #19
0
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes != null && attributes.ContainsKey(FolderNameAttribute))
     {
         folderName = attributes[FolderNameAttribute];
     }
 }
Example #20
0
        public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
        {
            settings["ConnectionBroker"]        = txtConnectionBroker.Text;
            settings["RootOU"]                  = txtRootOU.Text;
            settings["ComputersRootOU"]         = txtComputersRootOu.Text;
            settings["PrimaryDomainController"] = txtPrimaryDomainController.Text;
            settings["UseCentralNPS"]           = chkUseCentralNPS.Checked.ToString();
            settings["CentralNPS"]              = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
            settings[RdsServerSettings.ALLOWCOLLECTIONSIMPORT] = cbCollectionsImport.Checked.ToString();

            settings["GWServrsList"] = GWServers;

            try
            {
                if (upPFX.HasFile.Equals(true))
                {
                    var certificate = new RdsCertificate
                    {
                        ServiceId = PanelRequest.ServiceId,
                        Content   = Convert.ToBase64String(upPFX.FileBytes),
                        FileName  = upPFX.FileName,
                        Hash      = txtPFXInstallPassword.Text
                    };

                    ES.Services.RDS.AddRdsCertificate(certificate);
                }
            }
            catch (Exception)
            {
            }
        }
Example #21
0
        /// <summary>
        /// Initializes the converter. This method will be called when the application is starting and
        /// any converter is loaded.
        /// </summary>
        /// <param name="d"></param>
        public override void Initialize(System.Collections.Specialized.StringDictionary d)
        {
            if (d.ContainsKey("mimeType"))
            {
                mimeType = d["mimeType"];

                if (d.ContainsKey("quality"))
                {
                    long i = 0;
#if (NET20)
                    if (long.TryParse(d["quality"], out i))
                    {
                        quality = i;
                    }
#else
                    try
                    {
                        i       = long.Parse(d["quality"]);
                        quality = i;
                    }
                    catch (Exception)
                    {
                    }
#endif
                }
            }
        }
 /// <summary>
 /// Configures the component using the dictionary of attributes specified
 /// in the configuration file.
 /// </summary>
 /// <param name="attributes">The attributes in the configuration element.</param>
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes.ContainsKey("FolderName"))
     {
         folderName = attributes["FolderName"];
     }
 }
Example #23
0
 public static void startup(System.Collections.Specialized.StringDictionary args)
 {
     Program.logIt("OEControl::startup: ++");
     if (args.ContainsKey("start"))
     {
         bool own;
         System.Threading.EventWaitHandle evt = new System.Threading.EventWaitHandle(false, System.Threading.EventResetMode.AutoReset, EVENT_NAME, out own);
         if (!own)
         {
             // OE app already running.
             Program.logIt("OEControl::startup: app already running");
         }
         else
         {
             OEControl.OE_App_3_0_2_0(evt);
         }
     }
     else if (args.ContainsKey("stop"))
     {
         try
         {
             System.Threading.EventWaitHandle evt = System.Threading.EventWaitHandle.OpenExisting(EVENT_NAME);
             evt.Set();
         }
         catch (Exception) { }
     }
     Program.logIt("OEControl::startup: --");
 }
Example #24
0
        public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
        {
            settings[SfBConstants.PoolFQDN]      = txtServerName.Text.Trim();
            settings[SfBConstants.SimpleUrlRoot] = txtSimpleUrlBase.Text.Trim();

            settings["SfBServersServiceID"] = SfBServers;
        }
Example #25
0
 public HeaderInfo(System.Collections.Specialized.HybridDictionary headers)
 {
     this.TopLevelMediaType = new anmar.SharpMimeTools.MimeTopLevelMediaType();
     this.enc = null;
     try {
         this.contenttype       = anmar.SharpMimeTools.SharpMimeTools.parseHeaderFieldBody("Content-Type", headers["Content-Type"].ToString());
         this.TopLevelMediaType = (anmar.SharpMimeTools.MimeTopLevelMediaType)System.Enum.Parse(TopLevelMediaType.GetType(), this.contenttype["Content-Type"].Split('/')[0], true);
         this.subtype           = this.contenttype["Content-Type"].Split('/')[1];
         this.enc = anmar.SharpMimeTools.SharpMimeTools.parseCharSet(this.contenttype["charset"]);
     } catch (System.Exception) {
         this.enc               = anmar.SharpMimeTools.SharpMimeHeader.default_encoding;
         this.contenttype       = anmar.SharpMimeTools.SharpMimeTools.parseHeaderFieldBody("Content-Type", System.String.Concat("text/plain; charset=", this.enc.BodyName));
         this.TopLevelMediaType = anmar.SharpMimeTools.MimeTopLevelMediaType.text;
         this.subtype           = "plain";
     }
     if (this.enc == null)
     {
         this.enc = anmar.SharpMimeTools.SharpMimeHeader.default_encoding;
     }
     // TODO: rework this
     try {
         this.contentdisposition = anmar.SharpMimeTools.SharpMimeTools.parseHeaderFieldBody("Content-Disposition", headers["Content-Disposition"].ToString());
     } catch (System.Exception) {
         this.contentdisposition = new System.Collections.Specialized.StringDictionary();
     }
     try {
         this.contentlocation = anmar.SharpMimeTools.SharpMimeTools.parseHeaderFieldBody("Content-Location", headers["Content-Location"].ToString());
     } catch (System.Exception) {
         this.contentlocation = new System.Collections.Specialized.StringDictionary();
     }
 }
Example #26
0
        private void MainForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            // 保存
            System.Collections.Specialized.StringDictionary sd = new System.Collections.Specialized.StringDictionary();
            sd.Add("directory.destination", comboDestDir.Text);
            sd.Add("directory.source", comboBackupDir.Text);


            // 履歴。
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            foreach (String s in comboBackupDir.Items)
            {
                sb.Append(s).Append("\t");
            }
            sd.Add("directory.source.history", sb.ToString());
            sb.Length = 0;

            foreach (String s in comboDestDir.Items)
            {
                sb.Append(s).Append("\t");
            }
            sd.Add("directory.destination.history", sb.ToString());

            try
            {
                Misuzilla.Utilities.Setting.SaveSettings("mdumpfs.xml", sd);
            }
            catch (IOException ie)
            {
                MessageBox.Show(ie.ToString(), "mdumpfs", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #27
0
        /// <summary>
        /// Runs the specified command.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="keyValues">The key values.</param>
        /// <param name="output">The output.</param>
        /// <returns></returns>
        public override int Execute(string command, System.Collections.Specialized.StringDictionary keyValues, out string output)
        {
            output = string.Empty;

            string sourceUrl           = Params["sourceurl"].Value;
            string targetUrl           = Params["targeturl"].Value;
            bool   quiet               = Params["quiet"].UserTypedIn;
            bool   includeItemSecurity = Params["includeitemsecurity"].UserTypedIn;

            using (SPSite sourceSite = new SPSite(sourceUrl))
                using (SPSite targetSite = new SPSite(targetUrl))
                    using (SPWeb sourceWeb = sourceSite.OpenWeb())
                        using (SPWeb targetWeb = targetSite.OpenWeb())
                        {
                            SPList sourceList = Utilities.GetListFromViewUrl(sourceWeb, sourceUrl);
                            SPList targetList = Utilities.GetListFromViewUrl(targetWeb, targetUrl);

                            if (sourceList == null)
                            {
                                throw new SPException("Source list was not found.");
                            }
                            if (targetList == null)
                            {
                                throw new SPException("Target list was not found.");
                            }

                            Common.Lists.CopyListSecurity.CopySecurity(sourceList, targetList, targetWeb, includeItemSecurity, quiet);
                        }
            return((int)ErrorCodes.NoError);
        }
Example #28
0
        public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
        {
            settings[Constants.ReportingServer]             = txtReportingService.Text;
            settings[Constants.SqlServer]                   = txtSqlServer.Text;
            settings[Constants.IFDWebApplicationRootDomain] = txtDomainName.Text;
            settings[Constants.Port]          = txtPort.Text;
            settings[Constants.AppRootDomain] = txtAppRootDomain.Text;
            if (ddlCrmIpAddress.AddressId > 0)
            {
                IPAddressInfo address = ES.Services.Servers.GetIPAddress(ddlCrmIpAddress.AddressId);
                if (String.IsNullOrEmpty(address.ExternalIP))
                {
                    settings[Constants.CRMWebsiteIP] = address.InternalIP;
                }
                else
                {
                    settings[Constants.CRMWebsiteIP] = address.ExternalIP;
                }
            }
            else
            {
                settings[Constants.CRMWebsiteIP] = String.Empty;
            }

            settings[Constants.UrlSchema] = ddlSchema.SelectedValue;
        }
Example #29
0
        public string CreateUniqueEventHandlerName(string className, string objectName, string eventName)
        {
            string eventHandlerName = null;

            var codeClass = FindClass(className);

            if (codeClass != null)
            {
                System.Collections.Specialized.StringDictionary dictionary = new System.Collections.Specialized.StringDictionary();
                foreach (CodeElement element in codeClass.Members)
                {
                    string name = element.Name;
                    if (!string.IsNullOrEmpty(name))
                    {
                        dictionary[name] = name;
                    }
                }
                string str2 = objectName + "_" + eventName;
                int    num  = 0;
                eventHandlerName = str2;
                while (dictionary[eventHandlerName] != null)
                {
                    num = (int)(num + 1);
                    eventHandlerName = str2 + ((int)num).ToString(CultureInfo.InvariantCulture);
                }
            }

            return(eventHandlerName);
        }
Example #30
0
			public HeaderInfo ( System.Collections.Specialized.HybridDictionary headers ) {
				this.TopLevelMediaType = new anmar.SharpMimeTools.MimeTopLevelMediaType();
				this.enc = null;
				try {
					this.contenttype = anmar.SharpMimeTools.SharpMimeTools.parseHeaderFieldBody ( "Content-Type", headers["Content-Type"].ToString() );
					this.TopLevelMediaType = (anmar.SharpMimeTools.MimeTopLevelMediaType)System.Enum.Parse(TopLevelMediaType.GetType(), this.contenttype["Content-Type"].Split('/')[0].Trim(), true);
					this.subtype = this.contenttype["Content-Type"].Split('/')[1].Trim();
					this.enc = anmar.SharpMimeTools.SharpMimeTools.parseCharSet ( this.contenttype["charset"] );
				} catch (System.Exception) {
					this.enc = anmar.SharpMimeTools.SharpMimeHeader.default_encoding;
					this.contenttype = anmar.SharpMimeTools.SharpMimeTools.parseHeaderFieldBody ( "Content-Type", System.String.Concat("text/plain; charset=", this.enc.BodyName) );
					this.TopLevelMediaType = anmar.SharpMimeTools.MimeTopLevelMediaType.text;
					this.subtype = "plain";
				}
				if ( this.enc==null ) {
					this.enc = anmar.SharpMimeTools.SharpMimeHeader.default_encoding;
				}
				// TODO: rework this
				try {
					this.contentdisposition = anmar.SharpMimeTools.SharpMimeTools.parseHeaderFieldBody ( "Content-Disposition", headers["Content-Disposition"].ToString() );
				} catch ( System.Exception ) {
					this.contentdisposition = new System.Collections.Specialized.StringDictionary();
				}
				try {
					this.contentlocation = anmar.SharpMimeTools.SharpMimeTools.parseHeaderFieldBody ( "Content-Location", headers["Content-Location"].ToString() );
				} catch ( System.Exception ) {
					this.contentlocation = new System.Collections.Specialized.StringDictionary();
				}
			}
Example #31
0
        public ExpressionOwner()
        {
            this.InstanceB         = new ArrayList();
            this.InstanceA         = this.InstanceB;
            this.NullField         = null;
            this.DecimalA          = 100;
            this.DecimalB          = 0.25m;
            this.KeyboardA         = new Keyboard();
            this.KeyboardA.StructA = new Mouse("mouse", 123);
            this.KeyboardA.ClassA  = new Monitor();
            this.EncodingA         = System.Text.Encoding.ASCII;
            this.DelegateA         = DoAction;
            this.ICloneableArray   = new string[0];
            this.ArrayA            = new string[0];
            this.DelegateANull     = null;
            this.IComparableNull   = null;
            this.IComparableString = "string";
            this.ExceptionA        = new ArgumentException();
            this.ExceptionNull     = null;
            this.ValueTypeStructA  = new TestStruct();
            this.ObjectStringA     = "string";
            this.ObjectIntA        = 100;
            this.IComparableA      = 100.25;
            this.StructA           = new TestStruct();
            this.VersionA          = new System.Version(1, 1, 1, 1);
            this.ICloneableA       = "abc";
            this.GuidA             = Guid.NewGuid();
            this.List = new ArrayList();
            this.List.Add("a");
            this.List.Add(100);
            this.StringDict = new System.Collections.Specialized.StringDictionary();
            this.StringDict.Add("key", "value");
            this.DoubleA     = 100.25;
            this.SingleA     = 100.25f;
            this.Int32A      = 100000;
            this.StringA     = "string";
            this.BoolA       = true;
            this.TypeA       = typeof(string);
            this.ByteA       = 50;
            this.ByteB       = 2;
            this.SByteA      = -10;
            this.Int16A      = -10;
            this.UInt16A     = 100;
            this.DateTimeA   = new DateTime(2007, 7, 1);
            this.GenericDict = new Dictionary <string, int>();
            this.GenericDict.Add("a", 100);
            this.GenericDict.Add("b", 100);

            this.Dict = new Hashtable();
            this.Dict.Add(100, null);
            this.Dict.Add("abc", null);

            DataTable dt = new DataTable();

            dt.Columns.Add("ColumnA", typeof(int));

            dt.Rows.Add(100);

            this.Row = dt.Rows[0];
        }
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes.ContainsKey(ValueExpressionAttribute))
     {
         _valueExpression = attributes[ValueExpressionAttribute];
     }
 }
        internal static System.Collections.Specialized.StringDictionary ParseQuery(Uri uri)
        {
            var dic = new System.Collections.Specialized.StringDictionary();

            var queryString = uri.Query;
            if (!string.IsNullOrEmpty(uri.Query))
            {
                if (queryString.StartsWith("?"))
                {
                    queryString = queryString.Substring(1);
                }
                var fragments = queryString.Split("&".ToCharArray());
                if (fragments.Length != 0)
                {
                    foreach (var fragment in fragments)
                    {
                        var keyvalue = fragment.Split("=".ToCharArray());
                        if (keyvalue.Length == 2)
                        {
                            dic[keyvalue[0]] = keyvalue[1];
                        }
                    }
                }
            }
            return dic;
        }
Example #34
0
 public AjaxControlToolkit.CascadingDropDownNameValue[] GetYearAndQuarter(string knownCategoryValues, string category)
 {
     SqlConnection cnnValues = null;
     SqlCommand cmdValues = null;
     SqlDataReader rdValues = null;
     try
     {
         string strSQL = "";
         List<AjaxControlToolkit.CascadingDropDownNameValue> values = new List<AjaxControlToolkit.CascadingDropDownNameValue>();
         cnnValues = new SqlConnection(ConfigurationManager.ConnectionStrings["MarafonConnection"].ConnectionString);
         cnnValues.Open();
         System.Collections.Specialized.StringDictionary prm = new System.Collections.Specialized.StringDictionary();
         prm = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
         switch (category)
         {
             case "YEAR":
                 strSQL = String.Format("SELECT CAST(PACK_STORE_YEAR AS NVARCHAR(10)) AS YEAR_DESCRIPTION,CAST(PACK_STORE_YEAR AS NVARCHAR(10)) AS YEAR_ID FROM VW_INTERFACE_YEAR_QUARTER_USER WHERE UserName=N'{0}' GROUP BY PACK_STORE_YEAR ORDER BY PACK_STORE_YEAR", Session["uid"]);
                 break;
             case "QUARTER":
                 strSQL = String.Format("SELECT Q.DESCRIPTION,CAST(PSQ.PACK_STORE_QUARTER AS NVARCHAR(10)) AS PACK_STORE_QUARTER FROM VW_INTERFACE_YEAR_QUARTER_USER PSQ INNER JOIN QUARTER Q ON PSQ.PACK_STORE_QUARTER=Q.QUARTER_ID WHERE PSQ.UserName=N'{0}' AND PSQ.PACK_STORE_YEAR={1} GROUP BY PSQ.PACK_STORE_QUARTER,Q.DESCRIPTION ORDER BY PSQ.PACK_STORE_QUARTER,Q.DESCRIPTION", Session["uid"], Int32.Parse(prm["YEAR"]).ToString());
                 break;
             default:
                 strSQL = String.Format("SELECT CAST(PACK_STORE_YEAR AS NVARCHAR(10)) AS YEAR_DESCRIPTION,CAST(PACK_STORE_YEAR AS NVARCHAR(10)) AS YEAR_ID FROM VW_INTERFACE_YEAR_QUARTER_USER WHERE UserName=N'{0}' GROUP BY PACK_STORE_YEAR ORDER BY PACK_STORE_YEAR", Session["uid"]);
                 break;
         }
         cmdValues = new SqlCommand(strSQL, cnnValues);
         rdValues = cmdValues.ExecuteReader();
         while (rdValues.Read())
         {
             values.Add(new AjaxControlToolkit.CascadingDropDownNameValue(rdValues.GetString(0), rdValues.GetString(1)));
         }
         return values.ToArray();
     }
     finally
     {
         if (rdValues != null)
         {
             rdValues.Close();
             rdValues = null;
         }
         if (cmdValues != null)
         {
             cmdValues.Dispose();
             cmdValues = null;
         }
         if (cnnValues != null)
         {
             cnnValues.Close();
             cnnValues = null;
         }
     }
 }
Example #35
0
 public AjaxControlToolkit.CascadingDropDownNameValue[] GetDropDownAB(string knownCategoryValues, string category)
 {
     SqlConnection cnnValues = null;
     SqlCommand cmdValues = null;
     SqlDataReader rdValues = null;
     try
     {
         string strSQL="";
         List<AjaxControlToolkit.CascadingDropDownNameValue> values =  new List<AjaxControlToolkit.CascadingDropDownNameValue>();
         cnnValues = new SqlConnection(ConfigurationManager.ConnectionStrings["MarafonConnection"].ConnectionString);
         cnnValues.Open();
         System.Collections.Specialized.StringDictionary prm = new System.Collections.Specialized.StringDictionary();
         prm = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
         switch (category)
         {
             case "TRADE_AB":
                 strSQL = "SELECT TRADE_AB_DESCRIPTION,TRADE_AB_ID FROM VW_INTERFACE_AB GROUP BY TRADE_AB_DESCRIPTION,TRADE_AB_ID ORDER BY TRADE_AB_DESCRIPTION";
                 break;
             case "TABLET_PACK":
                 strSQL = String.Format("SELECT TABLET_PACK_DESCRIPTION,TABLET_PACK_ID FROM VW_INTERFACE_AB WHERE TRADE_AB_ID={0} AND TRADE_AB_ID IS NOT NULL", Int32.Parse(prm["TRADE_AB"]).ToString());
                 break;
             default:
                 strSQL = "SELECT TRADE_AB_DESCRIPTION,TRADE_AB_ID FROM VW_INTERFACE_AB GROUP BY TRADE_AB_DESCRIPTION,TRADE_AB_ID ORDER BY TRADE_AB_DESCRIPTION";
                 break;
         }
         cmdValues = new SqlCommand(strSQL,cnnValues);
         rdValues = cmdValues.ExecuteReader();
         while (rdValues.Read())
         {
             values.Add(new AjaxControlToolkit.CascadingDropDownNameValue((rdValues.GetString(0) == null) ? "-" : rdValues.GetString(0), rdValues.GetInt32(1).ToString()));
         }
         return values.ToArray();
     }
     finally
     {
         if (rdValues!=null)
         {
             rdValues.Close();
             rdValues = null;
         }
         if (cmdValues!=null)
         {
             cmdValues.Dispose();
             cmdValues = null;
         }
         if (cnnValues!=null)
         {
             cnnValues.Close();
             cnnValues = null;
         }
     }
 }
 /// <summary>
 /// Toes the dictionary.
 /// </summary>
 /// <param name="row">The row.</param>
 /// <returns></returns>
 public static System.Collections.Specialized.StringDictionary ToDictionary(this DataRow row)
 {
     DataColumnCollection columns = row.Table.Columns;
     System.Collections.Specialized.StringDictionary dic = new System.Collections.Specialized.StringDictionary();
     foreach (DataColumn dc in columns)
     {
         if(row.IsNull(dc) == false)
         {
             dic.Add(dc.ColumnName, row[dc].ToString());
         }
     }
     return dic;
 }
Example #37
0
        private void SearchPrinterForm_Load(object sender, EventArgs e)
        {
            this.listBox1.Focus();
            //BTPrintClass.PrintClass.BTPrinterInit();
            BTPrintClass.PrintClass.SearchDevices();
            stringDict = BTPrintClass.PrintClass.GetFoundedDevicesDict();

            foreach (string s in stringDict.Keys)
            {
                this.listBox1.Items.Add(stringDict[s]);
            }
            this.Refresh();



        }
Example #38
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            btnSend.Enabled = false;
            System.Collections.Specialized.StringDictionary dictionary = new System.Collections.Specialized.StringDictionary();
            dictionary.Add("application", ApplicationName);
            dictionary.Add("version", Version);
            dictionary.Add("error", Ex.Message.Trim());
            dictionary.Add("inner_exception", Ex.InnerException == null ? "" : Ex.InnerException.Message.Trim());
            dictionary.Add("stacktrace", FormatForXml(Ex.StackTrace.Trim()));

            // Temporary error reporting mechanism

            ClipboardText = FormatErrorAsXml(dictionary);
            System.Threading.Thread t = new System.Threading.Thread(CopyToClipboardThreadSafe);
            t.SetApartmentState(System.Threading.ApartmentState.STA);
            t.Start();

            // end temp

            //if (Utility.SendHttpPost(SubmitUrl, dictionary))
            //{
            //    Cursor = Cursors.Default;
            //    lblBoldPleed.Text = "Successfully reported.";
            //    txtDescription.Visible = false;
            //    lblGeneralDescription.Visible = false;
            //    chkIgnore.Visible = false;
            //    btnDontSend.Text = "Close";
            //}
            //else
            //{
            //    Cursor = Cursors.Default;
            //    btnSend.Enabled = true;

            //    if (MessageBox.Show("Message could not be sent. Do you want to copy the message to your clipboard so that you can paste it into an email to [email protected]?", "Unsuccessful", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            //    {
            //        ClipboardText = FormatErrorAsXml(dictionary);
            //        System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(CopyToClipboardThreadSafe));
            //        t.SetApartmentState(System.Threading.ApartmentState.STA);
            //        t.Start();
            //    }
            //}
        }
Example #39
0
        ICollection Recommended_CreateDataSource()
        {
            // Recommended Show begin
            Recommended_sSQL = "";
            Recommended_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            //-------------------------------
            // Build ORDER BY statement
            //-------------------------------
            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

              sWhere = " WHERE is_recommended=1";

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            Recommended_sSQL = "select [i].[author] as i_author, " +
            "[i].[image_url] as i_image_url, " +
            "[i].[item_id] as i_item_id, " +
            "[i].[name] as i_name, " +
            "[i].[price] as i_price " +
            " from [items] i ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              Recommended_sSQL = Recommended_sSQL + sWhere + sOrder;
              if (Recommended_sCountSQL.Length== 0) {
            int iTmpI = Recommended_sSQL.ToLower().IndexOf("select ");
            int iTmpJ = Recommended_sSQL.ToLower().LastIndexOf(" from ")-1;
            Recommended_sCountSQL = Recommended_sSQL.Replace(Recommended_sSQL.Substring(iTmpI + 7, iTmpJ-6), " count(*) ");
            iTmpI = Recommended_sCountSQL.ToLower().IndexOf(" order by");
            if (iTmpI > 1) Recommended_sCountSQL = Recommended_sCountSQL.Substring(0, iTmpI);
              }

            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(Recommended_sSQL, Utility.Connection);
            DataSet ds = new DataSet();

            command.Fill(ds, (i_Recommended_curpage - 1) * Recommended_PAGENUM, Recommended_PAGENUM,"Recommended");
            OleDbCommand ccommand = new OleDbCommand(Recommended_sCountSQL, Utility.Connection);
            int PageTemp=(int)ccommand.ExecuteScalar();
            Recommended_Pager.MaxPage=(PageTemp%Recommended_PAGENUM)>0?(int)(PageTemp/Recommended_PAGENUM)+1:(int)(PageTemp/Recommended_PAGENUM);
            bool AllowScroller=Recommended_Pager.MaxPage==1?false:true;

            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            Recommended_no_records.Visible = true;
            AllowScroller=false;}
            else
            {Recommended_no_records.Visible = false;
            AllowScroller=AllowScroller&&true;}

            Recommended_Pager.Visible=AllowScroller;
            return Source;
            // Recommended Show end
        }
Example #40
0
        ICollection Categories_CreateDataSource()
        {
            // Categories Show begin
            Categories_sSQL = "";
            Categories_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            Categories_sSQL = "select [c].[category_id] as c_category_id, " +
            "[c].[name] as c_name " +
            " from [categories] c ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              Categories_sSQL = Categories_sSQL + sWhere + sOrder;
            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(Categories_sSQL, Utility.Connection);
            DataSet ds = new DataSet();

            command.Fill(ds, 0, Categories_PAGENUM, "Categories");
            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            Categories_no_records.Visible = true;
            }
            else
            {Categories_no_records.Visible = false;
            }

            return Source;
            // Categories Show end
        }
Example #41
0
        ICollection Items_CreateDataSource()
        {
            // Items Show begin
            Items_sSQL = "";
            Items_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            //-------------------------------
            // Build ORDER BY statement
            //-------------------------------
            if(Utility.GetParam("FormItems_Sorting").Length>0&&!IsPostBack)
            {ViewState["SortColumn"]=Utility.GetParam("FormItems_Sorting");
             ViewState["SortDir"]="ASC";}
            if(ViewState["SortColumn"]!=null) sOrder = " ORDER BY " + ViewState["SortColumn"].ToString()+" "+ViewState["SortDir"].ToString();

            //-------------------------------
            // Build WHERE statement
            //-------------------------------
            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

            if(!Params.ContainsKey("category_id")){
            string temp=Utility.GetParam("category_id");
            if (Utility.IsNumeric(null,temp) && temp.Length>0) { temp = CCUtility.ToSQL(temp, FieldTypes.Number);} else {temp = "";}
            Params.Add("category_id",temp);}

            if(!Params.ContainsKey("is_recommended")){
            string temp=Utility.GetParam("is_recommended");
            if (Utility.IsNumeric(null,temp) && temp.Length>0) { temp = CCUtility.ToSQL(temp, FieldTypes.Number);} else {temp = "";}
            Params.Add("is_recommended",temp);}

              if (Params["category_id"].Length>0) {
            HasParam = true;
            sWhere +="i.[category_id]=" + Params["category_id"];
              }
              if (Params["is_recommended"].Length>0) {
            if (sWhere.Length >0) sWhere +=" and ";
            HasParam = true;
            sWhere +="i.[is_recommended]=" + Params["is_recommended"];
              }

              if(HasParam)
            sWhere = " AND (" + sWhere + ")";

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            Items_sSQL = "select [i].[author] as i_author, " +
            "[i].[category_id] as i_category_id, " +
            "[i].[is_recommended] as i_is_recommended, " +
            "[i].[item_id] as i_item_id, " +
            "[i].[name] as i_name, " +
            "[i].[price] as i_price, " +
            "[c].[category_id] as c_category_id, " +
            "[c].[name] as c_name " +
            " from [items] i, [categories] c" +
            " where [c].[category_id]=i.[category_id]  ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              Items_sSQL = Items_sSQL + sWhere + sOrder;
              if (Items_sCountSQL.Length== 0) {
            int iTmpI = Items_sSQL.ToLower().IndexOf("select ");
            int iTmpJ = Items_sSQL.ToLower().LastIndexOf(" from ")-1;
            Items_sCountSQL = Items_sSQL.Replace(Items_sSQL.Substring(iTmpI + 7, iTmpJ-6), " count(*) ");
            iTmpI = Items_sCountSQL.ToLower().IndexOf(" order by");
            if (iTmpI > 1) Items_sCountSQL = Items_sCountSQL.Substring(0, iTmpI);
              }

            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(Items_sSQL, Utility.Connection);
            DataSet ds = new DataSet();

            command.Fill(ds, (i_Items_curpage - 1) * Items_PAGENUM, Items_PAGENUM,"Items");
            OleDbCommand ccommand = new OleDbCommand(Items_sCountSQL, Utility.Connection);
            int PageTemp=(int)ccommand.ExecuteScalar();
            Items_Pager.MaxPage=(PageTemp%Items_PAGENUM)>0?(int)(PageTemp/Items_PAGENUM)+1:(int)(PageTemp/Items_PAGENUM);
            bool AllowScroller=Items_Pager.MaxPage==1?false:true;

            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            Items_no_records.Visible = true;
            AllowScroller=false;}
            else
            {Items_no_records.Visible = false;
            AllowScroller=AllowScroller&&true;}

            Items_Pager.Visible=AllowScroller;
            return Source;
            // Items Show end
        }
Example #42
0
        ICollection replies_CreateDataSource()
        {
            // replies Show begin
            replies_sSQL = "";
            replies_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            //-------------------------------
            // Build ORDER BY statement
            //-------------------------------
            sOrder = " order by m.date_entered Desc";
            //-------------------------------
            // Build WHERE statement
            //-------------------------------
            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

            if(!Params.ContainsKey("mid")){
            string temp=Utility.GetParam("mid");
            if (Utility.IsNumeric(null,temp) && temp.Length>0) { temp = CCUtility.ToSQL(temp, FieldTypes.Number);} else {temp = "";}
            Params.Add("mid",temp);}

              if (Params["mid"].Length>0) {
            HasParam = true;
            sWhere +="m.[message_parent_id]=" + Params["mid"];
              }

              if(HasParam)
            sWhere = " WHERE (" + sWhere + ")";

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            replies_sSQL = "select [m].[author] as m_author, " +
            "[m].[date_entered] as m_date_entered, " +
            "[m].[message] as m_message, " +
            "[m].[message_parent_id] as m_message_parent_id, " +
            "[m].[smiley_id] as m_smiley_id, " +
            "[m].[topic] as m_topic " +
            " from [messages] m ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              replies_sSQL = replies_sSQL + sWhere + sOrder;
              if (replies_sCountSQL.Length== 0) {
            int iTmpI = replies_sSQL.ToLower().IndexOf("select ");
            int iTmpJ = replies_sSQL.ToLower().LastIndexOf(" from ")-1;
            replies_sCountSQL = replies_sSQL.Replace(replies_sSQL.Substring(iTmpI + 7, iTmpJ-6), " count(*) ");
            iTmpI = replies_sCountSQL.ToLower().IndexOf(" order by");
            if (iTmpI > 1) replies_sCountSQL = replies_sCountSQL.Substring(0, iTmpI);
              }

            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(replies_sSQL, Utility.Connection);
            DataSet ds = new DataSet();

            command.Fill(ds, (i_replies_curpage - 1) * replies_PAGENUM, replies_PAGENUM,"replies");
            OleDbCommand ccommand = new OleDbCommand(replies_sCountSQL, Utility.Connection);
            int PageTemp=(int)ccommand.ExecuteScalar();
            replies_Pager.MaxPage=(PageTemp%replies_PAGENUM)>0?(int)(PageTemp/replies_PAGENUM)+1:(int)(PageTemp/replies_PAGENUM);
            bool AllowScroller=replies_Pager.MaxPage==1?false:true;

            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            replies_no_records.Visible = true;
            AllowScroller=false;}
            else
            {replies_no_records.Visible = false;
            AllowScroller=AllowScroller&&true;}

            replies_Pager.Visible=AllowScroller;
            return Source;
            // replies Show end
        }
Example #43
0
        /// <summary>
        /// 删除
        /// </summary>
        protected override void SetDeleteInit()
        {
            try
            {
                int result = 0;
                //选择所有选择的数据
                DataRow[] drs = this.GetSelectList();

                //没有选择任何数据情况
                if (drs.Length <= 0)
                {
                    XtraMsgBox.Show("未勾选任何数据!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (XtraMsgBox.Show("是否删除数据?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
                {
                    Common.AdoConnect.Connect.CreateSqlTransaction();
                    if (drs.Length > 0)
                    {
                        for (int i = 0; i < drs.Length; i++)
                        {
                            DataRow dr = drs[i];
                            m_dicItemData = new System.Collections.Specialized.StringDictionary();
                            m_dicItemData["ID"] = dr["ID"].ToString();
                            m_dicPrimarName["ID"] = dr["ID"].ToString();

                            result = SysParam.m_daoCommon.SetDeleteDataItem("Attend_Move", m_dicItemData, m_dicPrimarName);
                            if (result > 0)
                            {
                                //日志
                                SysParam.m_daoCommon.WriteLog("调动登记:", "删除", dr["UserID"].ToString());
                            }
                        }
                    }
                }
                if (result > 0)
                {
                    Common.AdoConnect.Connect.TransactionCommit();
                    XtraMsgBox.Show("删除数据成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                   
                    SetSearchProc(this);
                }
            }
            catch (Exception ex)
            {
                Common.AdoConnect.Connect.TransactionRollback();
                log.Error(ex);
                XtraMsgBox.Show("删除数据失败!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #44
0
 public Fltr(int DId, int Id)
 {
     _did = DId;
     _id = Id;
     DataRow _row = SelectFilter(DId, _id);
     _uid = (int)_row["UId"];
     if (_row == null) return;
     _name = _row["Name"].ToString();
     _reptype = (ReportType)(byte)_row["ReportType"];
     string[] _state = _row["FilterState"].ToString().Split('&');
     System.Collections.Specialized.StringDictionary _sd = new System.Collections.Specialized.StringDictionary();
     for (int i = 0; i < _state.Length; i++)
     {
         if (_state[i].Length == 0) continue;
         string[] _item = _state[i].Split('=');
         if (_item.Length > 1) _sd.Add(_item[0], _item[1]);
         else _sd.Add(_item[0], string.Empty);
     }
     string[] expectedFormats = { "MM/dd/yyyy HH:mm:ss", "MM/dd/yyyyHH:mm:ss", "MM.dd.yyyy HH:mm:ss", "MM.dd.yyyyHH:mm:ss" };
     IFormatProvider culture = new CultureInfo("en-US", false);
     if (_sd.ContainsKey("ds") && _sd["ds"].Length > 0) _start = DateTime.ParseExact(HttpUtility.UrlDecode(_sd["ds"]), expectedFormats, culture, DateTimeStyles.None);
     if (_sd.ContainsKey("de") && _sd["de"].Length > 0) _end = DateTime.ParseExact(HttpUtility.UrlDecode(_sd["de"]), expectedFormats, culture, DateTimeStyles.None);
     if (_sd.ContainsKey("dr") && _sd["dr"].Length > 0) this.DateRange = ConvertStringToRange(HttpUtility.UrlDecode(_sd["dr"]));
     if (_sd.ContainsKey("ya") && _sd["ya"].Length > 0)
     {
         string _val = HttpUtility.UrlDecode(_sd["ya"]);
         if (_val.IndexOf(Grouping.Location.ToString()) >= 0)
         {
             _yaxis = Grouping.Location;
             _locationtype = int.Parse(_val.Split(',')[1]);
         }
         else if (_val.IndexOf(Grouping.Class.ToString()) >= 0)
         {
             _yaxis = Grouping.Class;
             string[] _arr = _val.Split(',');
             if (_arr.Length > 1) _classlevel = int.Parse(_arr[1]);
         }
         else _yaxis = (Grouping)Enum.Parse(typeof(Grouping), _val, true);
     }
     if (_sd.ContainsKey("sya") && _sd["sya"].Length > 0)
     {
         string _val = HttpUtility.UrlDecode(_sd["sya"]);
         if (_val.IndexOf(Grouping.Location.ToString()) >= 0)
         {
             _subyaxis = Grouping.Location;
             _sublocationtype = int.Parse(_val.Split(',')[1]);
         }
         else if (_val.IndexOf(Grouping.Class.ToString()) >= 0)
         {
             _subyaxis = Grouping.Class;
             string[] _arr = _val.Split(',');
             if (_arr.Length > 1) _subclasslevel = int.Parse(_arr[1]);
         }
         else _subyaxis = (Grouping)Enum.Parse(typeof(Grouping), _val, true);
     }
     if (_sd.ContainsKey("prt") && _sd["prt"].Length > 0) _priority = int.Parse(_sd["prt"]);
     if (_sd.ContainsKey("cls") && _sd["cls"].Length > 0) _class = int.Parse(_sd["cls"]);
     if (_sd.ContainsKey("ctg") && _sd["ctg"].Length > 0) _creationcategory = int.Parse(_sd["ctg"]);
     if (_sd.ContainsKey("stg") && _sd["stg"].Length > 0) _submissioncat = int.Parse(_sd["stg"]);
     if (_sd.ContainsKey("rtg") && _sd["rtg"].Length > 0) _resolutioncat = int.Parse(_sd["rtg"]);
     if (_sd.ContainsKey("lct") && _sd["lct"].Length > 0) _location = int.Parse(_sd["lct"]);
     if (_sd.ContainsKey("tch") && _sd["tch"].Length > 0) _technician = int.Parse(_sd["tch"]);
     if (_sd.ContainsKey("sby") && _sd["sby"].Length > 0) _submittedby = int.Parse(_sd["sby"]);
     if (_sd.ContainsKey("cby") && _sd["cby"].Length > 0) _closedby = int.Parse(_sd["cby"]);
     if (_sd.ContainsKey("acc") && _sd["acc"].Length > 0) _account = int.Parse(_sd["acc"]);
     if (_sd.ContainsKey("accl") && _sd["accl"].Length > 0) _accountLocation = int.Parse(_sd["accl"]);
     if (_sd.ContainsKey("accpl") && _sd["accpl"].Length > 0) _accountParentLocation = int.Parse(_sd["accpl"]);
     if (_sd.ContainsKey("tcht") && _sd["tcht"].Length > 0) technicianType = (TechnicianType)Enum.Parse(typeof(TechnicianType), HttpUtility.UrlDecode(_sd["tcht"]), true);
     if (_sd.ContainsKey("hcc") && _sd["hcc"].Length > 0) handledByCallCenter = (HandledByCallCenter)Enum.Parse(typeof(HandledByCallCenter), HttpUtility.UrlDecode(_sd["hcc"]), true);
     if (_sd.ContainsKey("lvl") && _sd["lvl"].Length > 0) _ticket_level = int.Parse(_sd["lvl"]);
     if (_sd.ContainsKey("sg") && _sd["sg"].Length > 0) _support_group = int.Parse(_sd["sg"]);
     if (_sd.ContainsKey("age") && _sd["age"].Length > 0) _age = int.Parse(_sd["age"]);
     if (_sd.ContainsKey("ager") && _sd["ager"].Length > 0) _age_equal = (EqualRange)Enum.Parse(typeof(EqualRange), HttpUtility.UrlDecode(_sd["ager"]), true);
     if (_sd.ContainsKey("ass") && _sd["ass"].Length > 0) _asset_filter = HttpUtility.UrlDecode(_sd["ass"]);
     if (_sd.ContainsKey("slaw") && _sd["slaw"].Length > 0) _sla_graph_width_id = int.Parse(_sd["slaw"]);
     if (_sd.ContainsKey("slag") && _sd["slag"].Length > 0) _sla_graph_view_id = int.Parse(_sd["slag"]);
 }
        /// <summary>
        /// Saves the settings to disk.
        /// </summary>
        public void Save()
        {
            System.Collections.Specialized.StringDictionary dic = new System.Collections.Specialized.StringDictionary();
            Type settingsType = this.GetType();

            //------------------------------------------------------------
            //	Enumerate through settings properties
            //------------------------------------------------------------
            foreach (PropertyInfo propertyInformation in settingsType.GetProperties())
            {
                if (propertyInformation.Name != "Instance")
                {
                    //------------------------------------------------------------
                    //	Extract property value and its string representation
                    //------------------------------------------------------------
                    object propertyValue = propertyInformation.GetValue(this, null);

                    string valueAsString;
                    //------------------------------------------------------------
                    //	Format null/default property values as empty strings
                    //------------------------------------------------------------
                    if (propertyValue == null || propertyValue.Equals(Int32.MinValue) || propertyValue.Equals(Single.MinValue))
                    {
                        valueAsString = String.Empty;
                    }
                    else
                    {
                        valueAsString = propertyValue.ToString();
                    }
                    //------------------------------------------------------------
                    //	Write property name/value pair
                    //------------------------------------------------------------
                    dic.Add(propertyInformation.Name, valueAsString);
                }
            }

            Providers.TrainService.SaveSettings(dic);
            OnChanged();
        }
Example #46
0
        ICollection Orders_CreateDataSource()
        {
            // Orders Show begin
            Orders_sSQL = "";
            Orders_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            //-------------------------------
            // Build ORDER BY statement
            //-------------------------------
            sOrder = " order by o.order_id Asc";
            if(Utility.GetParam("FormOrders_Sorting").Length>0&&!IsPostBack)
            {ViewState["SortColumn"]=Utility.GetParam("FormOrders_Sorting");
             ViewState["SortDir"]="ASC";}
            if(ViewState["SortColumn"]!=null) sOrder = "ORDER BY @SortColumn @SortDir";

            //-------------------------------
            // Build WHERE statement
            //-------------------------------
            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

            if(!Params.ContainsKey("item_id")){
            string temp=Utility.GetParam("item_id");
            if (Utility.IsNumeric(null,temp) && temp.Length>0) { temp = CCUtility.ToSQL(temp, FieldTypes.Number);} else {temp = "";}
            Params.Add("item_id",temp);}

            if(!Params.ContainsKey("member_id")){
            string temp=Utility.GetParam("member_id");
            if (Utility.IsNumeric(null,temp) && temp.Length>0) { temp = CCUtility.ToSQL(temp, FieldTypes.Number);} else {temp = "";}
            Params.Add("member_id",temp);}

              if (Params["item_id"].Length>0) {
            HasParam = true;
            sWhere +="o.[item_id]=" + Params["item_id"];
              }
              if (Params["member_id"].Length>0) {
            if (sWhere.Length >0) sWhere +=" and ";
            HasParam = true;
            sWhere +="o.[member_id]=" + Params["member_id"];
              }

              if(HasParam)
            sWhere = " AND (" + sWhere + ")";

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            Orders_sSQL = "select [o].[item_id] as o_item_id, " +
            "[o].[member_id] as o_member_id, " +
            "[o].[order_id] as o_order_id, " +
            "[o].[quantity] as o_quantity, " +
            "[i].[item_id] as i_item_id, " +
            "[i].[name] as i_name, " +
            "[m].[member_id] as m_member_id, " +
            "[m].[member_login] as m_member_login " +
            " from [orders] o, [items] i, [members] m" +
            " where [i].[item_id]=o.[item_id] and [m].[member_id]=o.[member_id]  ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              Orders_sSQL = Orders_sSQL + sWhere + sOrder;
              if (Orders_sCountSQL.Length== 0) {
            int iTmpI = Orders_sSQL.ToLower().IndexOf("select ");
            int iTmpJ = Orders_sSQL.ToLower().LastIndexOf(" from ")-1;
            Orders_sCountSQL = Orders_sSQL.Replace(Orders_sSQL.Substring(iTmpI + 7, iTmpJ-6), " count(*) ");
            iTmpI = Orders_sCountSQL.ToLower().IndexOf(" order by");
            if (iTmpI > 1) Orders_sCountSQL = Orders_sCountSQL.Substring(0, iTmpI);
              }

            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(Orders_sSQL, Utility.Connection);
                    command.SelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter("@SortColumn", viewstate["SortColumn"]));
                    command.SelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter("@SortDir", viewstate["SortDir"]));

            DataSet ds = new DataSet();

            command.Fill(ds, (i_Orders_curpage - 1) * Orders_PAGENUM, Orders_PAGENUM,"Orders");
            OleDbCommand ccommand = new OleDbCommand(Orders_sCountSQL, Utility.Connection);
            int PageTemp=(int)ccommand.ExecuteScalar();
            Orders_Pager.MaxPage=(PageTemp%Orders_PAGENUM)>0?(int)(PageTemp/Orders_PAGENUM)+1:(int)(PageTemp/Orders_PAGENUM);
            bool AllowScroller=Orders_Pager.MaxPage==1?false:true;

            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            Orders_no_records.Visible = true;
            AllowScroller=false;}
            else
            {Orders_no_records.Visible = false;
            AllowScroller=AllowScroller&&true;}

            Orders_Pager.Visible=AllowScroller;
            return Source;
            // Orders Show end
        }
Example #47
0
        ICollection original_CreateDataSource()
        {
            // original Show begin
            original_sSQL = "";
            original_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            //-------------------------------
            // Build WHERE statement
            //-------------------------------
            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

            if(!Params.ContainsKey("mid")){
            string temp=Utility.GetParam("mid");
            if (Utility.IsNumeric(null,temp) && temp.Length>0) { temp = CCUtility.ToSQL(temp, FieldTypes.Number);} else {temp = "";}
            Params.Add("mid",temp);}

              if (Params["mid"].Length>0) {
            HasParam = true;
            sWhere +="m.[message_id]=" + Params["mid"];
              }

              if(HasParam)
            sWhere = " WHERE (" + sWhere + ")";

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            original_sSQL = "select [m].[author] as m_author, " +
            "[m].[date_entered] as m_date_entered, " +
            "[m].[message] as m_message, " +
            "[m].[message_id] as m_message_id, " +
            "[m].[topic] as m_topic " +
            " from [messages] m ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              original_sSQL = original_sSQL + sWhere + sOrder;
            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(original_sSQL, Utility.Connection);
            DataSet ds = new DataSet();

            command.Fill(ds, 0, original_PAGENUM, "original");
            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            original_no_records.Visible = true;
            }
            else
            {original_no_records.Visible = false;
            }

            return Source;
            // original Show end
        }
Example #48
0
        /// <summary>
        /// Instantiates a client for a service endpoint, access key ID and secret access key.
        /// </summary>
        /// <param name="serviceEndpoint">The service endpoint receiving and processing mturk 
        /// requests. If null, defaults to the sandbox endpoint at
        /// <c>https://mechanicalturk.sandbox.amazonaws.com?Service=AWSMechanicalTurkRequester</c></param>
        /// <param name="accessKeyId">Required: The access key ID for the Amazon Web Services account</param>
        /// <param name="secretAccessKey">Required: The secret access key for the Amazon Web Services account</param>
        public MTurkConfig(string serviceEndpoint, string accessKeyId, string secretAccessKey)
        {
            System.Collections.Specialized.StringDictionary ctx = new System.Collections.Specialized.StringDictionary();
            ctx.Add("MechanicalTurk.ServiceEndpoint", serviceEndpoint);
            ctx.Add("MechanicalTurk.AccessKeyId", accessKeyId);
            ctx.Add("MechanicalTurk.SecretAccessKey", secretAccessKey);

            _context = ctx;
            Init();
        }
Example #49
0
 /// <summary>
 /// Instantiates the client configuration by reading the application configuration from the context passed.
 /// </summary>
 /// <param name="context">Configuration with the following values:
 /// <list type="bullet">
 /// <item>
 /// 	<term>MechanicalTurk.ServiceEndpoint</term>
 /// 	<description>
 /// 	The service endpoint receiving and processing mturk requests. Defaults to the sandbox endpoint at
 ///     <c>https://mechanicalturk.sandbox.amazonaws.com?Service=AWSMechanicalTurkRequester</c>
 /// 	</description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.AccessKeyId</term>
 /// 	<description>Required: The access key ID for the Amazon Web Services account</description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.SecretAccessKey</term>
 /// 	<description>Required: The secret access key for the Amazon Web Services account</description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.Log.Level</term>
 /// 	<description>The log level for SDK log messages (<see cref="ILog"/> for details). Defaults to 2 (Info)</description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.Proxy.Url</term>
 /// 	<description>
 ///     Proxy URL (only necessary when used through a web proxy that requires authentication)
 ///     </description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.Proxy.User</term>
 /// 	<description>
 ///     User name for proxy credentials (only necessary when used through a web proxy that 
 ///     requires authentication)
 ///     </description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.Proxy.Password</term>
 /// 	<description>
 ///     Password for proxy credentials (only necessary when used through a web proxy 
 ///     that requires authentication)
 ///     </description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.Proxy.Domain</term>
 /// 	<description>
 ///     User domain for proxy credentials (only necessary when used through a web proxy 
 ///     that requires authentication)
 ///     </description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.MiscOptions.EnsureQuestionsAreXmlWrapped</term>
 /// 	<description>
 ///     If set to true (default), ensures that questions are wrapped as XML when sent to
 ///     Mechanical Turk.
 ///     </description>
 /// </item>
 /// <item>
 /// 	<term>MechanicalTurk.MiscOptions.EnsureQuestionValidity</term>
 /// 	<description>
 ///     If set to true (default is false), ensures that questions are validated before 
 ///     they are sent to Mechanical Turk
 ///     </description>
 /// </item>
 /// </list>
 /// </param>
 public MTurkConfig(System.Collections.Specialized.StringDictionary context)
 {
     _context = context;
     Init();
 }
Example #50
0
        ICollection CardTypes_CreateDataSource()
        {
            // CardTypes Show begin
            CardTypes_sSQL = "";
            CardTypes_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            //-------------------------------
            // Build ORDER BY statement
            //-------------------------------
            sOrder = " order by c.name Asc";
            if(Utility.GetParam("FormCardTypes_Sorting").Length>0&&!IsPostBack)
            {ViewState["SortColumn"]=Utility.GetParam("FormCardTypes_Sorting");
             ViewState["SortDir"]="ASC";}
            if(ViewState["SortColumn"]!=null) sOrder = "ORDER BY @SortColumn @SortDir";

            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            CardTypes_sSQL = "select [c].[card_type_id] as c_card_type_id, " +
            "[c].[name] as c_name " +
            " from [card_types] c ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              CardTypes_sSQL = CardTypes_sSQL + sWhere + sOrder;
            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(CardTypes_sSQL, Utility.Connection);
            command.SelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter("@SortColumn", viewstate["SortColumn"]));
            command.SelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter("@SortDir", viewstate["SortDir"]));
            DataSet ds = new DataSet();

            command.Fill(ds, 0, CardTypes_PAGENUM, "CardTypes");
            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            CardTypes_no_records.Visible = true;
            }
            else
            {CardTypes_no_records.Visible = false;
            }

            return Source;
            // CardTypes Show end
        }
Example #51
0
        ICollection What_CreateDataSource()
        {
            // What Show begin
            What_sSQL = "";
            What_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

              sWhere = " WHERE editorial_cat_id=1";

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            What_sSQL = "select [e].[article_desc] as e_article_desc, " +
            "[e].[article_title] as e_article_title, " +
            "[e].[item_id] as e_item_id " +
            " from [editorials] e ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              What_sSQL = What_sSQL + sWhere + sOrder;
            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(What_sSQL, Utility.Connection);
            DataSet ds = new DataSet();

            command.Fill(ds, 0, What_PAGENUM, "What");
            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            What_no_records.Visible = true;
            }
            else
            {What_no_records.Visible = false;
            }

            return Source;
            // What Show end
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="RtnValue"></param>
        public override void SetModifyProc(ref int RtnValue)
        {
            DateTime dtBegin = DateTime.Now;
            DateTime dtEnd = DateTime.Now;

            base.SetModifyProc(ref RtnValue);
            try
            {
                m_dicPrimarName.Clear();
                m_dicPrimarName["myID"] = txtID.Text.Trim();
                m_dicItemData = new System.Collections.Specialized.StringDictionary();
                m_dicItemData["UserID"] = txtUserID.Text.Trim();
                m_dicItemData["VacationType"] = this.lookVacationType.EditValue.ToString();
                m_dicItemData["Memo"] = textVacationMemo.Text.Trim();// 请假事由
                m_dicItemData["BgnDate"] = DateTime.Parse(dateVacationBgnDate.EditValue.ToString()).ToString("yyyy-MM-dd hh:mm:ss");
                m_dicItemData["EndDate"] = DateTime.Parse(dateVacationEndDate.EditValue.ToString()).ToString("yyyy-MM-dd hh:mm:ss");
                m_dicItemData["OperID"] = Common._personid;
                m_dicItemData["OperDate"] = System.DateTime.Now.ToString();

                int result = SysParam.m_daoCommon.SetModifyDataItem(this.TableName, m_dicItemData, m_dicPrimarName);
                if (result > 0)
                {
                    XtraMsgBox.Show("修改数据成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //日志
                    SysParam.m_daoCommon.WriteLog("请假登记", "修改", txtUserID.Text.Trim() + " 在" + dateVacationBgnDate.EditValue.ToString() + "记录");
                    DialogResult = DialogResult.OK;
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                throw ex;
            }
        }
Example #53
0
ICollection Categories_CreateDataSource() {

       
       // Categories Show begin
	Categories_sSQL = "";
	Categories_sCountSQL = "";

	string sWhere = "", sOrder = "";

	
	bool HasParam = false;
	
	
	//-------------------------------
	// Build ORDER BY statement
	//-------------------------------
	sOrder = " order by c.name Asc";
	if(Utility.GetParam("FormCategories_Sorting").Length>0&&!IsPostBack)
	{ViewState["SortColumn"]=Utility.GetParam("FormCategories_Sorting");
	 ViewState["SortDir"]="ASC";}
	if(ViewState["SortColumn"]!=null) sOrder = " ORDER BY " + ViewState["SortColumn"].ToString()+" "+ViewState["SortDir"].ToString();
	
	System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();
	
	

	

	//-------------------------------
	// Build base SQL statement
	//-------------------------------


	Categories_sSQL = "select [c].[category_id] as c_category_id, " +
    "[c].[name] as c_name " +
    " from [categories] c ";
	
	//-------------------------------
	//-------------------------------
	

	//-------------------------------

	//-------------------------------
	// Assemble full SQL statement
	//-------------------------------



	  Categories_sSQL = Categories_sSQL + sWhere + sOrder;
	  if (Categories_sCountSQL.Length== 0) {
	    int iTmpI = Categories_sSQL.ToLower().IndexOf("select ");
	    int iTmpJ = Categories_sSQL.ToLower().LastIndexOf(" from ")-1;
	    Categories_sCountSQL = Categories_sSQL.Replace(Categories_sSQL.Substring(iTmpI + 7, iTmpJ-6), " count(*) ");
	    iTmpI = Categories_sCountSQL.ToLower().IndexOf(" order by");
	    if (iTmpI > 1) Categories_sCountSQL = Categories_sCountSQL.Substring(0, iTmpI);
	  }
	  
	  
	//-------------------------------
	
	OleDbDataAdapter command = new OleDbDataAdapter(Categories_sSQL, Utility.Connection);
	DataSet ds = new DataSet();
	
	command.Fill(ds, (i_Categories_curpage - 1) * Categories_PAGENUM, Categories_PAGENUM,"Categories");
	OleDbCommand ccommand = new OleDbCommand(Categories_sCountSQL, Utility.Connection);
	int PageTemp=(int)ccommand.ExecuteScalar();
	Categories_Pager.MaxPage=(PageTemp%Categories_PAGENUM)>0?(int)(PageTemp/Categories_PAGENUM)+1:(int)(PageTemp/Categories_PAGENUM);
	bool AllowScroller=Categories_Pager.MaxPage==1?false:true;
	
	DataView Source;
        Source = new DataView(ds.Tables[0]);

		if (ds.Tables[0].Rows.Count == 0){
			Categories_no_records.Visible = true;
			AllowScroller=false;}
		else
			{Categories_no_records.Visible = false;
			AllowScroller=AllowScroller&&true;}
		
		Categories_Pager.Visible=AllowScroller;
		return Source;
		// Categories Show end
		
	}
 protected LinkMessage MakeLM() {
   NodeInfo my_info = NodeInfo.CreateInstance( _node.Address, _e.LocalTA );
   NodeInfo remote_info = NodeInfo.CreateInstance( _linker.Target, _e.RemoteTA );
   System.Collections.Specialized.StringDictionary attrs
       = new System.Collections.Specialized.StringDictionary();
   attrs["type"] = String.Intern( _contype );
   attrs["realm"] = String.Intern( _node.Realm );
   return new LinkMessage( attrs, my_info, remote_info , _linker.Token);
 }
Example #55
0
 /// <summary>
 /// Parse a rfc 2822 header field with parameters
 /// </summary>
 /// <param name="field">field name</param>
 /// <param name="fieldbody">field body to parse</param>
 /// <returns>A <see cref="System.Collections.Specialized.StringDictionary" /> from the parsed field body</returns>
 public static System.Collections.Specialized.StringDictionary parseHeaderFieldBody( System.String field, System.String fieldbody )
 {
     if ( fieldbody==null )
         return null;
     // FIXME: rewrite parseHeaderFieldBody to being regexp based.
     fieldbody = anmar.SharpMimeTools.SharpMimeTools.uncommentString (fieldbody);
     System.Collections.Specialized.StringDictionary fieldbodycol = new System.Collections.Specialized.StringDictionary ();
     System.String[] words = fieldbody.Split(new Char[]{';'});
     if ( words.Length>0 ) {
         fieldbodycol.Add (field.ToLower(), words[0].ToLower());
         for (int i=1; i<words.Length; i++ ) {
             System.String[] param = words[i].Trim(new Char[]{' ', '\t'}).Split(new Char[]{'='}, 2);
             if ( param.Length==2 ) {
                 param[0] = param[0].Trim(new Char[]{' ', '\t'});
                 param[1] = param[1].Trim(new Char[]{' ', '\t'});
                 if ( param[1].StartsWith("\"") && !param[1].EndsWith("\"")) {
                     do {
                         param[1] += ";" + words[++i];
                     } while  ( !words[i].EndsWith("\"") && i<words.Length);
                 }
                 fieldbodycol.Add ( param[0], anmar.SharpMimeTools.SharpMimeTools.parserfc2047Header (param[1].TrimEnd(';').Trim('\"')) );
             }
         }
     }
     return fieldbodycol;
 }
Example #56
0
        //static StringDictionary machineStore;
        //static bool machineStoreModified;
        /// <summary>Initializes instance variables and loads initial settings from
        /// the backing store.</summary>
        /// <param name="path">
        /// Represents the name of the group the preferences are stored under.
        /// Roughly equivalent to a directory path or a registry key path.
        /// You can nest groups using the slash (/) character.
        /// "" (the empty string) represents the top-level group.  A slash (/)
        /// will be added to the end of the path if it is lacking one.</param>
        public IsolatedStorageUserPreferencesStore(string path)
            : base(path)
        {
            if (userStore == null) {
                userStore = new StringDictionary();

                // Load preferences.
                Deserialize();
                userStoreModified = false;

                // Flush the preferences on application exit.
                System.Windows.Forms.Application.ApplicationExit += new EventHandler(OnApplicationExit);
            }
        }
        /// <summary>Initializes the cache and registry key to use.</summary>
        private void InitializeRegistryStore()
        {
            const string subKey = @"Software\SmartPaster";

            settingsCache = new System.Collections.Specialized.StringDictionary();
            regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(subKey, true) ?? Microsoft.Win32.Registry.CurrentUser.CreateSubKey(subKey);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="RtnValue"></param>
        public override void SetModifyProc(ref int RtnValue)
        {
            DateTime dtBegin = DateTime.Now;
            DateTime dtEnd = DateTime.Now;

            base.SetModifyProc(ref RtnValue);
            try
            {
                m_dicPrimarName.Clear();
                m_dicPrimarName["ID"] = txtID.Text.Trim();
                m_dicItemData = new System.Collections.Specialized.StringDictionary();
                m_dicItemData["SetDate"] = dateSetDate.EditValue.ToString();
                m_dicItemData["OperID"] = Common._personid;
                m_dicItemData["OperDate"] = System.DateTime.Now.ToString();


                int result = SysParam.m_daoCommon.SetModifyDataIdentityColumn(this.TableName, m_dicItemData, m_dicPrimarName);
                if (result > 0)
                {
                    XtraMsgBox.Show("修改数据成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //日志
                    SysParam.m_daoCommon.WriteLog( "欠勤登记", "修改", txtUserID.Text.Trim() + " 在" + dateSetDate.EditValue.ToString() + "记录");
                    DialogResult = DialogResult.OK;
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                throw ex;
            }
        }
        /// <summary>
        ///    Arguments Parser Class.
        ///      --  Parses Command Line Arguments passed to a Command Line application.
        ///      --  Accepts the string array of arguments that was captured by the application
        ///          at startup.
        ///      --  Parameters should be prefixed with one of the following characters ("-",
        ///          "--", "/", ":").
        ///      --  Calling Syntax:  PDX.BTS.DataMaintenanceUtilites.ArgumentParser commandLine = new PDX.BTS.DataMaintenanceUtilities.ArgumentParser(args);
        ///            -  Returns a String Array of the Parameters with the parameter names as
        ///               the array indices.
        ///            -  For example in the resulting array, the value for the Parameter
        ///               "DataPath" (passed as /DataPath=C:\) will be obtained with -
        ///               commandLine["DataPath"].
        ///            -  For Boolean arguments.  To determine if the parameter was passed is -
        ///               "Usage" (passed as /Usage) will be determined by testing -
        ///               if (commandLine["Usage"] == "true")
        /// </summary>
        // Constructor Method
        public ArgumentParser(string[] Args)
        {
            System.Text.RegularExpressions.Regex splitter         = null;
              System.Text.RegularExpressions.Regex remover          = null;
              string                               currentParameter = null;
              string[]                             parameterParts   = null;

              try
              {
            //  Instantiate a String Dictionary Object to hold the parameters that are found.
            _parsedParameters = new System.Collections.Specialized.StringDictionary();

            //  Set the Set of values that will be searched to find the parameter start
            //  identifiers ("-", "--", "/", or ":").
            splitter = new System.Text.RegularExpressions.Regex(@"^-{1,2}|^/|=|:",
                                  System.Text.RegularExpressions.RegexOptions.IgnoreCase |
                                  System.Text.RegularExpressions.RegexOptions.Compiled);

            //  Set the Set of values that will be removed from the Parameters strings ("'", ".*").
            remover = new System.Text.RegularExpressions.Regex(@"^['""]?(.*?)['""]?$",
                                  System.Text.RegularExpressions.RegexOptions.IgnoreCase |
                                  System.Text.RegularExpressions.RegexOptions.Compiled);

            // Valid parameters forms:  {-,/,--}param{ ,=,:}((",')value(",'))
            // Examples:  -param1 value1 --param2 /param3:"Test-:-work"
            //           /param4=happy -param5 '--=nice=--'
            foreach (string currentTextString in Args)
            {
              // Look for new parameters (-,/ or --) and a possible enclosed value (=,:)
              parameterParts = splitter.Split(currentTextString, 3);

              //  Populate the String Dictionary Object with the values in the current parameter.
              switch (parameterParts.Length)
              {
            // Found a value (for the last parameter found (space separator))
            case 1:
              if (currentParameter != null)
              {
                if (!_parsedParameters.ContainsKey(currentParameter))
                {
                  parameterParts[0] = remover.Replace(parameterParts[0], "$1");
                  _parsedParameters.Add(currentParameter, parameterParts[0]);
                }
                currentParameter = null;
              }
              // else Error: no parameter waiting for a value (skipped)
              break;
            // Found just a parameter
            case 2:
              // The last parameter is still waiting.  With no value, set it to true.
              if (currentParameter != null)
              {
                if (!_parsedParameters.ContainsKey(currentParameter))
                {
                  _parsedParameters.Add(currentParameter, "true");
                }
              }
              currentParameter = parameterParts[1];
              //  Exit this case.
              break;
            // Parameter with enclosed value
            case 3:
              // The last parameter is still waiting.  With no value, set it to true.
              if (currentParameter != null)
              {
                if (!_parsedParameters.ContainsKey(currentParameter))
                {
                  _parsedParameters.Add(currentParameter, "true");
                }
              }
              currentParameter = parameterParts[1];
              // Remove possible enclosing characters (",')
              if (!_parsedParameters.ContainsKey(currentParameter))
              {
                parameterParts[2] = remover.Replace(parameterParts[2], "$1");
                _parsedParameters.Add(currentParameter, parameterParts[2]);
              }
              currentParameter = null;
              //  Exit this case.
              break;
              }
            }

            // In case a parameter is still waiting
            if (currentParameter != null)
            {
              if (!_parsedParameters.ContainsKey(currentParameter))
              {
            _parsedParameters.Add(currentParameter, "true");
              }

            }

              }
              catch
              {
            //  Exit the method.
            return;

              }
        }
        ICollection editorial_categories_CreateDataSource()
        {
            // editorial_categories Show begin
            editorial_categories_sSQL = "";
            editorial_categories_sCountSQL = "";

            string sWhere = "", sOrder = "";

            bool HasParam = false;

            //-------------------------------
            // Build ORDER BY statement
            //-------------------------------
            sOrder = " order by e.editorial_cat_name Asc";
            if(Utility.GetParam("Formeditorial_categories_Sorting").Length>0&&!IsPostBack)
            {ViewState["SortColumn"]=Utility.GetParam("Formeditorial_categories_Sorting");
             ViewState["SortDir"]="ASC";}
            if(ViewState["SortColumn"]!=null) sOrder = "ORDER BY @SortColumn @SortDir";

            System.Collections.Specialized.StringDictionary Params =new System.Collections.Specialized.StringDictionary();

            //-------------------------------
            // Build base SQL statement
            //-------------------------------

            editorial_categories_sSQL = "select [e].[editorial_cat_id] as e_editorial_cat_id, " +
            "[e].[editorial_cat_name] as e_editorial_cat_name " +
            " from [editorial_categories] e ";

            //-------------------------------
            //-------------------------------

            //-------------------------------

            //-------------------------------
            // Assemble full SQL statement
            //-------------------------------

              editorial_categories_sSQL = editorial_categories_sSQL + sWhere + sOrder;
              if (editorial_categories_sCountSQL.Length== 0) {
            int iTmpI = editorial_categories_sSQL.ToLower().IndexOf("select ");
            int iTmpJ = editorial_categories_sSQL.ToLower().LastIndexOf(" from ")-1;
            editorial_categories_sCountSQL = editorial_categories_sSQL.Replace(editorial_categories_sSQL.Substring(iTmpI + 7, iTmpJ-6), " count(*) ");
            iTmpI = editorial_categories_sCountSQL.ToLower().IndexOf(" order by");
            if (iTmpI > 1) editorial_categories_sCountSQL = editorial_categories_sCountSQL.Substring(0, iTmpI);
              }

            //-------------------------------

            OleDbDataAdapter command = new OleDbDataAdapter(editorial_categories_sSQL, Utility.Connection);
            command.SelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter("@SortColumn", viewstate["SortColumn"]));
            command.SelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter("@SortDir", viewstate["SortDir"]));

            DataSet ds = new DataSet();

            command.Fill(ds, (i_editorial_categories_curpage - 1) * editorial_categories_PAGENUM, editorial_categories_PAGENUM,"editorial_categories");
            OleDbCommand ccommand = new OleDbCommand(editorial_categories_sCountSQL, Utility.Connection);
            int PageTemp=(int)ccommand.ExecuteScalar();
            editorial_categories_Pager.MaxPage=(PageTemp%editorial_categories_PAGENUM)>0?(int)(PageTemp/editorial_categories_PAGENUM)+1:(int)(PageTemp/editorial_categories_PAGENUM);
            bool AllowScroller=editorial_categories_Pager.MaxPage==1?false:true;

            DataView Source;
            Source = new DataView(ds.Tables[0]);

            if (ds.Tables[0].Rows.Count == 0){
            editorial_categories_no_records.Visible = true;
            AllowScroller=false;}
            else
            {editorial_categories_no_records.Visible = false;
            AllowScroller=AllowScroller&&true;}

            editorial_categories_Pager.Visible=AllowScroller;
            return Source;
            // editorial_categories Show end
        }