private void parseProcedureStmt(TStoredProcedureSqlStatement procedureStmt)
        {
            if (procedureStmt.StoredProcedureName == null)
            {
                return;
            }
            ProcedureMetaData procedureMetaData = getProcedureMetaData(procedureStmt.StoredProcedureName);

            procedureMetaData = getProcedureMetaData(procedureMetaData, true);

            TObjectName procedureName = procedureStmt.StoredProcedureName;
            procedure   procedure     = new procedure();

            procedure.name          = procedureMetaData.DisplayName;
            procedure.owner         = getOwnerString(procedureMetaData);
            procedure.coordinate    = procedureName.startToken.lineNo + "," + procedureName.startToken.columnNo;
            procedure.highlightInfo = procedureName.startToken.offset + "," + (procedureName.endToken.offset - procedureName.startToken.offset + procedureName.endToken.astext.Length);
            List <procedure> procedureList = getProcedureList(procedures.Item1);

            procedureList.Add(procedure);
            procedures.Item1.procedures = procedureList.ToArray();


            parseProcedureLineage(procedureStmt, procedureMetaData, procedure);
        }
Example #2
0
 public Procedures(procedure i_procedure)
 {
     Procedure = i_procedure;
     Value     = "0";
     IsEnabled = true;
     IsChecked = false;
 }
Example #3
0
        public async Task <ActionResult> Create([Bind(Include = "ProcedureID,LongName,ShortName,VideoSource,Description")] procedure procedure)
        {
            HttpResponseMessage response = await client.PostAsJsonAsync(urlPath, procedure);

            response.EnsureSuccessStatusCode();
            return(RedirectToAction("Index"));
        }
Example #4
0
        public async Task <ActionResult> Edit([Bind(Include = "ProcedureID,LongName,ShortName,VideoSource,Description")] procedure procedure)
        {
            HttpResponseMessage response = await client.PutAsJsonAsync(String.Format("{0}/{1}", urlPath, procedure.ProcedureID.ToString()), procedure);

            response.EnsureSuccessStatusCode();
            return(RedirectToAction("Index"));
        }
Example #5
0
        /// <summary>
        /// Description: Limpia cada uno de los valores del procedimiento
        /// </summary>
        private void _clearButton_btn_Click(object sender, RoutedEventArgs e)
        {
            Procedures procedures = SelectFailsProcedures.Where <Procedures>(wprocedure => wprocedure.Procedure.name == "Weight and Balance").First();
            procedure  procedure  = procedures.Procedure;

            //Logic clear procedures

            _textZone1_txt.Text = "";
            _textZone2_txt.Text = "";
            _textZone3_txt.Text = "";
            _textZone4_txt.Text = "";
            _textZone5_txt.Text = "";
            _textZone6_txt.Text = "";
            _textZoneA_txt.Text = "";
            _textZoneB_txt.Text = "";
            _textZoneC_txt.Text = "";
            _textZoneD_txt.Text = "";

            RadWindow.Alert(new DialogParameters
            {
                Header          = "Alert",
                Content         = "Pounds cleared",
                OkButtonContent = "Ok",
                Owner           = this
            });
        }
        public static procedure FindProcedure(string procID)
        {
            procedure toReturn = new procedure();

            DataTable results = toReturn.Search("SELECT * FROM procedures WHERE externalid = '" + procID + "'");

            if (results.Rows.Count > 0)
            {
                toReturn.Load(results.Rows[0]);
            }

            return(toReturn);
        }
Example #7
0
    public DataSet GetData(procedure type)
    {
        DataSet dsReport = new DataSet();
        string strOut = string.Empty;

        AseConnection oCon = new AseConnection(strCon);
        try
        {
            string strHandler = Convert.ToString(GetFromSession("Handler"));
            int intTimeout;
            AseCommand oCmd = null;
            if (type.Equals(procedure.FLSH_RPT))
            {
                oCmd = new AseCommand("FLSH_RPT", oCon);            
            }
            if (type.Equals(procedure.DISTINCT_DTC))
            {
                oCmd = new AseCommand("DISTINCT_DTC", oCon);
            } 
            oCmd.CommandType = CommandType.StoredProcedure;
            intTimeout = oCmd.CommandTimeout;
            oCmd.CommandTimeout = 0;
            AseParameter oParam1 = new AseParameter("@recon_handle", AseDbType.VarChar, 25);
            oParam1.Value = strHandler;
            oCmd.Parameters.Add(oParam1);
            AseDataAdapter oAseAdp = new AseDataAdapter(oCmd);
            oAseAdp.Fill(dsReport);
            oCmd.CommandTimeout = intTimeout;
            oCmd.Dispose();
            oCon.Close();
            oCon.Dispose();
            oCmd = null;
            oCon = null;
        }
        catch (Exception ex)
        {
            log.Info("Exception occured-GetData():", ex);
            oCon.Close();
            oCon.Dispose();
            oCon = null;
            if (ex.Message == "No Flash Record found")
            {
                dsReport = null;
                return dsReport;
            }
            throw;
        }
        return dsReport;
    }
