Print/Dal/Line.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using Common;

namespace Print.Dal
{
    /// <summary>
    /// 直线
    /// </summary>
    /// <remarks></remarks>
    internal class Line
    {
        private string str;
        /// <summary>
        /// 创建实例
        /// </summary>
        /// <returns></returns>
        /// <remarks></remarks>
        public static Line Create()
        {
            return new Line();
        }

        public void Delete(int Id, System.Data.Common.DbCommand cmd)
        {
            str = "delete from __PrintTemplateLine where Id=" + Id;
            DataBase.execCmd(str, cmd);
        }

        public void Insert(Model.LineInfo mdl, System.Data.Common.DbCommand cmd)
        {
            str = "insert into __PrintTemplateLine(TemplateId,x1,y1,x2,y2)values(" + mdl.Nuke().A02_TemplateId + "," + mdl.Nuke().A03_x1 + "," + mdl.Nuke().A04_y1 + "," + mdl.Nuke().A05_x2 + "," + mdl.Nuke().A06_y2 + ")";
            DataBase.execCmd(str, cmd);
        }

        public void OnUpdate(Model.LineInfo mdl, System.Data.Common.DbCommand cmd)
        {
            str = "Update __PrintTemplateLine set TemplateId=" + mdl.Nuke().A02_TemplateId + ",x1=" + mdl.Nuke().A03_x1 + ",y1=" + mdl.Nuke().A04_y1 + ",x2=" + mdl.Nuke().A05_x2 + ",y2=" + mdl.Nuke().A06_y2 + " where Id=" + mdl.Nuke().A01_Id;
            DataBase.execCmd(str, cmd);
        }

        public Model.LineInfoCollection Query(System.Data.Common.DbCommand cmd)
        {
            return myQuery("", cmd);
        }

        public Model.LineInfoCollection Query(int TemplateId, System.Data.Common.DbCommand cmd)
        {
            string Filter = "TemplateId=" + TemplateId;
            return myQuery(Filter, cmd);
        }

        private Model.LineInfoCollection myQuery(string Filter, System.Data.Common.DbCommand cmd)
        {
            str = "select Id,TemplateId,x1,y1,x2,y2 from __PrintTemplateLine";
            if (Filter != "")
            {
                str += " where " + Filter;
            }
            str += " order by Id";
后面还有 17 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。