当前位置: 首页>>代码示例>>C#>>正文


C# ParameterCollection.Clear方法代码示例

本文整理汇总了C#中RiskApps3.Utilities.ParameterCollection.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterCollection.Clear方法的具体用法?C# ParameterCollection.Clear怎么用?C# ParameterCollection.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RiskApps3.Utilities.ParameterCollection的用法示例。


在下文中一共展示了ParameterCollection.Clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BackgroundLoadWork

 /**************************************************************************************************/
 public override void BackgroundLoadWork()
 {
     ParameterCollection pc = new ParameterCollection();
     pc.Add("clinicId", clinicId);
     pc.Add("startTime", startTime);
     pc.Add("endTime", endTime);
     pc.Add("type", type);
     pc.Add("output", output);
     DoLoadWithSpAndParams("sp_3_LoadBreastImagingDashboardElement", pc);
     pc.Clear();
     pc.Add("type", type);
     DoLoadWithSpAndParams("sp_3_LoadFilterDescription", pc);
 }
开发者ID:mahitosh,项目名称:HRA4,代码行数:14,代码来源:BreastImagingModelElement.cs

示例2: printSelectedBackgroundWorker_DoWork

        private void printSelectedBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            if (printSelectedBackgroundWorker.CancellationPending)
            {
                e.Cancel = true;
                return;
            }
            float i = 0;
            float count = selectedList.Count;
            foreach (PrintQueueEntry pqe in selectedList)
            {
                if (printSelectedBackgroundWorker.CancellationPending)
                {
                    e.Cancel = true;
                    return;
                }
                int percent = (int)((++i * 100.0f) / count);

                int apptID = -1;
                int documentTemplateID = -1;
                int ID = -1;
                string unitnum = "";

                apptID = pqe.apptID;
                documentTemplateID = pqe.documentTemplateID;
                ID = pqe.ID;
                unitnum = pqe.unitnum;

                if (string.IsNullOrEmpty(unitnum) || apptID < 1 || ID < 1 || documentTemplateID < 1)
                {
                    string mrn = string.IsNullOrEmpty(unitnum) ? "" : unitnum;
                    Logger.Instance.WriteToLog("RiskApps3 PrintQueueForm: Cannot print document { unitnum=" + mrn + ", apptID=" + apptID.ToString() + ", documentTemplateID=" + documentTemplateID.ToString() + " }");
                    printSelectedBackgroundWorker.ReportProgress(percent,
                            "RiskApps3 PrintQueueForm: Cannot print document { unitnum=" + mrn + ", apptID=" + apptID.ToString() + ", documentTemplateID=" + documentTemplateID.ToString() + " }");
                    continue;
                }
                bool printFailed = false;
                Model.Clinic.Letters.PrintUtils printUtils = new Model.Clinic.Letters.PrintUtils();

                ////////////////////////////////////////////////////////
                // documentType defaults to WORD in V3 Batch Printing //
                ////////////////////////////////////////////////////////
                if (string.IsNullOrEmpty(pqe.docType))
                {
                    pqe.docType = "WORD";
                }

                if (pqe.docType.ToUpper() == "HTML")
                {
                    if (printUtils.printHtmlDoc(apptID, unitnum, documentTemplateID) == null)
                    {
                        printFailed = true;
                        string mrn = string.IsNullOrEmpty(unitnum) ? "" : unitnum;
                        Logger.Instance.WriteToLog("RiskApps3 PrintQueueForm: Printing failed for { unitnum=" + mrn + ", apptID=" + apptID.ToString() + ", documentTemplateID=" + documentTemplateID.ToString() + " }");
                        printSelectedBackgroundWorker.ReportProgress(percent,
                            "RiskApps3 PrintQueueForm: HTML printing failed for { unitnum=" + mrn + ", apptID=" + apptID.ToString() + ", documentTemplateID=" + documentTemplateID.ToString() + " }");
                    }
                }
                else if (pqe.docType.ToUpper() == "WORD")
                {
                    if (printUtils.printWordDoc(apptID, unitnum, documentTemplateID) == false)
                    {
                        printFailed = true;
                        string mrn = string.IsNullOrEmpty(unitnum) ? "" : unitnum;
                        Logger.Instance.WriteToLog("RiskApps3 PrintQueueForm: Printing failed for { unitnum=" + mrn + ", apptID=" + apptID.ToString() + ", documentTemplateID=" + documentTemplateID.ToString() + " }");
                        printSelectedBackgroundWorker.ReportProgress(percent,
                            "RiskApps3 PrintQueueForm: Word printing failed for { unitnum=" + mrn + ", apptID=" + apptID.ToString() + ", documentTemplateID=" + documentTemplateID.ToString() + " }");
                    }
                }
                if (printFailed == false)
                {
                    ParameterCollection pc = new ParameterCollection();
                    pc.Add("apptID", apptID);
                    pc.Add("documentTemplateID", documentTemplateID);
                    pc.Add("dateTime", DateTime.Now);
                    string sqlStr = "INSERT INTO tblDocuments([apptID],[documentTemplateID],[created],[createdBy]) VALUES(@apptID, @documentTemplateID, @dateTime, 'BatchPrint');";

                    BCDB2.Instance.ExecuteNonQueryWithParams(sqlStr, pc);

                    pc.Clear();
                    pc.Add("ID", ID);
                    sqlStr = "UPDATE tblPrintQueue SET printed='" + DateTime.Now + "' WHERE ID = @ID;";
                    BCDB2.Instance.ExecuteNonQueryWithParams(sqlStr, pc);

                    printSelectedBackgroundWorker.ReportProgress(percent, "Printed document: template " + documentTemplateID.ToString() + "\r\nFor appt " + apptID.ToString() + " (MRN: " + unitnum + ")");
                }
                else
                {
                    printSelectedBackgroundWorker.ReportProgress(percent, "Failed to print document: template " + documentTemplateID.ToString() + "\r\nFor appt " + apptID.ToString() + " (MRN: " + unitnum + ")");
                }
                //Thread.Sleep(1000);
            }
        }