Example #8
0
        /// <summary>
        /// Description: Activa el procedimiento correspondiente con el parametro digitado
        /// </summary>
        private void _textZone1_txt_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                if (_textZone1_txt.Text != "")
                {
                    float value = 0;
                    if (float.TryParse(_textZone1_txt.Text, out value) == false)
                    {
                        _textZone1_txt.Text = "0";
                        RadWindow.Alert(new DialogParameters
                        {
                            Header          = "Alert",
                            Content         = "Incorrect pounds",
                            OkButtonContent = "Ok",
                            Owner           = this
                        });
                    }
                    else
                    {
                        Procedures procedures = SelectFailsProcedures.Where <Procedures>(wprocedure => wprocedure.Procedure.name == "Weight and Balance").First();
                        procedure  procedure  = procedures.Procedure;

                        //Logic send procedure Zone1

                        RadWindow.Alert(new DialogParameters
                        {
                            Header          = "Alert",
                            Content         = "Pounds sent",
                            OkButtonContent = "Ok",
                            Owner           = this
                        });

                        Keyboard.ClearFocus();
                    }
                }
                else
                {
                    RadWindow.Alert(new DialogParameters
                    {
                        Header          = "Alert",
                        Content         = "Complete field and send Pounds",
                        OkButtonContent = "Ok",
                        Owner           = this
                    });
                }
            }
        }
Example #9
0
        public async Task <ActionResult> DetailsJson(int?id)
        {
            procedure procInfo = new procedure();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HttpResponseMessage response = await client.GetAsync(String.Format("{0}/{1}", urlPath, id.ToString()));

            if (response.IsSuccessStatusCode)
            {
                var responseDetail = response.Content.ReadAsStringAsync().Result;
                return(Json(responseDetail, JsonRequestBehavior.AllowGet));
            }
            return(null);
        }
