示例#1
0
        public void TestCreateType()
        {
            var expected = "type";
            var ddType   = new DDType(expected);

            Assert.IsTrue(ddType == expected, "The type is incorrect.");
        }
示例#2
0
 private void LoadType()
 {
     try
     {
         List <CompType> result = new List <CompType> {
             new CompType {
                 id = 0, name = ""
             }
         };
         DDType.DataTextField  = "name";
         DDType.DataValueField = "id";
         DDType.DataSource     = result;
         using (InhToDoListDataContext context = new InhToDoListDataContext())
         {
             result.AddRange(context.mst_types
                             .Where(x => x.mst_status == 'A')
                             .Select(x => new CompType
             {
                 id   = x.mst_id,
                 name = x.mst_tname
             }).ToList());
         }
         DDType.DataBind();
     }
     catch (Exception ex)
     {
     }
     //var objmstid = (from tid in dbc.mst_types select new { id = tid.mst_id, name = tid.mst_tname }).ToList();
     //DDType.DataTextField = "name";
     //DDType.DataValueField = "id";
     //DDType.DataSource = objmstid;
     //DDType.DataBind();
     //DDType.Items.Insert(0, String.Empty);
     //DDType.SelectedIndex = 0;
 }
示例#3
0
        public void TestTypeEqualByObject()
        {
            var expected = "type";
            var ddType1  = new DDType(expected);

            Assert.AreEqual(ddType1, (object)ddType1, "Objects should be equals.");
        }
示例#4
0
        public void TestTypeNotEqualByObject()
        {
            var expected = "type";
            var ddType1  = new DDType(expected);
            var ddType2  = new DDType(expected);

            Assert.AreEqual(ddType1, ddType2, "Objects have to be equal.");
        }
示例#5
0
        public void TestTypeImplicitConvertToString()
        {
            var expected = "tYpE";
            var ddType   = new DDType(expected);

            Assert.IsTrue(ddType == (DDType)expected, "Implicit convertion from string is incorrect.");
            Assert.IsTrue(expected == (string)ddType, "Implicit convertion to string is incorrect.");
        }
示例#6
0
        public void TestTypeNotEqual()
        {
            var expected = "tYpE";
            var ddType1  = new DDType(expected);
            var ddType2  = new DDType(expected);

            Assert.IsFalse(ddType1.Equals(ddType2), "Objects cannot be equals.");
            Assert.IsFalse(ddType2.Equals(ddType1), "Objects cannot be equals.");
        }
示例#7
0
        /// <summary>
        /// returns configuration provider node with common attributes: 'AttLevel=All', 'AttExceptionLevel=All'
        /// </summary>
        /// <returns></returns>
        public static DDNode GetCommonConfig(DDType type)
        {
            var n = new DDNode(type);

            n.Attributes.Add(SchemaProvider.AttLevel, DefaultLevel.ToString());
            n.Attributes.Add(SchemaProvider.AttExceptionLevel, DefaultExceptionLevel.ToString());
            n.Attributes.Add(SchemaProvider.AttEnabled, DefaultEnabled);
            return(n);
        }
示例#8
0
        public void TestTypeEqual()
        {
            var expected = "tYpE";
            var ddType1  = new DDType(expected);
            var ddType2  = ddType1;

            Assert.IsTrue(ddType1.Equals(ddType2), "Objects must be equals.");
            Assert.IsTrue(ddType2.Equals(ddType1), "Objects must be equals.");
        }
示例#9
0
        public void TestTypeValueEqual()
        {
            var expected = "tYpE";
            var ddType1  = new DDType(expected);
            var ddType2  = new DDType(expected);

            Assert.AreEqual(ddType1, ddType2);
            Assert.IsTrue(ddType2.Equals(ddType2), "Objects have to equal.");
            Assert.IsTrue(ddType2.Equals(ddType1), "Objects have to equal.");
        }
示例#10
0
 private static void AssertIncorrectNodeType(DDType type, DDType[] dDTypes)
 {
     foreach (var t in dDTypes)
     {
         if (t.Equals(t))
         {
             return;
         }
     }
     Assert.Fail("The node type '{0}' is not matched here.", type);
 }
示例#11
0
        public void TestDDNodeExTraverseSkipWithChild()
        {
            var r     = getStockNode();
            var names = new string[] { "child1", "child2", "child3", "child32" };
            var types = new DDType[] { "child31Type", "child313Type" };
            int i     = 0;

            foreach (var n in r.Traverse(false, true, false, types))
            {
                Assert.AreEqual(n.Name, names[i++]);
                AssertIncorrectNodeType(n.Type, types);
            }
            Assert.AreEqual(names.Length, i, "Count of returned nodes should be equal count of expected nodes.");
        }
        protected void llenarDrop()
        {
            DataTable datos = ApplicationClass.GetApplicationType();

            datos.DefaultView.Sort = "Apl_Tip_Descripcion";
            DDType.DataSource      = datos;
            DDType.DataTextField   = "Apl_Tip_Descripcion";
            DDType.DataValueField  = "Apl_Tip_Id";
            DDType.DataBind();

            DDType2.DataSource     = datos;
            DDType2.DataTextField  = "Apl_Tip_Descripcion";
            DDType2.DataValueField = "Apl_Tip_Id";
            DDType2.DataBind();
        }
