Exemple #1
0
 public static void AddCDTData(DataSingle c)
 {
     if (!lCDTData.Exists(data => data._tableName == c._tableName && data.Condition == c.Condition && c.DynCondition == data.DynCondition))
     {
         lCDTData.Add(c);
     }
 }
        public static CDTData Create(DataType type, string TableName, string sysPackageID)
        {
            CDTData tmp = null;

            switch (type)
            {
            case DataType.Detail:
                tmp = new DataDetail(TableName, sysPackageID);
                break;

            case DataType.MasterDetail:
                tmp = new DataMasterDetail(TableName, sysPackageID);
                break;

            case DataType.Single:
                tmp = new DataSingle(TableName, sysPackageID);
                break;
            }
            return(tmp);
        }
Exemple #3
0
        private void fPOSKM_Load(object sender, EventArgs e)
        {
            string sql = "select * from dmPosArea where apdung=1";

            dbPOSArea = new DataSingle("dmPosArea", "7");
            if (dbPOSArea == null)
            {
                return;
            }
            dbPOSArea.GetData();
            dmposArea                       = dbPOSArea.DsData.Tables[0];
            dmposArea.PrimaryKey            = new DataColumn[] { dmposArea.Columns["MaPOSArea"] };
            grPOSArea.Properties.DataSource = dmposArea;
            sql                       = "select * from dmloaimon";
            dmLoaimon                 = db.GetDataTable(sql);
            bsLoaimon.DataSource      = dmLoaimon;
            bsLoaimon.CurrentChanged += BsLoaimon_CurrentChanged;
            tlLoaiMon.DataSource      = bsLoaimon;
            tlLoaiMon.KeyFieldName    = "MaLoaiMon";
            tlLoaiMon.ParentFieldName = "MaLoaiMonMe";
        }
        public static CDTData Create(DataType type, DataRow drTable)
        {
            CDTData tmp = null;

            switch (type)
            {
            case DataType.Detail:
                tmp = new DataDetail(drTable);
                break;

            case DataType.MasterDetail:
                tmp = new DataMasterDetail(drTable);
                break;

            case DataType.Single:
                tmp = new DataSingle(drTable);
                break;

            case DataType.Report:
                tmp = new DataReport(drTable);
                break;
            }
            return(tmp);
        }