Example #10
0
        public async Task <ActionResult> Delete(int?id)
        {
            procedure procInfo = new procedure();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HttpResponseMessage response = await client.GetAsync(String.Format("{0}/{1}", urlPath, id.ToString()));

            if (response.IsSuccessStatusCode)
            {
                var responseDetail = response.Content.ReadAsStringAsync().Result;
                procInfo = JsonConvert.DeserializeObject <procedure>(responseDetail);
            }
            return(View(procInfo));
        }
        /// <summary>
        /// Description: EnvĂ­a el procedimiento de perdida de combustible en el tanque seleccionado
        /// </summary>
        private void _comboParameter_com_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Procedures procedures = SelectFailsProcedures.Where <Procedures>(wprocedure => wprocedure.Procedure.name == "Fuel leak").First();

            procedures.IsChecked = true;
            procedure procedure = procedures.Procedure;

            //Logic send procedure

            RadWindow.Alert(new DialogParameters
            {
                Header          = "Alert",
                Content         = "Value sent",
                OkButtonContent = "Ok",
                Owner           = this
            });
        }
        private void _clearAllButton_btn_Click(object sender, RoutedEventArgs e)
        {
            foreach (Procedures procedures in SelectFailsProcedures)
            {
                procedure procedure = procedures.Procedure;

                if (procedure != null)
                {
                    //Logic clear procedures
                }
            }

            RadWindow.Alert(new DialogParameters
            {
                Header          = "Alert",
                Content         = "Values cleared",
                OkButtonContent = "Ok",
                Owner           = this
            });
        }
        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            string     nameProcedure  = (sender as Button).Tag.ToString();
            string     valueProcedure = (sender as Button).Content.ToString();
            Procedures procedures     = SelectFailsProcedures.Where <Procedures>(wprocedure => wprocedure.Procedure.name == nameProcedure).First();
            procedure  procedure      = procedures.Procedure;

            if (procedure != null)
            {
                //Logic procedure

                RadWindow.Alert(new DialogParameters
                {
                    Header          = "Alert",
                    Content         = "Value sent",
                    OkButtonContent = "Ok",
                    Owner           = this
                });
            }
        }
        public static void GoImport()
        {
            claim     workingClaim                  = new claim();
            DataTable importData                    = new DataTable();
            DataTable importDataSecondaries         = new DataTable();
            DataTable importDataPredeterms          = new DataTable();
            DataTable importDataSecondaryPredeterms = new DataTable();

            system_options.SetImportFlag(true);
            primaryClaimCount            = 0;
            secondaryClaimCount          = 0;
            predetermClaimCount          = 0;
            secondaryPredetermClaimCount = 0;
            closedClaimCount             = 0;

            OleDbConnection oConnect;

            //UpdateProgressBar(50, "Initiating Remote Connection...");


            #region Initiate Connection, Get Data
            try
            {
                oConnect = new OleDbConnection(dms.GetConnectionString(true));
            }
            catch (Exception err)
            {
                CreateLogFile(err.ToString());
                Updateimporterror(true);
                DeleteDirectoryFromTemp();
                //LoggingHelper.Log("An error occurred getting the connection string for a new connection in frmImportData.Import", LogSeverity.Error, err, false);
                //e.Cancel = true;
                CancelImport();
                return;
            }



            OleDbDataAdapter oAdapter;
            // Use Connection object for the DataAdapter to retrieve all tables from selected Database
            try
            {
                oConnect.Open();
            }
            catch (Exception err)
            {
                CreateLogFile(err.ToString());
                Updateimporterror(true);
                DeleteDirectoryFromTemp();
                //LoggingHelper.Log("Could not connect to the database in frmImportdata.Import", LogSeverity.Error, err, false);
                //e.Cancel = true;
                CancelImport();
                return;
            }



            try
            {
                //UpdateProgressBar(50, "Querying remote database (Standard)...");

                // ************* Standard Claims
                oAdapter = new OleDbDataAdapter(PrepareSQL(dms.sqlstatement, changesOnly), oConnect);
                oAdapter.SelectCommand.CommandTimeout = System.Convert.ToInt32(dataTimeout);
                oAdapter.Fill(importData);

                //UpdateProgressBar(10, "Querying remote database (Secondary)...");

                // **************  Secondaries
                if (dms.sqlstatementsecondaries != "")
                {
                    oAdapter = new OleDbDataAdapter(PrepareSQL(dms.sqlstatementsecondaries, changesOnly), oConnect);
                    oAdapter.SelectCommand.CommandTimeout = System.Convert.ToInt32(dataTimeout);
                    oAdapter.Fill(importDataSecondaries);
                }

                //UpdateProgressBar(10, "Querying remote database (Predeterms)...");

                // *************** Predeterms
                if (dms.sqlstatementpredeterms != "")
                {
                    oAdapter = new OleDbDataAdapter(PrepareSQL(dms.sqlstatementpredeterms, changesOnly), oConnect);
                    oAdapter.SelectCommand.CommandTimeout = System.Convert.ToInt32(dataTimeout);
                    oAdapter.Fill(importDataPredeterms);
                }

                //UpdateProgressBar(10, "Querying remote database (Secondary Predeterms)...");
                // *************** Predeterms
                if (dms.sqlstatementsecondarypredeterms != "")
                {
                    oAdapter = new OleDbDataAdapter(PrepareSQL(dms.sqlstatementsecondarypredeterms, changesOnly), oConnect);
                    oAdapter.SelectCommand.CommandTimeout = System.Convert.ToInt32(dataTimeout);
                    oAdapter.Fill(importDataSecondaryPredeterms);
                }
            }
            catch (Exception err)
            {
                CreateLogFile(err.ToString());
                Updateimporterror(true);
                DeleteDirectoryFromTemp();
                //LoggingHelper.Log("Error with SQL statement or connection in frmImportData.Import", LogSeverity.Error, err);
                //MessageBox.Show(this, "There was an error with your SQL statement or with your connection.\n\n" + err.Message,
                //   "Error retrieving data");
                CancelImport();
                return;
            }

            #endregion

            data_mapping_schema_data dmsd = new data_mapping_schema_data();
            dmsd.schema_id = dms.id;
            DataTable dataForSchema = dmsd.Search();

            // Generate our list of objects one time, and then use them for each iteration of rows
            List <data_mapping_schema_data> allMappedSchemaData = new List <data_mapping_schema_data>();
            foreach (DataRow aMapping in dataForSchema.Rows)
            {
                // For every row, need to get the data for every field
                dmsd = new data_mapping_schema_data();
                dmsd.Load(aMapping);
                allMappedSchemaData.Add(dmsd);
            }

            // UpdateProgressBar(100, "Importing data...");

            if (okToZap)
            {
                company cmp = new company();
                cmp.Zap();

                workingClaim.Zap();

                call aCall = new call();
                aCall.Zap();

                company_contact_info info = new company_contact_info();
                info.Zap();

                procedure p = new procedure();
                p.Zap();

                choice c = new choice();
                c.Zap();

                notes n = new notes();
                n.Zap();

                claim_batch cb = new claim_batch();
                cb.Zap();

                batch_claim_list bcl = new batch_claim_list();
                bcl.Zap();
            }
            else
            {
                if (!changesOnly)
                {
                    workingClaim.MarkAllImportsUpdated(false);
                }
            }

            // Apply incremental updates to progress bar
            int currentRow = 0;

            totalRows = importData.Rows.Count + importDataSecondaries.Rows.Count + importDataPredeterms.Rows.Count + importDataSecondaryPredeterms.Rows.Count;
            decimal exactIncrementAmount;

            if (totalRows > 0)
            {
                exactIncrementAmount = 500m / totalRows;
            }
            else
            {
                exactIncrementAmount = 500m;
            }

            decimal incrementCounter = 0;

            int increment;

            if (exactIncrementAmount < 1)
            {
                increment = 1;
            }
            else
            {
                increment = Convert.ToInt32(Math.Truncate(exactIncrementAmount));
            }



            string  lastClaimID             = "";
            claim   aClaim                  = new claim();
            company aCompany                = new company();
            company_contact_info anInfo     = new company_contact_info();
            procedure            aProcedure = new procedure();



            for (int p = 0; p < 4; p++)
            {
                claim.ClaimTypes ct;
                DataTable        thisImport;
                switch (p)
                {
                case 0:
                    thisImport = importData;
                    ct         = claim.ClaimTypes.Primary;
                    //UpdateLabels(0);
                    break;

                case 1:
                    thisImport = importDataSecondaries;
                    ct         = claim.ClaimTypes.Secondary;
                    //UpdateLabels(1);
                    break;

                case 2:
                    thisImport = importDataPredeterms;
                    ct         = claim.ClaimTypes.Predeterm;
                    //UpdateLabels(2);
                    break;

                default:
                    thisImport = importDataSecondaryPredeterms;
                    //UpdateLabels(3);
                    ct = claim.ClaimTypes.SecondaryPredeterm;
                    break;
                }



                // Have data at this point, need to tie them to the internal mapping schema data
                foreach (DataRow anImportRow in thisImport.Rows)
                {
                    string newID = anImportRow[dms.claim_id_column].ToString();
                    string newDB = anImportRow[dms.claim_db_column].ToString();
                    bool   isOnlyProcedureData;

                    if (newID == lastClaimID)
                    {
                        // We're only dealing with the import of "some" data
                        isOnlyProcedureData = true;
                    }
                    else
                    {
                        if (ct == claim.ClaimTypes.Primary)
                        {
                            primaryClaimCount++;
                        }
                        else if (ct == claim.ClaimTypes.Secondary)
                        {
                            secondaryClaimCount++;
                        }
                        else if (ct == claim.ClaimTypes.Predeterm)
                        {
                            predetermClaimCount++;
                        }
                        else
                        {
                            secondaryPredetermClaimCount++;
                        }

                        //UpdateTypeCount();

                        aClaim      = FindClaim(anImportRow, ct);
                        aCompany    = FindCompany(anImportRow[dms.company_namecolumn].ToString());
                        anInfo      = FindContactInfo(anImportRow["Ins_Co_Street1"].ToString(), aCompany.id, anImportRow["Ins_Co_Phone"].ToString());
                        lastClaimID = newID;
                        aClaim.ClearClaimProcedures();
                        isOnlyProcedureData = false;

                        // Check for "X" in provider field
                        try
                        {
                            if (aClaim.doctor_provider_id.StartsWith("X"))
                            {
                                AddStatus(string.Format("The claim for patient {0} on {1} uses an X provider ({2})", aClaim.PatientName, aClaim.DatesOfServiceString(), aClaim.doctor_provider_id), true, true);
                            }
                        }
                        catch (Exception err)
                        {
                            CreateLogFile(err.ToString());
                            Updateimporterror(true);
                            DeleteDirectoryFromTemp();
                            //LoggingHelper.Log(err, false);
                        }
                    }

                    aProcedure = FindProcedure(anImportRow["PROC_LOGID"].ToString());

                    if (CommonFunctions.DBNullToString(anImportRow["DATERECEIVED"]) == "")
                    {
                        aClaim.open = 1;
                    }
                    else if (((DateTime)anImportRow["DATERECEIVED"]).Year == 1753)
                    {
                        aClaim.open = 1;
                    }
                    else
                    {
                        aClaim.open = 0;
                        UpdateStatusHistory(aClaim);
                    }


                    foreach (data_mapping_schema_data aMappedData in allMappedSchemaData)
                    {
                        // We do a check for is only procedure data to speed up processing
                        // It makes the code a little messier.

                        if (isOnlyProcedureData)
                        {
                            // If we're only importing the procedure data, none of the other information is important

                            if ((aMappedData.LinkedField.table_name == "claims") ||
                                (aMappedData.LinkedField.table_name == "companies") ||
                                (aMappedData.LinkedField.table_name == "company_contact_info"))
                            {
                                // Ignore
                            }
                            else if (aMappedData.LinkedField.table_name == "procedures")
                            {
                                if (aMappedData.LinkedField.field_name == "surf_string")
                                {
                                    aProcedure[aMappedData.LinkedField.field_name] = CommonFunctions.RemoveNonPrintableCharacters(anImportRow[aMappedData.mapped_to_text].ToString());
                                }
                                else if (aMappedData.LinkedField.field_name == "claim_id")
                                {
                                    aProcedure["claim_id"] = lastClaimID;
                                }
                                else
                                {
                                    aProcedure[aMappedData.LinkedField.field_name] = anImportRow[aMappedData.mapped_to_text];
                                }
                            }
                            else
                            {
                                //LoggingHelper.Log("Uninitialized table name in frmImportData.Import", LogSeverity.Critical,
                                //    new Exception("Uninitialized table name in import procedure."), true);
                            }
                        }
                        else
                        {
                            // This is a new claim - we need to get the data for every field
                            if (aMappedData.LinkedField.table_name == "claims")
                            {
                                aClaim[aMappedData.LinkedField.field_name] = anImportRow[aMappedData.mapped_to_text];
                            }
                            else if (aMappedData.LinkedField.table_name == "companies")
                            {
                                if (aMappedData.mapped_to_text != dms.company_namecolumn)
                                {
                                    aCompany[aMappedData.LinkedField.field_name] = anImportRow[aMappedData.mapped_to_text];
                                }
                            }
                            else if (aMappedData.LinkedField.table_name == "company_contact_info")
                            {
                                anInfo[aMappedData.LinkedField.field_name] = anImportRow[aMappedData.mapped_to_text];
                            }
                            else if (aMappedData.LinkedField.table_name == "procedures")
                            {
                                if (aMappedData.LinkedField.field_name == "surf_string")
                                {
                                    aProcedure[aMappedData.LinkedField.field_name] = CommonFunctions.RemoveNonPrintableCharacters(anImportRow[aMappedData.mapped_to_text].ToString());
                                }
                                else
                                {
                                    aProcedure[aMappedData.LinkedField.field_name] = anImportRow[aMappedData.mapped_to_text];
                                }
                            }
                            else
                            {
                                //LoggingHelper.Log("Uninitialized table name in frmImport.Import", LogSeverity.Critical);
                                //throw new Exception("Uninitialized table name in import procedure.");
                            }
                        }
                    }

                    aCompany.Save();



                    anInfo.company_id = aCompany.id;
                    if (CommonFunctions.DBNullToZero(anInfo["order_id"]) == 0)
                    {
                        anInfo.order_id = anInfo.GetNextOrderID();
                    }
                    anInfo.Save();


                    aClaim.company_id            = aCompany.id;
                    aClaim.company_address_id    = anInfo.order_id;
                    aClaim["import_update_flag"] = true;
                    aClaim.Save();

                    if (p == 0 || p == 2 || p == 3) // Only update the id if this is the primary claim or a predeterm
                    {
                        aProcedure.claim_id = aClaim.id;
                    }

                    aProcedure.Save();

                    currentRow++;

                    if (Math.Truncate(incrementCounter + exactIncrementAmount) != Math.Truncate(incrementCounter))
                    {
                        //UpdateProgressBar(increment, string.Format("{0} / {1} procedures completed...", currentRow, totalRows), false);
                    }
                    incrementCounter += exactIncrementAmount;
                }
            }

            if (changesOnly)
            {
                // Grab all the deleted claims and mark them as closed here
                // Add a note that they have been deleted, I guess
                string deletedClaimsSQL = "SELECT CLAIMID, CLAIMDB " +
                                          "FROM AUDIT_DDB_CLAIM " +
                                          "WHERE N_CLAIMID is null " +
                                          "AND CLAIMID is not null AND CLAIMDB is not null " +
                                          "AND date_changed >= '" + lastWrite.ToString("G") + "'";
                DataTable    deletedClaims = new DataTable();
                OleDbCommand cmd           = new OleDbCommand(deletedClaimsSQL, oConnect);
                cmd.CommandTimeout = 90;

                oAdapter = new OleDbDataAdapter(cmd);

                oAdapter.Fill(deletedClaims);

                //UpdateProgressBar(5, "Updating Local Status for Deleted Claims...");
                foreach (DataRow aDeletedClaim in deletedClaims.Rows)
                {
                    // Close the claims
                    DataTable matches = aClaim.Search("SELECT * FROM claims WHERE claimidnum = '" + aDeletedClaim["claimid"] +
                                                      "' and claimdb = '" + aDeletedClaim["claimdb"] + "'");

                    if (matches.Rows.Count > 0)
                    {
                        // This should honestly not load every claim
                        aClaim = new claim();
                        aClaim.Load(matches.Rows[0]);
                        aClaim.open = 0;
                        aClaim.Save();
                        UpdateStatusHistory(aClaim);
                        closedClaimCount++;
                    }
                }
            }
            else
            {
                closedClaimCount = workingClaim.CloseClaimsWithoutUpdate();
            }

            //UpdateLabels(4);
            workingClaim.FixRevisitDateAfterImport();



            system_options.SetLastImportDate(DateTime.Now);
            ShowLastImportDate();
            AddStatus("The import completed successfully! " + totalRows + " rows were imported.");
            AddReportMessage(string.Format("The import completed successfully!\nPrimary: {0}\nSecondary: {1}\n" +
                                           "Predeterm: {2}\nSecondary Predeterm: {3}\nTotal Open Claims: {4}", primaryClaimCount, secondaryClaimCount, predetermClaimCount, secondaryPredetermClaimCount,
                                           primaryClaimCount + secondaryClaimCount + predetermClaimCount + secondaryPredetermClaimCount));

            try
            {
                string importFileName = Application.StartupPath + "\\Imports\\" + DateTime.Now.ToString("yyyy-MM-dd hh-mm-ss") + " import.rtf";
                //Directory.CreateDirectory(Path.GetDirectoryName(importFileName));
                //rtxtReport.SaveFile(importFileName);
                saveFileFromTemp();
                DeleteDirectoryFromTemp();
                CreateLogFile("Import Successfully.");
                Updateimporterror(false);
            }
            catch (Exception ex) {
                CreateLogFile(ex.ToString());
                Updateimporterror(true);
                DeleteDirectoryFromTemp();
                //LoggingHelper.Log("Error creating import report file.", LogSeverity.Error, ex, false);
            }
        }
