Ejemplo n.º 1
0
 public void UpdateTdLoad(TdLoad curLoad)
 {
     using (var context = new EstimeContext(options, connString))
     {
         EFHelper.CallEF(() =>
         {
             context.TdLoad.Update(curLoad);
             context.SaveChanges();
         });
     }
 }
Ejemplo n.º 2
0
 public TdLoad AddTdLoad(TdLoad newLoad)
 {
     using (var context = new EstimeContext(options, connString))
     {
         EFHelper.CallEF(() =>
         {
             context.TdLoad.Add(newLoad);
             context.SaveChanges();
         });
     }
     return(newLoad);
 }
Ejemplo n.º 3
0
        //public DataLoadManager(string filePath, int fileType)
        //{
        //    DataLoadManage.filePath = filePath;
        //    DataLoadManage.fileType = fileType;

        //}

        //public void InterprovincialMigrationSubTable(Excel.Worksheet ws, string tableName, string tableSubpart)
        //{
        //    short intStart=1;
        //    short intCol;
        //    short line, dataLineStart, dataLineEnd, provFromId, provToId;
        //    string prov;

        //    //Inter
        //    //ws.Cells.Text;

        //    for (int i =1; i< ws.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row; i++)
        //    {
        //        //Excel.Range r = ws.Cells[intStart, 1];


        //        //if (ws.Cells[intStart, 1].te= "K"){ }


        //    }
        //}

        public long StartLoading(string refPeriodCode, string estimeFileTypeCode, string fileName, string userName)
        {
            estimeFileType = dal.GetEstimeFileTypeByCode(estimeFileTypeCode);
            refPeriodId    = dal.GetRefPeriodId(refPeriodCode);
            int    loadStatusId = dal.GetLoadStatusId("R");
            TdLoad newLoad      = new TdLoad()
            {
                Id               = 0,
                FilePath         = fileName,
                EstimeFileTypeId = estimeFileType.Id,
                StartTime        = System.DateTime.Now,
                LoadStatusId     = loadStatusId,
                UserId           = userName
            };

            curLoad = dal.AddTdLoad(newLoad);

            //Extract worksheet

            return(curLoad.Id);
        }