Example #1
0
        private void lookUpEditCNLQ_Properties_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (e.Button.Kind == DevExpress.XtraEditors.Controls.ButtonPredefines.OK)
            {
                LookUpEdit lue = sender as LookUpEdit;
                if (lue.ItemIndex < 0)
                {
                    return;
                }
                if (gvDetail.SelectedRowsCount == 0)
                {
                    XtraMessageBox.Show("Vui lòng chọn một đối tượng trên danh sách để xem thông tin chi tiết!");
                    return;
                }
                string pkName  = _data.DrTable["Pk"].ToString();
                string pkValue = gvDetail.GetFocusedRowCellValue(pkName).ToString();
                if (pkValue == string.Empty)
                {
                    return;
                }
                DataTable dtTable = lue.Properties.DataSource as DataTable;
                DataRow   dr      = dtTable.Rows[lue.ItemIndex];

                CDTData data1 = DataFactory.DataFactory.Create(DataType.Single, dr);
                data1.Condition = pkName + " = '" + pkValue + "'";
                FrmSingle frm = new FrmSingle(data1);
                frm.ShowDialog();
            }
        }
Example #2
0
        public static CDTForm Create(FormType formType, DataRow drTable)
        {
            CDTForm tmp = null;
            CDTData data;

            switch (formType)
            {
            case FormType.Detail:
                data = DataFactory.DataFactory.Create(DataType.Detail, drTable);
                tmp  = new FrmDetail(data);
                break;

            case FormType.MasterDetail:
                DateTime t1 = DateTime.Now;
                data = DataFactory.DataFactory.Create(DataType.MasterDetail, drTable);
                // ErrorManager.LogFile.AppendToFile("log.txt", (DateTime.Now - t1).TotalMilliseconds.ToString());
                t1  = DateTime.Now;
                tmp = new FrmMasterDetail(data);
                // ErrorManager.LogFile.AppendToFile("log.txt", (DateTime.Now - t1).TotalMilliseconds.ToString());
                break;

            case FormType.Single:
                data = DataFactory.DataFactory.Create(DataType.Single, drTable);
                tmp  = new FrmSingle(data);
                break;
            }
            // if (tmp != null) tmp.Text += "    " + drTable["TableName"].ToString();
            return(tmp);
        }
Example #3
0
        public static CDTForm Create(FormType formType, string sysTableID)
        {
            CDTForm tmp  = null;
            CDTData data = null;

            switch (formType)
            {
            case FormType.Detail:
                data = DataFactory.DataFactory.Create(DataType.Detail, sysTableID);
                tmp  = new FrmDetail(data);

                break;

            case FormType.MasterDetail:
                data = DataFactory.DataFactory.Create(DataType.MasterDetail, sysTableID);
                tmp  = new FrmMasterDetail(data);

                break;

            case FormType.Single:
                data = DataFactory.DataFactory.Create(DataType.Single, sysTableID);
                tmp  = new FrmSingle(data);

                break;
            }
            //if (tmp != null) tmp.Text += "    " + data.DrTable["TableName"].ToString();
            return(tmp);
        }
Example #4
0
        public static CDTForm Create(FormType formType, string sysTableID)
        {
            CDTForm tmp = null;
            CDTData data;

            switch (formType)
            {
            case FormType.Detail:
                data = DataFactory.DataFactory.Create(DataType.Detail, sysTableID);
                tmp  = new FrmDetail(data);

                break;

            case FormType.MasterDetail:
                data = DataFactory.DataFactory.Create(DataType.MasterDetail, sysTableID);
                tmp  = new FrmMasterDetail(data);

                break;

            case FormType.Single:
                data = DataFactory.DataFactory.Create(DataType.Single, sysTableID);
                tmp  = new FrmSingle(data);

                break;
            }

            return(tmp);
        }
Example #5
0
        public static CDTForm Create(FormType formType, CDTData data)
        {
            CDTForm tmp = null;

            switch (formType)
            {
            case FormType.Detail:
                tmp = new FrmDetail(data);
                break;

            case FormType.MasterDetail:
                tmp = new FrmMasterDetail(data);
                break;

            case FormType.Single:
                tmp = new FrmSingle(data);
                break;
            }
            // if (tmp != null) tmp.Text += "    " + data.DrTable["TableName"].ToString();
            return(tmp);
        }
Example #6
0
        public static CDTForm Create(FormType formType, CDTData data)
        {
            CDTForm tmp = null;

            switch (formType)
            {
            case FormType.Detail:
                tmp = new FrmDetail(data);
                break;

            case FormType.MasterDetail:
                tmp = new FrmMasterDetail(data);
                break;

            case FormType.Single:
                tmp = new FrmSingle(data);
                break;
            }

            return(tmp);
        }