Example #15
0
    public void ExecuteData(procedure type, string flashAcctNum, string dtcAcctNum)
    {
        AseConnection oCon = new AseConnection(strCon);

        try
        {
            string strHandler = Convert.ToString(GetFromSession("Handler"));
            int intTimeout;
            AseCommand oCmd=null;
            
            if (type.Equals(procedure.ADD_FLSH))
            {
                oCmd = new AseCommand("ADD_FLSH", oCon);
                AseParameter oParam0 = new AseParameter("@recon_handle", AseDbType.VarChar, 25);
                oParam0.Value = strHandler;
                oCmd.Parameters.Add(oParam0);
            }
            if (type.Equals(procedure.RemoveMapping))
            {
                oCmd = new AseCommand("RemoveMapping", oCon);
                AseParameter oParam0 = new AseParameter("@recon_handle", AseDbType.VarChar, 25);
                oParam0.Value = strHandler;
                oCmd.Parameters.Add(oParam0);
            }

            oCmd.CommandType = CommandType.StoredProcedure;
            intTimeout = oCmd.CommandTimeout;
            oCmd.CommandTimeout = 0;
            AseParameter oParam1 = new AseParameter("@flash_number", AseDbType.VarChar, 25);
            oParam1.Value = flashAcctNum;
            oCmd.Parameters.Add(oParam1);
            AseParameter oParam2 = new AseParameter("@dtc_number", AseDbType.VarChar, 25);
            oParam2.Value = dtcAcctNum;
            oCmd.Parameters.Add(oParam2);
            oCon.Open();
            oCmd.ExecuteNonQuery();
            oCmd.CommandTimeout = intTimeout;
            oCmd.Dispose();
            oCon.Close();
            oCon.Dispose();
            oCmd = null;
            oCon = null;
        }
        catch (Exception ex)
        {
            log.Info("Exception occured-ExeuteData():", ex);
            oCon.Close();
            oCon.Dispose();
            oCon = null;

            throw;
        }        
    }
        private void parseProcedureLineage(TStoredProcedureSqlStatement procedureStmt, ProcedureMetaData procedureMetaData, procedure sourceProcedure)
        {
            functionVisitor fv = new functionVisitor(this, procedureMetaData, sourceProcedure);

            procedureStmt.acceptChildren(fv);
        }
            public functionVisitor(ProcedureRelationScanner outerInstance, ProcedureMetaData parentProcedure, procedure procedure)
            {
                this.outerInstance            = outerInstance;
                this.parentProcedure          = parentProcedure;
                this.targetProcedure          = new targetProcedure();
                targetProcedure.coordinate    = procedure.coordinate;
                targetProcedure.highlightInfo = procedure.highlightInfo;
                targetProcedure.name          = procedure.name;
                targetProcedure.owner         = procedure.owner;
                List <targetProcedure> targetProcedureList = getTargetProcedureList(outerInstance.procedures.Item1);

                targetProcedureList.Add(targetProcedure);
                outerInstance.procedures.Item1.targetProcedures = targetProcedureList.ToArray();
            }
        /// <summary>
        /// Description: EnvĂ­a el valor configurado para el procedimiento
        /// </summary>
        private void _textValue_tex_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                if (_textValue_tex.Text != "")
                {
                    float fuelQty = 0;

                    if (float.TryParse(_textValue_tex.Text, out fuelQty) == false)
                    {
                        _textValue_tex.Text = "0";
                        RadWindow.Alert(new DialogParameters
                        {
                            Header          = "Alert",
                            Content         = "Incorrect value",
                            OkButtonContent = "Ok",
                            Owner           = this
                        });
                    }
                    else
                    {
                        if (fuelQty <= 160)
                        {
                            Procedures procedures = SelectFailsProcedures.Where <Procedures>(wprocedure => wprocedure.Procedure.name == "Fuel Qty").First();
                            procedure  procedure  = procedures.Procedure;

                            if (_leftCheckbox_che.IsChecked == true)
                            {
                                procedures.IsChecked = true;
                                procedures.Value     = _textValue_tex.Text;

                                //Logic send procedure Left
                            }
                            else
                            {
                                if (_rightCheckbox_che.IsChecked == true)
                                {
                                    procedures.IsChecked = true;
                                    procedures.Value     = _textValue_tex.Text;

                                    //Logic send procedure Right
                                }
                                else
                                {
                                    if (_bothCheckbox_che.IsChecked == true)
                                    {
                                        procedures.IsChecked = true;
                                        procedures.Value     = _textValue_tex.Text;

                                        //Logic send procedure Both
                                    }
                                    else
                                    {
                                        RadWindow.Alert(new DialogParameters
                                        {
                                            Header          = "Alert",
                                            Content         = "Select a option and send Value",
                                            OkButtonContent = "Ok",
                                            Owner           = this
                                        });
                                    }
                                }
                            }

                            if (_leftCheckbox_che.IsChecked == true || _rightCheckbox_che.IsChecked == true || _bothCheckbox_che.IsChecked == true)
                            {
                                RadWindow.Alert(new DialogParameters
                                {
                                    Header          = "Alert",
                                    Content         = "Value sent",
                                    OkButtonContent = "Ok",
                                    Owner           = this
                                });

                                Keyboard.ClearFocus();
                            }
                        }
                        else
                        {
                            _textValue_tex.Text = "0";
                            RadWindow.Alert(new DialogParameters
                            {
                                Header          = "Alert",
                                Content         = "160 gal max",
                                OkButtonContent = "Ok",
                                Owner           = this
                            });
                        }
                    }
                }
                else
                {
                    RadWindow.Alert(new DialogParameters
                    {
                        Header          = "Alert",
                        Content         = "Complete value field and send Value",
                        OkButtonContent = "Ok",
                        Owner           = this
                    });
                }
            }
        }