开发者ID:mahitosh,项目名称:HRA4,代码行数:93,代码来源:PrintQueueForm.cs

示例3: encryptWorker_DoWork

        private void encryptWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            List<string> users = new List<string>();
            int progress = 0;
            string userPassword = "";
            string userLogin = "";
            ParameterCollection pc = new ParameterCollection();
            SqlDataReader reader;

            try
            {
                pc.Clear();
                reader = BCDB2.Instance.ExecuteReaderSPWithParams("sp_3_Get_EncryptPasswords_Global", pc);
                if (reader != null)
                {
                    if (reader.Read())
                    {
                        encryptedPasswords = (bool)reader.GetSqlBoolean(0);
                    }
                    reader.Close();
                }

                if (encryptedPasswords == false)  // SessionManager.Instance.MetaData.Globals.encryptPasswords
                {
                    BCDB2.Instance.ExecuteNonQuery("sp_3_Backup_UserLoginList");

                    pc.Clear();
                    reader = BCDB2.Instance.ExecuteReaderSPWithParams("sp_3_Get_UserLoginList", pc);
                    if (reader != null)
                    {
                        while (reader.Read())
                        {
                            users.Add(reader.GetString(0));
                        }
                        reader.Close();
                    }

                    foreach (string name in users)
                    {
                        userLogin = name;

                        pc.Clear();
                        pc.Add("userLogin", userLogin);
                        reader = BCDB2.Instance.ExecuteReaderSPWithParams("sp_3_Get_UserPassword", pc);
                        if (reader != null)
                        {
                            while (reader.Read())
                            {
                                userPassword = reader.GetString(0);
                            }
                            reader.Close();
                        }
                        if (string.IsNullOrEmpty(userPassword) == false)
                        {
                            pc.Clear();
                            string encryptedPassword = RiskAppCore.User.encryptPassword(userPassword);

                            pc.Add("userLogin", userLogin);
                            pc.Add("userPassword", encryptedPassword);
                            int result = (int)RiskApps3.Utilities.BCDB2.Instance.ExecuteSpWithRetValAndParams("sp_3_Save_UserPassword", SqlDbType.Int, pc);
                        }
                        passwordsEncrypted++;
                        progress = passwordsEncrypted * 100 / users.Count;
                        encryptWorker.ReportProgress(progress, passwordsEncrypted);
                    }
                    BCDB2.Instance.ExecuteNonQuery("sp_3_Set_EncryptPasswords_Global");
                }
                else
                {
                    encryptWorker.ReportProgress(100, users.Count);
                }
            }
            catch (Exception encryptEx)
            {
                Logger.Instance.WriteToLog("Error encrypting password for user " + userLogin + ": " + encryptEx.InnerException.ToString());
                encryptionError = true;
            }
        }
开发者ID:mahitosh,项目名称:HRA4,代码行数:78,代码来源:CodeUtilsForm.cs


注:本文中的RiskApps3.Utilities.ParameterCollection.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。