protected bool importfile(string filepath)
    {
        bool       status   = false;
        string     yrmo     = ddlYrmo.Text;
        ImportText grImport = new ImportText();

        try
        {
            grImport.ParseGRS(filepath);
            grImport.importGRSRecords(yrmo);
            status = true;
            ImportDAL iobj = new ImportDAL();
            int       _cnt = iobj.getImportCount("GRS", yrmo);
            Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1;
            Audit.auditUserTaskI(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "ANTHEM", "Anthem Billing Reconciliation", "HeadCounts", "GRS Report Import", yrmo, _cnt);
        }
        catch (Exception e)
        {
            ImportDAL iObj = new ImportDAL();
            iObj.Rollback("GRS", yrmo);
            throw e;
        }
        finally
        {
            ImportTextDAL storeData = new ImportTextDAL();
            storeData.deleteStage("GRS");
            File.Delete(filepath);
        }
        return(status);
    }
Пример #2
0
 private void CheckAndImport()
 {
     Errors = string.Empty;
     if (string.IsNullOrWhiteSpace(ImportText))
     {
         Errors = "Input text can not be empty!";
     }
     else
     {
         List <BitcoinAddress> temp = new List <BitcoinAddress>();
         int lineNum = 0;
         foreach (var item in ImportText.SplitToLines())
         {
             lineNum++;
             VerificationResult vr = ValidateAddr(item);
             if (vr.IsVerified)
             {
                 temp.Add(new BitcoinAddress()
                 {
                     Address = item
                 });
             }
             else
             {
                 Errors = string.Format("Invalid address on line {0}: {1}", lineNum, vr.Error);
                 break;
             }
         }
         if (string.IsNullOrEmpty(Errors))
         {
             AddressList = temp;
             OnClosingRequest();
         }
     }
 }
Пример #3
0
    /*void Awake(){
        CreateLevel ();
    }*/
    // Use this for initialization
    public void CreateLevel(int level)
    {
        importedLevel = GetComponent<ImportText> ();

        levelMap = importedLevel.readFile (level);
        GridWidth = levelMap [0].Length;
        GridHeight = levelMap.Length;

        Grid = new string[GridWidth, GridHeight];

        // create planes based on matrix
        for (int y = 0; y < GridHeight; y++) {
            for (int x = 0; x < GridWidth-1; x++) {

                //Spawn floor everywhere
                GameObject toInstantiate = floorTiles[Random.Range (0,floorTiles.Length)];
                Instantiate (toInstantiate, new Vector3 (x, -y, 0f), Quaternion.identity);

                switch (levelMap [y] [x]) {
                case sstart:
                {
                    Instantiate (player, new Vector3 (x, -y, 0f), Quaternion.identity);
                    playerStartPos = new Vector3 (x,-y,0f);
                    break;
                }
                case sbomb:
                    Instantiate (bomb, new Vector3 (x, -y, 0f), Quaternion.identity);
                    break;
                case scoin:
                    Instantiate (coin, new Vector3 (x, -y, 0f), Quaternion.identity);
                    break;
                case sfinish:
                    Instantiate (finish, new Vector3 (x, -y, 0f), Quaternion.identity);
                    break;
                case sfloor_obstacle:
                    Instantiate (floor_obstacle, new Vector3 (x, -y, 0f), Quaternion.identity);
                    break;
                case swall:
                    Instantiate (wall, new Vector3 (x, -y, 0f), Quaternion.identity);
                    break;
                case swalldestroy:
                    Instantiate (wallDestroyable, new Vector3 (x, -y, 0f), Quaternion.identity);
                    break;
                case smovableWall:
                    Instantiate (movableWall, new Vector3 (x, -y, 0), Quaternion.identity);
                    break;
                case skey:
                    Instantiate (key, new Vector3 (x, -y, 0), Quaternion.identity);
                    break;
                case sdoor:
                    Instantiate (door, new Vector3 (x, -y, 0), Quaternion.identity);
                    break;
                }
            }
        }
    }
Пример #4
0
    /*void Awake(){
     *      CreateLevel ();
     * }*/

    // Use this for initialization
    public void CreateLevel(int level)
    {
        importedLevel = GetComponent <ImportText> ();

        levelMap   = importedLevel.readFile(level);
        GridWidth  = levelMap [0].Length;
        GridHeight = levelMap.Length;

        Grid = new string[GridWidth, GridHeight];

        // create planes based on matrix
        for (int y = 0; y < GridHeight; y++)
        {
            for (int x = 0; x < GridWidth - 1; x++)
            {
                //Spawn floor everywhere
                Instantiate(floor_valid, new Vector3(x, -y, 0f), Quaternion.identity);

                switch (levelMap [y] [x])
                {
                case sstart:
                    Instantiate(player, new Vector3(x, -y, 0f), Quaternion.identity);
                    break;

                case sbomb:
                    Instantiate(bomb, new Vector3(x, -y, 0f), Quaternion.identity);
                    break;

                case scoin:
                    Instantiate(coin, new Vector3(x, -y, 0f), Quaternion.identity);
                    break;

                case sfinish:
                    Instantiate(finish, new Vector3(x, -y, 0f), Quaternion.identity);
                    break;

                case sfloor_obstacle:
                    Instantiate(floor_obstacle, new Vector3(x, -y, 0f), Quaternion.identity);
                    break;

                case swall:
                    Instantiate(wall, new Vector3(x, -y, 0f), Quaternion.identity);
                    break;

                case swalldestroy:
                    Instantiate(wallDestroyable, new Vector3(x, -y, 0f), Quaternion.identity);
                    break;

                case smovableWall:
                    Instantiate(movableWall, new Vector3(x, -y, 0), Quaternion.identity);
                    break;
                }
            }
        }
    }
    protected void MatchYRMO(string strFilePath1)
    {
        String     yrmo_input = ddlYrmo.Text;
        ImportText yrmoObj    = new ImportText();
        String     yrmo_file  = yrmoObj.matchYrmoTxt(strFilePath1, "ADP");

        if (yrmo_file == "")
        {
            throw(new Exception("Cannot find Year Month in the file.<br />Please check the format"));
        }
        if (String.Compare(yrmo_file, yrmo_input) != 0)
        {
            throw (new Exception("YRMO entered does not match with the file"));
        }
    }
    protected bool importfile(string filepath)
    {
        string     yrmo      = ddlYrmo.SelectedItem.Text.ToString();
        bool       status    = false;
        ImportText boaImport = new ImportText();

        try
        {
            boaImport.parseBOA(filepath);
            status = true;
            ImportDAL iobj = new ImportDAL();
            int       _cnt = iobj.getImportCount("BOA", yrmo);
            Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1;
            Audit.auditUserTaskI(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "ANTHEM", "Anthem Claims Reconciliation", "BOAStatement", "BOA Statement Import", yrmo, _cnt);
        }
        catch (Exception e)
        {
            status = false;
            throw e;
        }
        return(status);
    }