Example #19
0
    public DataSet GetData(procedure type, string flashAcctNum,string dtcAcctNum)
    {
        DataSet dsReport = new DataSet();
        string strOut = string.Empty;
        string strCon = ConfigurationSettings.AppSettings["ConnectionSybaseMCM_STAGE"];
        AseConnection oCon = new AseConnection(strCon);
        try
        {
            string strHandler = Convert.ToString(GetFromSession("Handler"));
            int intTimeout;
            AseCommand oCmd = null;
            if (type.Equals(procedure.SEARCH_FLSH_SINGLE))//Equity trades
            {
                oCmd = new AseCommand("SEARCH_FLSH_SINGLE", oCon);
                AseParameter oParam2 = new AseParameter("@flash_number", AseDbType.VarChar, 25);
                oParam2.Value = flashAcctNum;
                oCmd.Parameters.Add(oParam2);

                AseParameter oParam1 = new AseParameter("@dtc_number", AseDbType.VarChar, 25);
                oParam1.Value = dtcAcctNum;
                oCmd.Parameters.Add(oParam1);

            }
            if (type.Equals(procedure.SEARCH_NONACTIVE))//Equity trades
            {
                oCmd = new AseCommand("SEARCH_NotActive", oCon);
                AseParameter oParam2 = new AseParameter("@flash_number", AseDbType.VarChar, 25);
                oParam2.Value = flashAcctNum;
                oCmd.Parameters.Add(oParam2);

                AseParameter oParam1 = new AseParameter("@dtc_number", AseDbType.VarChar, 25);
                oParam1.Value = dtcAcctNum;
                oCmd.Parameters.Add(oParam1);

            }
            

            oCmd.CommandType = CommandType.StoredProcedure;
            intTimeout = oCmd.CommandTimeout;
            oCmd.CommandTimeout = 0;
            AseParameter oParam0 = new AseParameter("@recon_handle", AseDbType.VarChar, 25);
            oParam0.Value = strHandler;
            oCmd.Parameters.Add(oParam0);

            AseDataAdapter oAseAdp = new AseDataAdapter(oCmd);
            oAseAdp.Fill(dsReport);
            oCmd.CommandTimeout = intTimeout;
            oCmd.Dispose();
            oCon.Close();
            oCon.Dispose();
            oCmd = null;
            oCon = null;
        }
        catch (Exception ex)
        {
            log.Info("Exception occured-GetData():", ex);
            oCon.Close();
            oCon.Dispose();
            oCon = null;
            if (ex.Message == "No Flash Record found")
            {
                dsReport = null;
                return dsReport;
            }
            throw;
        }
        return dsReport;
    }
