public void Setup()
        {
            //Instance Fields Setup
            BooleanField = null;
            ByteField = null;
            SByteField = null;
            IntField = null;
            LongField = null;
            Int16Field = null;
            UInt16Field = null;
            Int32Field = null;
            UInt32Field = null;
            Int64Field = null;
            UInt64Field = null;
            CharField = null;
            DoubleField = null;
            FloatField = null;

            //Static Fields Setup
            BooleanFieldStatic = null;
            ByteFieldStatic = null;
            SByteFieldStatic = null;
            IntFieldStatic = null;
            LongFieldStatic = null;
            Int16FieldStatic = null;
            UInt16FieldStatic = null;
            Int32FieldStatic = null;
            UInt32FieldStatic = null;
            Int64FieldStatic = null;
            UInt64FieldStatic = null;
            CharFieldStatic = null;
            DoubleFieldStatic = null;
            FloatFieldStatic = null;
        }
Ejemplo n.º 2
0
 public Rider(byte[] idArray)
 {
     uuid = idArray;
     rpm = hr = power = kcal = clock = gear = null;
     rssi = null;
     updates = 0;
     timeFromStart = Stopwatch.StartNew();
     timeFromUpdate = Stopwatch.StartNew();
 }
Ejemplo n.º 3
0
 public Rider(UInt16 id)
 {
     this.id = id;
     rpm = hr = power = kcal = clock = gear = null;
     rssi = null;
     updates = 0;
     timeFromStart = Stopwatch.StartNew();
     timeFromUpdate = Stopwatch.StartNew();
 }
        private void add_transition(int from, int to, short? flow)
        {
            ++edges_num;

            //najpierw rozszerz "w szerz"
            int num_vertices = Math.Max(from, to) + 1;

            //rozszerz macierz w wzdłuż by móc zmieścić dodatkowe przejście
            height();

            matrix[edges_num] = new Int16?[num_vertices];
            matrix[edges_num][from] = flow;
            matrix[edges_num][to] = -1;
        }
        public TrendComparisonInteger( TrendLineInteger trend1, TrendLineInteger trend2 )
        {
            if ( trend1 == null ) throw new ArgumentNullException("trend1");
            if ( trend2 == null ) throw new ArgumentNullException("trend2");
            if ( trend1.CountAll != trend2.CountAll ) throw new ArgumentException("The two trends should have the same number of years.");
            _count = trend1.CountAll;

            Int16[] surveyYears1 = trend1.SurveyYears;
            Int16[] surveyYears2 = trend2.SurveyYears;
            Int16?[] points1 = trend1.Values;
            Int16?[] points2 = trend2.Values;

            for ( Int32 i = 0; i < trend2.CountAll; i++ ) {
                if ( surveyYears1[i] != surveyYears2[i] ) {
                    throw new ArgumentException("The SurveyYear at element " + i + " should match.");
                }
                else if ( points1[i] == null && points2[i] == null ) {
                    _countOfNullDoubles += 1;
                    _agreementCountOfNulls += 1;
                }
                else if ( (points1[i] == null) || (points2[i] == null) ) {
                    _countOfNullSingles += 1;
                    _disagreementCountIncludingNulls += 1;
                    _lastNonMutualNullPointsYear = surveyYears1[i];
                }
                else if ( !points1[i].Equals(points2[i]) ) {
                    _countOfNullZeros += 1;
                    _disagreementCountExcludingNulls += 1;
                    _disagreementCountIncludingNulls += 1;
                    _lastMutualNonNullPointsAgree = false;
                    _lastNonMutualNullPointsYear = surveyYears1[i];
                    if ( points1[i] == 1 || points2[i] == 1 )
                        _disagreementCountOfOnes += 1;
                }
                else {
                    _countOfNullZeros += 1;
                    _agreementCountExcludingNulls += 1;
                    _lastMutualNonNullPointsAgree = true;
                    _lastNonMutualNullPointsYear = surveyYears1[i];
                    Trace.Assert(points1[i].Equals(points2[i]), "If the execution got here, the two values should be equal.");
                    if ( points1[i] == 1 )
                        _agreementCountOfOnes += 1;
                }
            }

            _jumpsAgreePerfectly = trend1.Jumps.SequenceEqual(trend2.Jumps);
        }
        public TrendComparisonDate( TrendLineDate trend1, TrendLineDate trend2 )
        {
            if ( trend1 == null ) throw new ArgumentNullException("trend1");
            if ( trend2 == null ) throw new ArgumentNullException("trend2");
            if ( trend1.CountAll != trend2.CountAll ) throw new ArgumentException("The two trends should have the same number of years.");
            _count = trend1.CountAll;

            Int16[] surveyYears1 = trend1.SurveyYears;
            Int16[] surveyYears2 = trend2.SurveyYears;
            DateTime?[] points1 = trend1.Dates;
            DateTime?[] points2 = trend2.Dates;

            for ( Int32 i = 0; i < trend2.CountAll; i++ ) {
                if ( surveyYears1[i] != surveyYears2[i] ) {
                    throw new ArgumentException("The SurveyYear at element " + i + " should match.");
                }
                else if ( points1[i] == null && points2[i] == null ) {
                    _countOfNullDoubles += 1;
                    _agreementCountOfNulls += 1;
                }
                else if ( (points1[i] == null) || (points2[i] == null) ) {
                    _countOfNullSingles += 1;
                    _disagreementCountIncludingNulls += 1;
                    _lastNonMutualNullPointsYear = surveyYears1[i];
                }
                else if ( DateDifferenceWithinThreshold(points1[i].Value, points2[i].Value) ) {
                    _countOfNullZeros += 1;
                    _agreementCountExcludingNulls += 1;
                    _lastMutualNonNullPointsAgree = true;
                    _lastNonMutualNullPointsYear = surveyYears1[i];
                }
                else {
                    _countOfNullZeros += 1;
                    _disagreementCountExcludingNulls += 1;
                    _disagreementCountIncludingNulls += 1;
                    _lastMutualNonNullPointsAgree = false;
                    _lastNonMutualNullPointsYear = surveyYears1[i];
                }
            }

            _jumpsAgreePerfectly = trend1.Jumps.SequenceEqual(trend2.Jumps);
            //_trend1 = trend1;			//_trend2 = trend2;
        }
