コード例 #1
0
ファイル: product.cs プロジェクト: no10pc/Light
        /// <summary>
        /// ����һ������
        /// </summary>
        public void Add(light.Model.product model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into product(");
            strSql.Append("pname,pcateid,plogo,pinfo,isopen,addtime,enpname,krpname,eninfo,krinfo )");
            strSql.Append(" values (");
            strSql.Append("@pname,@pcateid,@plogo,@pinfo,@isopen,@addtime,@enpname,@krpname,@eninfo,@krinfo)");
            OleDbParameter[] parameters = {
                    new OleDbParameter("@pname", OleDbType.VarChar,255),
                    new OleDbParameter("@pcateid", OleDbType.Integer,4),
                    new OleDbParameter("@plogo", OleDbType.VarChar,255),
                    new OleDbParameter("@pinfo", OleDbType.VarChar,0),
                    new OleDbParameter("@isopen", OleDbType.Integer,4),
                    new OleDbParameter("@addtime", OleDbType.Date),
                    new OleDbParameter("@enpname", OleDbType.VarChar,255),
                    new OleDbParameter("@krpname", OleDbType.VarChar,255),
                    new OleDbParameter("@eninfo", OleDbType.VarChar,0),
                    new OleDbParameter("@krinfo", OleDbType.VarChar,0)
                                          };
            parameters[0].Value = model.pname;
            parameters[1].Value = model.pcateid;
            parameters[2].Value = model.plogo;
            parameters[3].Value = model.pinfo;
            parameters[4].Value = model.isopen;
            parameters[5].Value = model.addtime;
            parameters[6].Value = model.enpname;
            parameters[7].Value = model.krpname;
            parameters[8].Value = model.eninfo;
            parameters[9].Value = model.krinfo;

            DbHelperOleDb.ExecuteSql(strSql.ToString(), parameters);
        }
コード例 #2
0
ファイル: leftmenu.cs プロジェクト: no10pc/Light
        /// <summary>
        /// ����һ������
        /// </summary>
        public void Add(light.Model.leftmenu model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into leftmenu(");
            strSql.Append("cname,ename,parentid,isopen,addtime)");
            strSql.Append(" values (");
            strSql.Append("@cname,@ename,@parentid,@isopen,@addtime)");
            OleDbParameter[] parameters = {
                    new OleDbParameter("@cname", OleDbType.VarChar,255),
                    new OleDbParameter("@ename", OleDbType.VarChar,0),
                    new OleDbParameter("@parentid", OleDbType.Integer,4),
                    new OleDbParameter("@isopen", OleDbType.Integer,4),
                    new OleDbParameter("@addtime", OleDbType.Date),
                    new OleDbParameter("@c_description", OleDbType.VarChar,0),
                    new OleDbParameter("@k_description", OleDbType.VarChar,0),
                    new OleDbParameter("@e_description", OleDbType.VarChar,0)};
            parameters[0].Value = model.cnname;
            parameters[1].Value = model.enname;
            parameters[2].Value = model.parentid;
            parameters[3].Value = model.isopen;
            parameters[4].Value = model.addtime;
            parameters[5].Value = model.c_description;
            parameters[6].Value = model.k_description;
            parameters[7].Value = model.e_description;

            DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters);
        }
コード例 #3
0
ファイル: menu.cs プロジェクト: no10pc/Light
        /// <summary>
        /// ����һ������
        /// </summary>
        public void Add(light.Model.menu model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into menu(");
            strSql.Append("description,categoryid,addtime)");
            strSql.Append(" values (");
            strSql.Append("@description,@categoryid,@addtime)");
            OleDbParameter[] parameters = {
                    new OleDbParameter("@description", OleDbType.VarChar,0),
                    new OleDbParameter("@categoryid", OleDbType.Integer,4),
                    new OleDbParameter("@addtime", OleDbType.Date)};
            parameters[0].Value = model.description;
            parameters[1].Value = model.categoryid;
            parameters[2].Value = model.addtime;

            DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters);
        }
コード例 #4
0
ファイル: newscategory.cs プロジェクト: no10pc/Light
        /// <summary>
        /// ����һ������
        /// </summary>
        public void Add(light.Model.newscategory model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into newscategory(");
            strSql.Append("pkid,cname,ename,parentid,isopen,addtime)");
            strSql.Append(" values (");
            strSql.Append("@pkid,@cname,@ename,@parentid,@isopen,@addtime)");
            OleDbParameter[] parameters = {
                    new OleDbParameter("@pkid", OleDbType.Integer,4),
                    new OleDbParameter("@cname", OleDbType.VarChar,255),
                    new OleDbParameter("@ename", OleDbType.VarChar,255),
                    new OleDbParameter("@parentid", OleDbType.Integer,4),
                    new OleDbParameter("@isopen", OleDbType.Integer,4),
                    new OleDbParameter("@addtime", OleDbType.Date)};
            parameters[0].Value = model.pkid;
            parameters[1].Value = model.cname;
            parameters[2].Value = model.ename;
            parameters[3].Value = model.parentid;
            parameters[4].Value = model.isopen;
            parameters[5].Value = model.addtime;

            DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters);
        }
コード例 #5
0
ファイル: news.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Add(light.Model.news model)
 {
     dal.Add(model);
 }
コード例 #6
0
ファイル: DAELibraryLights.cs プロジェクト: Marc56K/Collada14
        private IDAESceneNode CreateLightNode(DAELoaderNode loader, light l)
        {
            IDAESceneNode result = null;

            if (l.technique_common.Item is lightTechnique_commonAmbient)
            {
                var ambLight = l.technique_common.Item as lightTechnique_commonAmbient;

                if (ambLight.color != null)
                {
                    result = loader.Context.CreateAmbientLightNode(l.name, GetColor(ambLight.color));
                }
            }
            else if (l.technique_common.Item is lightTechnique_commonDirectional)
            {
                var dirLight = l.technique_common.Item as lightTechnique_commonDirectional;

                if (dirLight.color != null)
                {
                    result = loader.Context.CreateDirectionalLightNode(l.name, GetColor(dirLight.color));
                }
            }
            else if (l.technique_common.Item is lightTechnique_commonPoint)
            {
                var pointLight = l.technique_common.Item as lightTechnique_commonPoint;

                DAEVector4 color;
                if (pointLight.color != null)
                {
                    color = GetColor(pointLight.color);
                }
                else
                {
                    color = new DAEVector4(1, 1, 1, 1);
                }

                double constantAttenuation = 1;
                if (pointLight.constant_attenuation != null)
                {
                    constantAttenuation = pointLight.constant_attenuation.Value;
                }

                double linearAttenuation = 0;
                if (pointLight.linear_attenuation != null)
                {
                    linearAttenuation = pointLight.linear_attenuation.Value;
                }

                double quadraticAttenuation = 0;
                if (pointLight.quadratic_attenuation != null)
                {
                    quadraticAttenuation = pointLight.quadratic_attenuation.Value;
                }

                result = loader.Context.CreatePointLightNode(l.name, color, constantAttenuation, linearAttenuation, quadraticAttenuation);
            }
            else if (l.technique_common.Item is lightTechnique_commonSpot)
            {
                var spotLight = l.technique_common.Item as lightTechnique_commonSpot;

                DAEVector4 color;
                if (spotLight.color != null)
                {
                    color = GetColor(spotLight.color);
                }
                else
                {
                    color = new DAEVector4(1, 1, 1, 1);
                }

                double constantAttenuation = 1;
                if (spotLight.constant_attenuation != null)
                {
                    constantAttenuation = spotLight.constant_attenuation.Value;
                }

                double linearAttenuation = 0;
                if (spotLight.linear_attenuation != null)
                {
                    linearAttenuation = spotLight.linear_attenuation.Value;
                }

                double quadraticAttenuation = 0;
                if (spotLight.quadratic_attenuation != null)
                {
                    quadraticAttenuation = spotLight.quadratic_attenuation.Value;
                }

                double spotExponent = 0;
                if (spotLight.falloff_exponent != null)
                {
                    spotExponent = spotLight.falloff_exponent.Value;
                }

                double spotCutOff = System.Math.PI; // default is 180°
                if (spotLight.falloff_angle != null)
                {
                    spotCutOff = spotLight.falloff_angle.Value / 2;
                }
                else if (l.extra != null && l.extra.Length > 0)
                {
                    foreach (var extra in l.extra)
                    {
                        if (extra.technique != null && extra.technique.Length > 0)
                        {
                            foreach (var extraTech in extra.technique)
                            {
                                if (extraTech.Any != null && extraTech.Any.Length > 0)
                                {
                                    foreach (var ele in extraTech.Any)
                                    {
                                        if (ele.ChildNodes != null)
                                        {
                                            for (int i = 0; i < ele.ChildNodes.Count; i++)
                                            {
                                                var n = ele.ChildNodes[i];
                                                if (n.Name == "falloff")
                                                {
                                                    float angle = 0;
                                                    if (float.TryParse(n.InnerText, NumberStyles.Any, CultureInfo.InvariantCulture, out angle))
                                                    {
                                                        spotCutOff = ((double)angle * System.Math.PI / 180) / 2;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                result = loader.Context.CreateSpotLightNode(l.name, color, constantAttenuation, linearAttenuation, quadraticAttenuation, spotExponent, spotCutOff);
            }

            return(result);
        }
コード例 #7
0
ファイル: menu.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(light.Model.menu model)
 {
     StringBuilder strSql=new StringBuilder();
     strSql.Append("update menu set ");
     strSql.Append("description=@description,");
     strSql.Append("categoryid=@categoryid,");
     strSql.Append("addtime=@addtime");
     strSql.Append(" where id=@id ");
     OleDbParameter[] parameters = {
             new OleDbParameter("@description", OleDbType.VarChar,0),
             new OleDbParameter("@categoryid", OleDbType.Integer,4),
             new OleDbParameter("@addtime", OleDbType.Date),
             new OleDbParameter("@id", OleDbType.Integer,4)
                                   };
     parameters[0].Value = model.description;
     parameters[1].Value = model.categoryid;
     parameters[2].Value = model.addtime;
     parameters[3].Value = model.id;
     DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters);
 }
コード例 #8
0
ファイル: newscategory.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Add(light.Model.newscategory model)
 {
     dal.Add(model);
 }
コード例 #9
0
ファイル: colli.cs プロジェクト: soimar/uni
	void SetLightPtr( light li)
	{
		lightBox = li;
	}
コード例 #10
0
ファイル: product.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Add(light.Model.product model)
 {
     dal.Add(model);
 }
コード例 #11
0
ファイル: newscategory.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(light.Model.newscategory model)
 {
     dal.Update(model);
 }
コード例 #12
0
ファイル: product.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(light.Model.product model)
 {
     dal.Update(model);
 }
コード例 #13
0
ファイル: leftmenu.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(light.Model.leftmenu model)
 {
     StringBuilder strSql=new StringBuilder();
     strSql.Append("update leftmenu set ");
     strSql.Append("cname=@cname,");
     strSql.Append("ename=@ename,");
     strSql.Append("parentid=@parentid,");
     strSql.Append("isopen=@isopen,");
     strSql.Append("addtime=@addtime,");
     strSql.Append("c_description=@c_description,");
     strSql.Append("k_description=@k_description,");
     strSql.Append("e_description=@e_description");
     strSql.Append(" where pkid=@pkid ");
     OleDbParameter[] parameters = {
             new OleDbParameter("@cname", OleDbType.VarChar,255),
             new OleDbParameter("@ename", OleDbType.VarChar,0),
             new OleDbParameter("@parentid", OleDbType.Integer,4),
             new OleDbParameter("@isopen", OleDbType.Integer,4),
             new OleDbParameter("@addtime", OleDbType.Date),
             new OleDbParameter("@c_description", OleDbType.VarChar,0),
             new OleDbParameter("@k_description", OleDbType.VarChar,0),
             new OleDbParameter("@e_description", OleDbType.VarChar,0),
             new OleDbParameter("@pkid", OleDbType.Integer,4)};
     parameters[0].Value = model.cnname;
     parameters[1].Value = model.enname;
     parameters[2].Value = model.parentid;
     parameters[3].Value = model.isopen;
     parameters[4].Value = model.addtime;
     parameters[5].Value = model.c_description;
     parameters[6].Value = model.k_description;
     parameters[7].Value = model.e_description;
     parameters[8].Value = model.pkid;
     DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters);
 }
コード例 #14
0
ファイル: newscategory.cs プロジェクト: no10pc/Light
        /// <summary>
        /// ����һ������
        /// </summary>
        public void Update(light.Model.newscategory model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("update newscategory set ");
            strSql.Append("pkid=@pkid,");
            strSql.Append("cname=@cname,");
            strSql.Append("ename=@ename,");
            strSql.Append("parentid=@parentid,");
            strSql.Append("isopen=@isopen,");
            strSql.Append("addtime=@addtime");
            strSql.Append(" where pkid=@pkid ");
            OleDbParameter[] parameters = {
                    new OleDbParameter("@pkid", OleDbType.Integer,4),
                    new OleDbParameter("@cname", OleDbType.VarChar,255),
                    new OleDbParameter("@ename", OleDbType.VarChar,255),
                    new OleDbParameter("@parentid", OleDbType.Integer,4),
                    new OleDbParameter("@isopen", OleDbType.Integer,4),
                    new OleDbParameter("@addtime", OleDbType.Date)};
            parameters[0].Value = model.pkid;
            parameters[1].Value = model.cname;
            parameters[2].Value = model.ename;
            parameters[3].Value = model.parentid;
            parameters[4].Value = model.isopen;
            parameters[5].Value = model.addtime;

            DbHelperOleDb.ExecuteSql(strSql.ToString(),parameters);
        }
コード例 #15
0
ファイル: leftmenu.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Add(light.Model.leftmenu model)
 {
     dal.Add(model);
 }
コード例 #16
0
ファイル: leftmenu.cs プロジェクト: no10pc/Light
 /// <summary>
 /// ����һ������
 /// </summary>
 public void Update(light.Model.leftmenu model)
 {
     dal.Update(model);
 }
コード例 #17
0
ファイル: backtools.cs プロジェクト: no10pc/Light
 public void UpdatePsw(light.Model.backtools model)
 {
     dal.UpdatePsw(model);
 }
コード例 #18
0
ファイル: product.cs プロジェクト: no10pc/Light
        /// <summary>
        /// ����һ������
        /// </summary>
        public void Update(light.Model.product model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update product set ");
            strSql.Append("pname=@pname,");
            strSql.Append("pcateid=@pcateid,");
            strSql.Append("plogo=@plogo,");
            strSql.Append("pinfo=@pinfo,");
            strSql.Append("isopen=@isopen,");
            strSql.Append("addtime=@addtime,");
            strSql.Append("enpname=@enpname,");
            strSql.Append("krpname=@krpname,");
            strSql.Append("eninfo=@eninfo,");
            strSql.Append("krinfo=@krinfo");

            strSql.Append(" where pkid=@pkid ");
            OleDbParameter[] parameters = {
                    new OleDbParameter("@pname", OleDbType.VarChar,255),
                    new OleDbParameter("@pcateid", OleDbType.Integer,4),
                    new OleDbParameter("@plogo", OleDbType.VarChar,255),
                    new OleDbParameter("@pinfo", OleDbType.VarChar,0),
                    new OleDbParameter("@isopen", OleDbType.Integer,4),
                    new OleDbParameter("@addtime", OleDbType.Date),
                    new OleDbParameter("@enpname", OleDbType.VarChar,255),
                    new OleDbParameter("@krpname", OleDbType.VarChar,255),
                    new OleDbParameter("@eninfo", OleDbType.VarChar,0),
                    new OleDbParameter("@krinfo", OleDbType.VarChar,0),
                    new OleDbParameter("@pkid", OleDbType.Integer,4)

                                          };
            parameters[0].Value = model.pname;
            parameters[1].Value = model.pcateid;
            parameters[2].Value = model.plogo;
            parameters[3].Value = model.pinfo;
            parameters[4].Value = model.isopen;
            parameters[5].Value = model.addtime;
            parameters[6].Value = model.enpname;
            parameters[7].Value = model.krpname;
            parameters[8].Value = model.eninfo;
            parameters[9].Value = model.krinfo;
            parameters[10].Value = model.pkid;
            DbHelperOleDb.ExecuteSql(strSql.ToString(), parameters);
        }