Example #20
0
    public void ExecuteData(procedure type, string forFlashValue, string dtcTicket, string flashTicket, string updatedDtcValue)
    {
        AseConnection oCon = new AseConnection(strCon);

        try
        {
            string strHandler = Convert.ToString(GetFromSession("Handler"));
            int intTimeout;
            AseCommand oCmd = null;
            if (type.Equals(procedure.UpdateMappingBoth))
            {
                oCmd = new AseCommand("UpdateMappingForBoth", oCon);
                AseParameter oParam3 = new AseParameter("@newFlash_number", AseDbType.VarChar, 25);
                oParam3.Value = flashTicket;
                oCmd.Parameters.Add(oParam3);

                
                AseParameter oParam4 = new AseParameter("@newDtc_number", AseDbType.VarChar, 25);
                oParam4.Value = updatedDtcValue;
                oCmd.Parameters.Add(oParam4);
            }
            
            oCmd.CommandType = CommandType.StoredProcedure;
            intTimeout = oCmd.CommandTimeout;
            oCmd.CommandTimeout = 0;
            AseParameter oParam1 = new AseParameter("@flash_number", AseDbType.VarChar, 25);
            oParam1.Value = forFlashValue;
            oCmd.Parameters.Add(oParam1);
            AseParameter oParam2 = new AseParameter("@dtc_number", AseDbType.VarChar, 25);
            oParam2.Value = dtcTicket;
            oCmd.Parameters.Add(oParam2);

            oCon.Open();
            oCmd.ExecuteNonQuery();
            oCmd.CommandTimeout = intTimeout;
            oCmd.Dispose();
            oCon.Close();
            oCon.Dispose();
            oCmd = null;
            oCon = null;
        }
        catch (Exception ex)
        {
            log.Info("Exception occured-Exeute Data():", ex);
            oCon.Close();
            oCon.Dispose();
            oCon = null;

            throw;
        }
    }