示例#13
0
        public void TestDDTypeEqualIsValuable()
        {
            var d  = new System.Collections.Generic.Dictionary <DDType, DDType>();
            var t0 = new DDType("");
            var t1 = new DDType("t1");
            var t2 = new DDType("t2");
            var t3 = new DDType("T2");

            d.Add(t0, t0);
            d.Add(t1, t1);
            d.Add(t2, t2);
            d.Add("T3", "T3");

            Assert.AreEqual(d[t0], t0);
            Assert.AreEqual(d[t1], t1);
            Assert.AreEqual(d[t2], t2);
            Assert.AreEqual(d["T3"], new DDType("T3"));
        }
示例#14
0
文件: DD.cs 项目: sundowndk/SNDK
 internal DD()
 {
     this._degrees = 0;
     this._ddtype = DDType.Latitude;
 }
示例#15
0
文件: DD.cs 项目: sundowndk/SNDK
 public DD(decimal Degrees, DDType DDType)
 {
     this._degrees = Degrees;
     this._ddtype = DDType;
 }
示例#16
0
 public CDDtype()
 {
     DDType = DDType.None;
 }
示例#17
0
 public CDDtype()
 {
     DDType = _Default.DDType.None;
 }
示例#18
0
 /// <summary>
 /// verifies type of node. If have not equals DrTestActionType will throw '<typeparamref name="ValidateExpectedNodeType"/>'
 /// </summary>
 /// <param name="t">type of node for verification</param>
 /// <exception cref="ValidateExpectedNodeType"/>
 public static void IsThisNodeTypeActionOtherwiseThrow(this DDType t)
 {
     t.ValidateExpectedNodeType(SchemaDrTestAction.TYPE_ACTION);
 }
示例#19
0
文件: DD.cs 项目: mister-scruff/SNDK
 public DD(decimal Degrees, DDType DDType)
 {
     this._degrees = Degrees;
     this._ddtype  = DDType;
 }
示例#20
0
    protected void DDFill()
    {
        DataTable     dt1, dt2, dt3, dt4;
        SqlConnection con = new SqlConnection("DATA SOURCE=GOVINDSUPERCOMP;INITIAL CATALOG=Tutor;Integrated Security=True;");
        SqlCommand    com = new SqlCommand();

        try
        {
            con.Open();
            string sqlStatement;
            sqlStatement = "SELECT DISTINCT [typename] FROM [typeofTutor]";
            SqlCommand     sqlCmd = new SqlCommand(sqlStatement, con);
            SqlDataAdapter sqlDa  = new SqlDataAdapter(sqlCmd);
            dt1 = new DataTable();
            sqlDa.Fill(dt1);
            if (dt1.Rows.Count > 0)
            {
                DDType.DataSource = dt1;
                DDType.DataBind();
            }

            sqlStatement = "SELECT DISTINCT [subname] FROM [subject]";
            sqlCmd       = new SqlCommand(sqlStatement, con);
            sqlDa        = new SqlDataAdapter(sqlCmd);
            dt3          = new DataTable();
            sqlDa.Fill(dt3);
            if (dt3.Rows.Count > 0)
            {
                DDsub.DataSource = dt3;
                DDsub.DataBind();
            }

            sqlStatement = "SELECT DISTINCT [stdname] FROM [standard]";
            sqlCmd       = new SqlCommand(sqlStatement, con);
            sqlDa        = new SqlDataAdapter(sqlCmd);
            dt2          = new DataTable();
            sqlDa.Fill(dt2);
            if (dt2.Rows.Count > 0)
            {
                DDstd.DataSource = dt2;
                DDstd.DataBind();
            }
            sqlStatement = "SELECT DISTINCT [locname] FROM [location]";
            sqlCmd       = new SqlCommand(sqlStatement, con);
            dt4          = new DataTable();
            sqlDa        = new SqlDataAdapter(sqlCmd);
            sqlDa.Fill(dt4);
            if (dt4.Rows.Count > 0)
            {
                DDLoc.DataSource = dt4;
                DDLoc.DataBind();
            }
        }
        catch (System.Data.SqlClient.SqlException ex)
        {
            string msg = "No Data Found To display in the DropDown List";
            msg += ex.Message;
            throw new Exception(msg);
        }
        finally
        {
            con.Close();
        }
    }
示例#21
0
文件: DD.cs 项目: mister-scruff/SNDK
 internal DD()
 {
     this._degrees = 0;
     this._ddtype  = DDType.Latitude;
 }