コード例 #1
0
ファイル: Turn.aspx.cs プロジェクト: natibarbosa/FISIKS
        public static int addEvent(TurneroImportDto pagTurneroImp)
        {
            TurneroDto turno = new TurneroDto();

            turno.TurTitulo      = pagTurneroImp.TurImpTitulo;
            turno.TurDescripcion = pagTurneroImp.TurImpDescripcion;
            turno.TurFechaIni    = Convert.ToDateTime(pagTurneroImp.TurImpFechaIni).ToUniversalTime();
            turno.TurFechaFin    = Convert.ToDateTime(pagTurneroImp.TurImpFechaFin).ToUniversalTime();
            turno.TurTodoDia     = pagTurneroImp.TurImpTodoDia;
            turno.TurPaeId       = Convert.ToInt32(pagTurneroImp.TurImpPaeId);
            turno.TurProId       = Convert.ToInt32(pagTurneroImp.TurImpProId);

            if (CheckAlphaNumeric(turno.TurTitulo) && CheckAlphaNumeric(turno.TurDescripcion))
            {
                int key = ManagerTurnero.InsertaTurnero(ref turno);

                List <int> idList = (List <int>)HttpContext.Current.Session["idList"];

                if (idList != null)
                {
                    idList.Add(key);
                }
                return(key); //return the primary key of the added cevent object
            }
            return(-1);      //return a negative number just to signify nothing has been added
        }
コード例 #2
0
ファイル: Turn.aspx.cs プロジェクト: facujuarez/FISIKS
        public static int AddEvent(ImproperCalendarEvent pagTurnero)
        {
            TurneroDto turno = new TurneroDto();

            turno.TurTitulo      = pagTurnero.title;
            turno.TurDescripcion = pagTurnero.description;
            turno.TurFechaIni    = Convert.ToDateTime(pagTurnero.start).ToUniversalTime();
            turno.TurFechaFin    = Convert.ToDateTime(pagTurnero.end).ToUniversalTime();
            if (pagTurnero.allDay)
            {
                turno.TurTodoDia = "S";
            }
            else
            {
                turno.TurTodoDia = "N";
            }
            turno.TurPae   = Convert.ToInt32(pagTurnero.pae);
            turno.TurPro   = Convert.ToInt32(pagTurnero.pro);
            turno.TurMonto = Convert.ToDecimal(pagTurnero.monto);
            turno.TurOspId = Convert.ToInt32(pagTurnero.osp);


            if (CheckAlphaNumeric(turno.TurTitulo) && CheckAlphaNumeric(turno.TurDescripcion))
            {
                int key = ManagerTurnero.InsertaTurnero(turno);

                List <int> idList = (List <int>)HttpContext.Current.Session["idList"];

                if (idList != null)
                {
                    idList.Add(key);
                }
                return(key); //return the primary key of the added cevent object
            }
            else
            {
                return(-1); //return a negative number just to signify nothing has been added
            }
        }