Ejemplo n.º 7
0
 public Inode(DateTime? changeTime, Int64? number, Int16? majorDevice, Int16? minorDevice, Int16? cMajorDevice, Int16? cMinorDevice)
 {
     this.changeTime = changeTime;
     if ((number != null) && (majorDevice != null) && (minorDevice != null))
     {
         this.number = number;
         this.majorDevice = majorDevice;
         this.minorDevice = minorDevice;
     }
     else if ((number != null) || (majorDevice != null) || (minorDevice != null))
         throw new ArgumentException("Inode class must have either number, major-device and minor-device nodes together or neither of them at all.");
     if ((cMajorDevice != null) && (cMinorDevice != null))
     {
         this.cMajorDevice = cMajorDevice;
         this.cMinorDevice = cMinorDevice;
     }
     else if ((cMajorDevice != null) || (cMinorDevice != null))
         throw new ArgumentException("Inode class must have either c-major-device and c-minor-device nodes together or neither of them at all.");
 }
Ejemplo n.º 8
0
 //constructor para parametro
 public Solicitud(Int64 idBeneficiario
                  , Int16 codPrestacion
                  , Int16 codPais
                  , bool Mercosur
                  , string referencia_exterior
                  , string Ubicacion_Fisica
                  , DateTime?fechaIngreso
                  , Int16?codMotivo
                  , String observaciones)
 {
     base.IdBeneficiario       = idBeneficiario;
     this._codMotivo           = codMotivo;
     base.CodigoPais           = codPais;
     base.CodPrestacion        = codPrestacion;
     this._referencia_exterior = referencia_exterior;
     base.Mercosur             = Mercosur;
     this._ubicacion_Fisica    = Ubicacion_Fisica;
     this._fechaIngreso        = fechaIngreso;
     this._observaciones       = observaciones;
 }
 public ActionResult Estadisticas(String mensaje, Int16?identificador, int?iduser, String usuario)
 {
     ViewBag.iduser  = iduser;
     ViewBag.usuario = usuario;
     ViewBag.mensaje = mensaje;
     try{
         List <entTemporal> t = negUsuario.Instancia.Asig_Total_Espera((int)iduser);
         ViewBag.tae     = t;
         ViewBag.conteo  = negUsuario.Instancia.CountVentEfectivasXase((int)iduser);
         ViewBag.estados = negPedido.Instancia.ListEstados();
         if (identificador == 5)
         {
             Session.Remove("ListaComs");
         }
         return(View());
     }
     catch (Exception e) {
         return(RedirectToAction("lstUsuariosEstadoAsignacionLlamadas", new { mensaje = e.Message }));
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Lấy key trực tiếp từ sql cho form
        /// </summary>
        /// <param name="Key">từ khóa</param>
        /// <param name="LangID">ngôn ngữ</param>
        /// <returns></returns>
        public static iMessager getMessagerByKey(keyWord.MessagerKey Key, Int16?LangID)
        {
            iMessager mess = new iMessager
            {
                Messager = string.Empty,
                Title    = string.Empty
            };
            DataSet ds = new DataSet();

            ds = MASSAGERDAO.getMessagerByKey(Key.ToString(), LangID);
            if (ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    mess.Title    = ds.Tables[0].Rows[0]["Title"] != null ? ds.Tables[0].Rows[0]["Title"].ToString() : "";
                    mess.Messager = ds.Tables[0].Rows[0]["Messager"] != null ? ds.Tables[0].Rows[0]["Messager"].ToString() : "";
                }
            }
            return(mess);
        }
Ejemplo n.º 11
0
        public static Int16?[] RetrieveIsAlive( Int32 subjectTag, Int16[] surveyYears, LinksDataSet.tblFatherOfGen2DataTable dtInput )
        {
            if ( dtInput == null ) throw new ArgumentNullException("dtInput");
            if ( surveyYears == null ) throw new ArgumentNullException("surveyYears");
            if ( dtInput.Count <= 0 ) throw new ArgumentException("There should be at least one row in tblFatherOfGen2.");

            Int16?[] values = new Int16?[surveyYears.Length];
            for ( Int32 i = 0; i < values.Length; i++ ) {
                LinksDataSet.tblFatherOfGen2Row dr = RetrieveRow(subjectTag, surveyYears[i], dtInput);
                if ( dr == null )
                    values[i] = null;
                else if ( (YesNo)dr.BiodadAlive == YesNo.ValidSkipOrNoInterviewOrNotInSurvey )
                    values[i] = null;
                else if ( (YesNo)dr.BiodadAlive == YesNo.InvalidSkip )
                    values[i] = null;
                else
                    values[i] = dr.BiodadAlive;
            }
            return values;
        }
Ejemplo n.º 12
0
 public string SelectFacName(Int16?FacId)
 {
     try
     {
         DataSet       ds  = new DataSet();
         SqlConnection con = con = new SqlConnection(ConfigurationManager.ConnectionStrings["UniversityDatabaseConnectionString"].ToString());
         SqlCommand    cmd = new SqlCommand("select FACNAME from FACULTY_PROFILE$ where FACID=@FACID", con);
         cmd.Parameters.AddWithValue("FACID", FacId);
         con.Open();
         SqlDataAdapter da = new SqlDataAdapter();
         da.SelectCommand = cmd;
         da.Fill(ds);
         con.Close();
         return(ds.Tables[0].Rows[0]["FACNAME"].ToString());
     }
     catch (Exception ee)
     {
         return("");
     }
 }
Ejemplo n.º 13
0
        public static Int16?[] RetrieveDistanceFromHH( Int32 subjectTag, Int16[] surveyYears, LinksDataSet.tblFatherOfGen2DataTable dtInput )
        {
            if ( dtInput == null ) throw new ArgumentNullException("dtInput");
            if ( surveyYears == null ) throw new ArgumentNullException("surveyYears");
            if ( dtInput.Count <= 0 ) throw new ArgumentException("There should be at least one row in tblFatherOfGen2.");

            Int16?[] distances = new Int16?[surveyYears.Length];
            for ( Int32 i = 0; i < distances.Length; i++ ) {
                LinksDataSet.tblFatherOfGen2Row dr = RetrieveRow(subjectTag, surveyYears[i], dtInput);
                if ( dr == null )
                    distances[i] = null;
                else if ( dr.IsBiodadDistanceFromHHNull() )
                    distances[i] = null;
                else if ( (YesNo)dr.BiodadDistanceFromHH == YesNo.InvalidSkip )
                    distances[i] = null;
                else
                    distances[i] = dr.BiodadDistanceFromHH;
            }
            return distances;
        }
Ejemplo n.º 14
0
        public static Int16?ToInt16Nullable(this String Expr)
        {
            Int16?result = null;

            if (Expr.IsNullOrEmpty())
            {
                return(result);
            }

            Expr = Expr.Trim();

            Int16 newInt16;

            if (Int16.TryParse(Expr, out newInt16))
            {
                result = newInt16;
            }

            return(result);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Search tasks with parameters choosen by user.
        /// </summary>
        private void SearchTasks()
        {
            int?     UserID = null;
            string   Title = String.Empty, Designation = String.Empty, Designations = String.Empty, Statuses = String.Empty;
            Int16?   Status = null;
            DateTime?CreatedFrom = null, CreatedTo = null;


            // this is for paging based data fetch, in header view case it will be always page numnber 0 and page size 5
            int Start = gvTasks.PageIndex, PageLimit = gvTasks.PageSize;

            PrepareSearchFilters(ref UserID, ref Title, ref Designation, ref Status, ref CreatedFrom, ref CreatedTo, ref Statuses, ref Designations);

            DataSet dsResult = TaskGeneratorBLL.Instance.GetTasksList(UserID, Title, Designation, Status, CreatedFrom, CreatedTo, Statuses, Designations, this.IsAdminMode, Start, PageLimit);

            gvTasks.VirtualItemCount = Convert.ToInt32(dsResult.Tables[1].Rows[0]["VirtualCount"].ToString());

            gvTasks.DataSource = dsResult;
            gvTasks.DataBind();
        }
Ejemplo n.º 16
0
        public Int16?ToInt16Nullable(object x, bool useDefaultForNull = false)
        {
            Int16?result = null;

            if (!DBNull.Value.Equals(x))
            {
                if (x != null)
                {
                    result = System.Convert.ToInt16(x);
                }
                else
                {
                    if (useDefaultForNull)
                    {
                        result = 0;
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 17
0
        public static Int16?ConvertStringWinBuildNumber(String buildNumberString)
        {
            Int16?ret = null;

            if (!String.IsNullOrEmpty(buildNumberString))
            {
                if (buildNumberString.Contains("."))
                {
                    buildNumberString = buildNumberString.Split(new char[] { '.' })[0];
                }

                Int16 test = -1;
                if (Int16.TryParse(buildNumberString, out test))
                {
                    ret = test;
                }
            }

            return(ret);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Dodaj krawędź do grafu
        /// </summary>
        /// <param name="from">Startowy wierzchołek</param>
        /// <param name="to">Końcowy wierzchołek</param>
        /// <param name="flow">Przepływ pomiędzy wierzchołkami</param>
        public void addEdge(int from, int to, Int16? flow)
        {
            //najpierw rozszerz "w szerz"
            if (from >= num_vertices || to >= num_vertices)
            {
                num_vertices = Math.Max(from, to)+1;
                width();
            }

            if (num_edges >= max_edges)
            {
                height();
            }

            matrix[num_edges] = new Int16?[num_vertices];
            matrix[num_edges][from] = flow;
            matrix[num_edges][to] = -1;

            ++num_edges;
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Dodaj krawędź do grafu
        /// </summary>
        /// <param name="from">Startowy wierzchołek</param>
        /// <param name="to">Końcowy wierzchołek</param>
        /// <param name="flow">Przepływ pomiędzy wierzchołkami</param>
        public void addEdge(int from, int to, Int16?flow)
        {
            //najpierw rozszerz "w szerz"
            if (from >= num_vertices || to >= num_vertices)
            {
                num_vertices = Math.Max(from, to) + 1;
                width();
            }

            if (num_edges >= max_edges)
            {
                height();
            }

            matrix[num_edges]       = new Int16?[num_vertices];
            matrix[num_edges][from] = flow;
            matrix[num_edges][to]   = -1;

            ++num_edges;
        }
Ejemplo n.º 20
0
        public void Buscar()
        {
            string valorPuertoDesde = textBoxPuertoDesde.Text;
            string valorPuertoHasta = textBoxPuertoHasta.Text;
            string textHabilitado   = Convert.ToString(comboBoxHabilitado.SelectedItem);
            Int16? valorHabilitado  = null;

            if (!textHabilitado.Equals("Todos"))
            {
                valorHabilitado = (textHabilitado.Equals("Si")) ? (Int16)1 : (Int16)0;
            }

            List <Recorrido> recorridos = RepoRecorrido.instancia
                                          .EncontrarPorParametros(valorPuertoDesde, valorPuertoHasta, valorHabilitado);

            dataGridViewRecorrido.DataSource            = recorridos;
            dataGridViewRecorrido.MultiSelect           = false;
            dataGridViewRecorrido.Columns["id"].Visible = false;
            this.actualizarRecorridos();
        }
Ejemplo n.º 21
0
 public string SelectDeptName(Int16?DeptId)
 {
     try
     {
         DataSet       ds  = new DataSet();
         SqlConnection con = con = new SqlConnection(ConfigurationManager.ConnectionStrings["UniversityDatabaseConnectionString"].ToString());
         SqlCommand    cmd = new SqlCommand("select DEPTNAME from DEPT_PROFILE$ where DEPTNO=@DEPTNO", con);
         cmd.Parameters.AddWithValue("DEPTNO", DeptId);
         con.Open();
         SqlDataAdapter da = new SqlDataAdapter();
         da.SelectCommand = cmd;
         da.Fill(ds);
         con.Close();
         string deptname = ds.Tables[0].Rows[0]["DEPTNAME"].ToString();
         return(deptname);
     }
     catch (Exception ee)
     {
         return("");
     }
 }
Ejemplo n.º 22
0
 ///<Summary>
 ///Constructor
 ///This constructor initializes the business object from its respective data object
 ///</Summary>
 ///<returns>
 ///void
 ///</returns>
 ///<parameters>
 ///DAOAlphabeticalListOfProducts
 ///</parameters>
 protected internal BOAlphabeticalListOfProducts(IDAOAlphabeticalListOfProducts daoAlphabeticalListOfProducts)
 {
     try
     {
         _productID       = daoAlphabeticalListOfProducts.ProductID;
         _productName     = daoAlphabeticalListOfProducts.ProductName;
         _supplierID      = daoAlphabeticalListOfProducts.SupplierID;
         _categoryID      = daoAlphabeticalListOfProducts.CategoryID;
         _quantityPerUnit = daoAlphabeticalListOfProducts.QuantityPerUnit;
         _unitPrice       = daoAlphabeticalListOfProducts.UnitPrice;
         _unitsInStock    = daoAlphabeticalListOfProducts.UnitsInStock;
         _unitsOnOrder    = daoAlphabeticalListOfProducts.UnitsOnOrder;
         _reorderLevel    = daoAlphabeticalListOfProducts.ReorderLevel;
         _discontinued    = daoAlphabeticalListOfProducts.Discontinued;
         _categoryName    = daoAlphabeticalListOfProducts.CategoryName;
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 23
0
 public DataSet SelectEmpData(Int16?Empid)
 {
     try
     {
         DataSet       ds  = new DataSet();
         SqlConnection con = con = new SqlConnection(ConfigurationManager.ConnectionStrings["UniversityDatabaseConnectionString"].ToString());
         SqlCommand    cmd = new SqlCommand("select EMPNAME,DESIGNATION,DEPTNO,FACID from EMP_PROFILE$ where EMPNO=@EMPNO", con);
         cmd.Parameters.AddWithValue("EMPNO", Empid);
         con.Open();
         SqlDataAdapter da = new SqlDataAdapter();
         da.SelectCommand = cmd;
         da.Fill(ds);
         con.Close();
         return(ds);
     }
     catch (Exception ee)
     {
         Response.Write("<script>alert('Error While Fetching Employee Details!!');</script>");
         return(new DataSet());
     }
 }
Ejemplo n.º 24
0
        protected override void ProcessGetRequestWrapped(Valis.Core.VLAccessToken accessToken, HttpContext context)
        {
            var surveyId = TryParseInt32(context, "surveyId");
            var pageId = TryParseInt16(context, "pageId");
            var textsLanguage = TryParseInt16(context, "textsLanguage", required: false, defValue: 0);
            Int16? skipToPage = TryParseInt16(context, "skipToPage", false, null);


            var surveyManager = VLSurveyManager.GetAnInstance(accessToken);

            VLSurveyPage surveyPage = null;

            if(skipToPage.HasValue)
                surveyPage = surveyManager.SetPageSkipLogic(surveyId, pageId, skipToPage.Value, textsLanguage);
            else
                surveyPage = surveyManager.UnSetPageSkipLogic(surveyId, pageId, textsLanguage);


            var _item = new
            {
                surveyPage.Survey,
                surveyPage.PageId,
                surveyPage.DisplayOrder,

                surveyPage.HasSkipLogic,
                surveyPage.CustomId,
                surveyPage.SkipTo,
                surveyPage.SkipToPage,
                surveyPage.SkipToWebUrl,

                surveyPage.TextsLanguage,
                surveyPage.ShowTitle,
                surveyPage.Description,
                CreateDT = surveyPage.CreateDT.ToShortDateString(),
                LastUpdateDT = surveyPage.LastUpdateDT.ToShortDateString(),
            };

            var response = JsonConvert.SerializeObject(_item, Formatting.None);
            context.Response.Write(response);
        }
Ejemplo n.º 25
0
        private void Search_Student_Details()
        {
            Reset_Controls();
            if (string.IsNullOrEmpty(txtRegistrationNo.Text))
            {
                MessageBox.Show("Registration Number is required.", "Student TC", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                StudentRegistration registration       = new StudentRegistration();
                RegistrationModel   _registrationModel = new RegistrationModel();
                _registrationModel = registration.Get_Student_Detail(Convert.ToInt64(txtRegistrationNo.Text));

                if (_registrationModel.RegistrationNo == null)
                {
                    _registrationModel = registration.Get_InActive_Student_Detail(Convert.ToInt64(txtRegistrationNo.Text));
                }

                if (_registrationModel.RegistrationNo != null)
                {
                    lblStudentNameValue.Text    = _registrationModel.FullName;
                    lblClassValue.Text          = _registrationModel.ClassSection;
                    lblStudentNameValue.Visible = true;
                    lblClassValue.Visible       = true;
                    lblStudentName.Visible      = true;
                    lblClass.Visible            = true;
                    panelInfo.Visible           = true;
                    _class_ID   = _registrationModel.CurrentClass;
                    _section_ID = _registrationModel.CurrentSection;
                    _student_ID = (long)_registrationModel.StudentID;
                    Get_Student_TC_Details();
                }
                else
                {
                    MessageBox.Show("Invalid Registration Number.", "Student TC", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Reset_Controls();
                    txtRegistrationNo.Text = string.Empty;
                }
            }
        }
Ejemplo n.º 26
0
 public ActionResult Login(String mensaje, Int16?identificador)
 {
     ViewBag.mensaje       = mensaje;
     ViewBag.identificador = identificador;
     try
     {
         if (Session["usuario"] != null)
         {
             entUsuario u           = (entUsuario)Session["usuario"];
             String     TipoUsuario = u.TipoUsuario.TipUsu_Nombre.Replace(" ", "").ToString();
             return(RedirectToAction("Principal" + TipoUsuario, TipoUsuario));
         }
         else
         {
             return(View());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 27
0
 ///<Summary>
 ///Initializer
 ///Initializer using primary key(s)
 ///</Summary>
 ///<returns>
 ///void
 ///</returns>
 ///<parameters>
 ///Int32 productID
 ///</parameters>
 public void Init(Int32 productID)
 {
     try
     {
         IDAOProducts daoProducts = _iProductsRepository.SelectOne(productID);
         _productID       = daoProducts.ProductID;
         _productName     = daoProducts.ProductName;
         _supplierID      = daoProducts.SupplierID;
         _categoryID      = daoProducts.CategoryID;
         _quantityPerUnit = daoProducts.QuantityPerUnit;
         _unitPrice       = daoProducts.UnitPrice;
         _unitsInStock    = daoProducts.UnitsInStock;
         _unitsOnOrder    = daoProducts.UnitsOnOrder;
         _reorderLevel    = daoProducts.ReorderLevel;
         _discontinued    = daoProducts.Discontinued;
         _ctrVersion      = daoProducts.CtrVersion;
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 28
0
        ///<Summary>
        ///Update one row by primary key(s)
        ///This method allows the object to update itself in the table Order Details based on its primary key(s)
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void Update()
        {
            Doing(this);
            SqlCommand command = new SqlCommand();

            command.CommandText = InlineProcs.ctprOrderDetails_UpdateOne;
            command.CommandType = CommandType.Text;
            command.Connection  = _connectionProvider.Connection;
            command.Transaction = _connectionProvider.CurrentTransaction;

            try
            {
                command.Parameters.Add(CtSqlParameter.Get("@OrderID", SqlDbType.Int, 4, ParameterDirection.InputOutput, false, 10, 0, "", DataRowVersion.Proposed, (object)_orderID ?? (object)DBNull.Value));
                command.Parameters.Add(CtSqlParameter.Get("@ProductID", SqlDbType.Int, 4, ParameterDirection.InputOutput, false, 10, 0, "", DataRowVersion.Proposed, (object)_productID ?? (object)DBNull.Value));
                command.Parameters.Add(CtSqlParameter.Get("@UnitPrice", SqlDbType.Money, 8, ParameterDirection.InputOutput, false, 19, 4, "", DataRowVersion.Proposed, (object)_unitPrice ?? (object)DBNull.Value));
                command.Parameters.Add(CtSqlParameter.Get("@Quantity", SqlDbType.SmallInt, 2, ParameterDirection.InputOutput, false, 5, 0, "", DataRowVersion.Proposed, (object)_quantity ?? (object)DBNull.Value));
                command.Parameters.Add(CtSqlParameter.Get("@Discount", SqlDbType.Real, 4, ParameterDirection.InputOutput, false, 24, 0, "", DataRowVersion.Proposed, (object)_discount ?? (object)DBNull.Value));
                command.Parameters.Add(CtSqlParameter.Get("@ctr_version", SqlDbType.Int, 4, ParameterDirection.InputOutput, false, 10, 0, "", DataRowVersion.Proposed, (object)_ctrVersion ?? (object)DBNull.Value));

                command.ExecuteNonQuery();
                Done(this);

                _orderID    = Convert.IsDBNull(command.Parameters["@OrderID"].Value) ? (Int32?)null : (Int32?)command.Parameters["@OrderID"].Value;
                _productID  = Convert.IsDBNull(command.Parameters["@ProductID"].Value) ? (Int32?)null : (Int32?)command.Parameters["@ProductID"].Value;
                _unitPrice  = Convert.IsDBNull(command.Parameters["@UnitPrice"].Value) ? (decimal?)null : (decimal?)command.Parameters["@UnitPrice"].Value;
                _quantity   = Convert.IsDBNull(command.Parameters["@Quantity"].Value) ? (Int16?)null : (Int16?)command.Parameters["@Quantity"].Value;
                _discount   = Convert.IsDBNull(command.Parameters["@Discount"].Value) ? (float?)null : (float?)command.Parameters["@Discount"].Value;
                _ctrVersion = Convert.IsDBNull(command.Parameters["@ctr_version"].Value) ? (Int32?)null : (Int32?)command.Parameters["@ctr_version"].Value;
            }
            catch (Exception ex)
            {
                Failed(this, ex);
                Handle(this, ex);
            }
            finally
            {
                command.Dispose();
            }
        }
Ejemplo n.º 29
0
        public void TestStringToInt16Nullable()
        {
            // Test conversion of target type minimum value
            Int16?resultMin = "-32768".ToInt16Nullable();

            Assert.AreEqual((short)-32768, resultMin);

            // Test conversion of fixed value (42)
            Int16?result42 = "42".ToInt16Nullable();

            Assert.AreEqual((short)42, result42);

            // Test conversion of target type maximum value
            Int16?resultMax = "32767".ToInt16Nullable();

            Assert.AreEqual((short)32767, resultMax);

            // Test conversion of "foo"
            Int16?resultFoo = "foo".ToInt16Nullable();

            Assert.IsNull(resultFoo);
        }
 public VLClientUserView()
 {
     m_client              = default(Int32);
     m_userId              = default(Int32);
     m_defaultLanguageId   = null;
     m_defaultLanguageName = default(string);
     m_title                                  = default(string);
     m_department                             = default(string);
     m_firstName                              = default(string);
     m_lastName                               = default(string);
     m_countryId                              = null;
     m_countryName                            = default(string);
     m_timeZoneId                             = default(string);
     m_prefecture                             = default(string);
     m_town                                   = default(string);
     m_address                                = default(string);
     m_zip                                    = default(string);
     m_telephone1                             = default(string);
     m_telephone2                             = default(string);
     m_email                                  = default(string);
     m_isActive                               = default(Boolean);
     m_isBuiltIn                              = default(Boolean);
     m_attributeFlags                         = default(Int32);
     m_roleId                                 = default(Int16);
     m_roleName                               = default(string);
     m_lastActivityDate                       = null;
     m_credentialId                           = default(Int32);
     m_logOnToken                             = default(string);
     m_pswdFormat                             = default(Int32);
     m_isApproved                             = default(Boolean);
     m_isLockedOut                            = default(Boolean);
     m_lastLoginDate                          = null;
     m_lastPasswordChangedDate                = null;
     m_lastLockoutDate                        = null;
     m_failedPasswordAttemptCount             = default(Int32);
     m_failedPasswordAttemptWindowStart       = null;
     m_failedPasswordAnswerAttemptCount       = default(Int32);
     m_failedPasswordAnswerAttemptWindowStart = null;
 }
Ejemplo n.º 31
0
 private void Fetch(SafeDataReader dr)
 {
     Database.LogInfo("CategoryProduct.FetchDR", GetHashCode());
     try
     {
         _ProductID       = dr.GetInt32("ProductID");
         _ProductName     = dr.GetString("ProductName");
         _SupplierID      = (int?)dr.GetValue("SupplierID");
         _QuantityPerUnit = dr.GetString("QuantityPerUnit");
         _UnitPrice       = (decimal?)dr.GetValue("UnitPrice");
         _UnitsInStock    = (Int16?)dr.GetValue("UnitsInStock");
         _UnitsOnOrder    = (Int16?)dr.GetValue("UnitsOnOrder");
         _ReorderLevel    = (Int16?)dr.GetValue("ReorderLevel");
         _Discontinued    = dr.GetBoolean("Discontinued");
     }
     catch (Exception ex)             // FKItem Fetch
     {
         Database.LogException("CategoryProduct.FetchDR", ex);
         throw new DbCslaException("CategoryProduct.Fetch", ex);
     }
     MarkOld();
 }
Ejemplo n.º 32
0
Archivo: Comm.cs Proyecto: siszoey/GT
        public static Int16?ToInt16(object value)
        {
            Int16?vResult = null;

            if (value is SqlInt16)
            {
                vResult = ((SqlInt16)value).IsNull ? (short)0 : ((SqlInt16)value).Value;
            }
            else if (value is Int16)
            {
                vResult = value == DBNull.Value ? null : (Int16?)value;
            }
            else if (value is DBNull)
            {
                vResult = null;
            }
            else
            {
                vResult = Convert.ToInt16(value);
            }
            return(vResult);
        }
Ejemplo n.º 33
0
 public ActionResult ListaSupervisores(String mensaje, Int16?identificador)
 {
     try
     {
         ViewBag.mensaje       = mensaje;
         ViewBag.identificador = identificador;
         entUsuario u = (entUsuario)Session["usuario"];
         if (u != null)
         {
             List <entUsuario> Lista = negGerente.Instancia.ListaSupervisores();
             return(View(Lista));
         }
         else
         {
             return(RedirectToAction("Index", "Inicio"));
         }
     }
     catch (Exception e)
     {
         return(RedirectToAction("ListaSupervisores", "Gerente", new { mensaje = e.Message, identificador = 2 }));
     }
 }
Ejemplo n.º 34
0
        public FUNCTIONS ModificationQuery(Int16?SN)
        {
            FUNCTIONS row = null;

            using (DbCommand cmd = Db.CreateConnection().CreateCommand())
            {
                string sql = @"
SELECT SN, NAME, MODE, CATEGORY, URL, PARENT_SN, SORT, CDATE, CUSER, MDATE, MUSER
    FROM FUNCTIONS WHERE SN=@SN;
";
                Db.AddInParameter(cmd, "SN", DbType.Int32, SN);

                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sql;
                using (IDataReader reader = Db.ExecuteReader(cmd))
                {
                    while (reader.Read())
                    {
                        row = new FUNCTIONS
                        {
                            SN        = reader["SN"] as Int16? ?? null,
                            NAME      = reader["NAME"] as string,
                            MODE      = reader["MODE"] as string,
                            CATEGORY  = reader["CATEGORY"] as string,
                            URL       = reader["URL"] as string,
                            PARENT_SN = reader["PARENT_SN"] as Int16? ?? null,
                            SORT      = reader["SORT"] as Int16? ?? null,
                            CDATE     = reader["CDATE"] as DateTime? ?? null,
                            CUSER     = reader["CUSER"] as Int16? ?? null,
                            MDATE     = reader["MDATE"] as DateTime? ?? null,
                            MUSER     = reader["MUSER"] as Int16? ?? null
                        };
                    }
                }
            }

            return(row);
        }
Ejemplo n.º 35
0
        public ObjectParameter InsertInvoiceRecord(IRow InvoiceDetails, Int16?AnchorCompId)
        {
            int             result        = 0;
            ObjectParameter ReturnedValue = new ObjectParameter("ReturnValue", typeof(int));

            try
            {
                string Pan_Number = InvoiceDetails.Cells[6].ToString();
                var    VendorID   = (from data in finocartEntities1.Companies where data.Pan_number == Pan_Number select data.CompanyID).FirstOrDefault();

                finocartEntities1.proc_InsertInvoiceData(
                    InvoiceDetails.Cells[0].ToString(), Convert.ToDateTime(InvoiceDetails.Cells[1].ToString()), InvoiceDetails.Cells[2].ToString(), AnchorCompId, Convert.ToDecimal(InvoiceDetails.Cells[3].ToString()), Convert.ToDateTime(InvoiceDetails.Cells[4].ToString()), Convert.ToDecimal(InvoiceDetails.Cells[5].ToString()), ReturnedValue, VendorID

                    //null, null, null, 2, null, null, null, null, ReturnedValue, VendorID
                    );
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(ReturnedValue);
        }
Ejemplo n.º 36
0
        public ONovedadHistoEstados(
            int tramite, int idEstadoNovedad, string DEstadoNovedad, long CuilTomador, int nroCredito, Int16?CuotasPendiente, Int16?CuotasPaga, Int16?CuotasImpaga,
            Int16?CuotasEnviadaLiq, string Fecha, string expediente, Int32?mensual, string motivo, string usuario, string oficina, string ip
            )
        {
            this.NroCredito       = nroCredito;
            this.Tramite          = tramite;
            this.idEstadoNovedad  = idEstadoNovedad;
            this.DescEstado       = DEstadoNovedad;
            this.cuilTomador      = CuilTomador;
            this.CuotasPendiente  = CuotasPendiente;
            this.CuotasPaga       = CuotasPaga;
            this.CuotasImpaga     = CuotasImpaga;
            this.CuotasEnviadaLiq = CuotasEnviadaLiq;
            this.Fecha            = Fecha;
            this.expediente       = expediente;
            this.Mensual          = mensual;
            this.Motivo           = motivo;

            this.oficina = oficina;
            this.usuario = usuario;
            this.ip      = ip;
        }
Ejemplo n.º 37
0
        public Int32 WriteNullableInt16(Int16?value)
        {
            if ((mWriter == null) || (mStream == null))
            {
                return(AResult.AE_FAIL);
            }

            SByte typeName = (SByte)'R';

            mWriter.Write(typeName);

            if ((value == null) || (!value.HasValue))
            {
                mWriter.Write(false);
            }
            else
            {
                mWriter.Write(true);
                mWriter.Write(value.Value);
            }

            return(UpdateHeaderLength());
        }
Ejemplo n.º 38
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="authority"></param>
        /// <param name="parent"></param>
        /// <returns></returns>
        private string ConstructSidebar(List <AUTHORITY> authority, Int16?parent, Int16 level)
        {
            List <AUTHORITY> currentItems = authority.Where(a => a.FUNCTIONS.PARENT_SN == parent && (a.ROLES_SN != null || a.FUNCTIONS.CATEGORY == "S" || a.FUNCTIONS.CATEGORY == "D")).ToList();
            string           currentHtml = "", subHtml = "";

            if (currentItems.Count() > 0)
            {
                level += 2;
                foreach (var item in currentItems)
                {
                    subHtml = ConstructSidebar(authority, item.FUNCTIONS.SN, level);
                    if (item.FUNCTIONS.CATEGORY == "P")
                    {
                        currentHtml += "<li class='ml-" + (level - 1).ToString() + "'><a href='" + item.FUNCTIONS.URL + "'>" + item.FUNCTIONS.NAME + "</a></li>";
                    }
                    else if (subHtml.Length > 0)
                    {
                        currentHtml += "<li class='ml-" + level.ToString() + "'><a href='#id" + item.FUNCTIONS.SN + "' data-toggle='collapse' aria-expanded='false' class='dropdown-toggle'>" + item.FUNCTIONS.NAME + "</a><ul class='collapse list-unstyled' id='id" + item.FUNCTIONS.SN + "'>" + subHtml + "</ul></li>";
                    }
                }
            }
            return(currentHtml);
        }
Ejemplo n.º 39
0
 public Inode(DateTime?changeTime, Int64?number, Int16?majorDevice, Int16?minorDevice, Int16?cMajorDevice, Int16?cMinorDevice)
 {
     this.changeTime = changeTime;
     if ((number != null) && (majorDevice != null) && (minorDevice != null))
     {
         this.number      = number;
         this.majorDevice = majorDevice;
         this.minorDevice = minorDevice;
     }
     else if ((number != null) || (majorDevice != null) || (minorDevice != null))
     {
         throw new ArgumentException("Inode class must have either number, major-device and minor-device nodes together or neither of them at all.");
     }
     if ((cMajorDevice != null) && (cMinorDevice != null))
     {
         this.cMajorDevice = cMajorDevice;
         this.cMinorDevice = cMinorDevice;
     }
     else if ((cMajorDevice != null) || (cMinorDevice != null))
     {
         throw new ArgumentException("Inode class must have either c-major-device and c-minor-device nodes together or neither of them at all.");
     }
 }
Ejemplo n.º 40
0
        public void Nullable_Int16_should_be_serializable_deserialiazble()
        {
            Int16?value  = 5;
            var   stream = ProtoBufSerializer.Serialize(value);

            stream.Should().NotBeNull();
            ProtoBufSerializer.Deserialize <Int16?>(stream).Should().Be(value);

            value  = Int16.MaxValue;
            stream = ProtoBufSerializer.Serialize(value);
            stream.Should().NotBeNull();
            ProtoBufSerializer.Deserialize <Int16?>(stream).Should().Be(value);

            value  = Int16.MinValue;
            stream = ProtoBufSerializer.Serialize(value);
            stream.Should().NotBeNull();
            ProtoBufSerializer.Deserialize <Int16?>(stream).Should().Be(value);

            value  = null;
            stream = ProtoBufSerializer.Serialize(value);
            stream.Should().NotBeNull();
            ProtoBufSerializer.Deserialize <Int16?>(stream).Should().Be(value);
        }
Ejemplo n.º 41
0
 public TAPERTEK( Int16? _EnergiaTartalom1,
                 Int16? _EnergiaTartalom2,
                 double? _Feherje,
                 double? _Szenhidrat,
                 double? _Zsir,
                 double? _Elelmirost )
 {
     EnergiaTartalom1 = _EnergiaTartalom1;
     EnergiaTartalom2 = _EnergiaTartalom2;
     Feherje = _Feherje;
     Szenhidrat = _Szenhidrat;
     Zsir = _Zsir;
     Elelmirost = _Elelmirost;
 }
Ejemplo n.º 42
0
 public void update_v10(byte[] _uuid, UInt16 _major, UInt16 _minor, UInt16 _rpm, UInt16 _hr, UInt16 _power, UInt16 _interval, UInt16 _kcal, UInt16 _clock, UInt16 _trip, Int16 _rssi, UInt16 _gear)
 {
     uuid = _uuid;
     major = _major;
     minor = _minor;
     rpm = _rpm;
     hr = _hr;
     power = _power;
     interval = _interval;
     kcal = _kcal;
     clock = _clock;
     trip = _trip;
     rssi = _rssi;
     gear = _gear;
     updates++;
     elapsedAtLastUpdate = timeFromStart.Elapsed;
     timeFromUpdate.Reset();
     timeFromUpdate.Start();
 }
Ejemplo n.º 43
0
 public void update_v08(UInt16 _rpm, UInt16 _hr, UInt16 _power, UInt16? _kcal = null, UInt16? _clock = null, Int16? _rssi = null)
 {
     rpm = _rpm;
     hr = _hr;
     power = _power;
     kcal = _kcal;
     clock = _clock;
     rssi = _rssi;
     updates++;
     elapsedAtLastUpdate = timeFromStart.Elapsed;
     timeFromUpdate.Reset();
     timeFromUpdate.Start();
 }
Ejemplo n.º 44
0
        // static int? __ProgProy;
        // GET: proyecto
        public ActionResult Index(int? _id, int? _idContrato, Int32? _ano, Int16? _trimestre)
        {
            //var proyecto = db.proyecto.Include(p => p.progProy).Include(p => p.ruta).Include(p => p.tipoProyecto);
            programa programa = db.programa.Find(_id, _idContrato, _ano, _trimestre);
            var proyecto = db.proyecto.Include(pr => pr.progProy).Include(pr => pr.ruta).Include(pr => pr.tipoProyecto).Where(pr => pr.idProgProy == programa.idProgProy);
            ViewBag.idP = _id;
            ViewBag.idCont = _idContrato;
            ViewBag.ano = _ano;
            ViewBag.tri = _trimestre;
            ViewBag.idProgProy = programa.idProgProy;

            __id = _id;
            __idContrato = _idContrato;
            __ano = _ano;
            __trimestre = _trimestre;

            __idProgProy = programa.idProgProy;

            return View(proyecto.ToList());
        }
Ejemplo n.º 45
0
 public void Dispose()
 {
     this._reciever = null;
     this._sender = null;
     this._event = null;
 }
 internal LastSurvey( Int16? lastSurveyYear, float? ageAtLastSurvey )
 {
     _lastSurveyYear = lastSurveyYear;
     _ageAtLastSurvey = ageAtLastSurvey;
 }