示例#1
0
文件: xml.cs 项目: dstrucl/Tangenta40
 public ColumnXml(ColumnXml sourceColumnXml)
 {
     m_col = sourceColumnXml.m_col;
     Name = sourceColumnXml.Name;
     SqlFilter = sourceColumnXml.SqlFilter;
     bUseSqlFilter = sourceColumnXml.bUseSqlFilter;
 }
示例#2
0
        //this constructor is used only for DBm_Image and DBm_Document table trees
        public Column(Column c,SQLTable DBm_owner_Table,List<SQLTable> lTable)
        {
            obj = SetObject(c.obj);
            nulltype = c.nulltype;
            Style = c.Style;
            flags = c.flags;
            IsIdentity = c.IsIdentity;
            ownerTable = c.ownerTable;
            Name = c.Name;
            //            Value = c.Value;

            //SetType = c.SetType;
            if (c.fKey != null)
            {
                fKey = new ForeignKey(c.fKey, DBm_owner_Table, lTable);
            }
            Name_in_language = c.Name_in_language;
            //Name_in_language = new ltext();
            //int iCount = c.Name_in_language.sText.Length;

            //for (int i = 0; i < iCount;i++)
            //{
            //    Name_in_language.sText(i) = c.Name_in_language.sText(i);
            //}
        }
示例#3
0
 public EditControl(TabPage pParentTabPage, Column col, List<EditControl> edtCtrlList)
 {
     lbl = new Label();
     txtBox = new TextBox();
     col.Name_in_language.Text(lbl);
     lbl.AutoSize = false;
     lbl.Parent = pParentTabPage;
     lbl.Visible = true;
     SetPositionAndSize(edtCtrlList);
     edtCtrlList.Add(this);
 }
 public Join_for_SQLView_InDataBase(SQLTable xtbl,string xTableName,string xTableName_Abbreviation, string xAliasTableName, string xParam_ID1, string xParam_ID2, Column.nullTYPE xnulltype)
 {
     tbl = xtbl;
     nulltype = xnulltype;
     TableName = xTableName;
     TableName_Abbreviation = xTableName_Abbreviation;
     AliasTableName = xAliasTableName;
     Param_ID1 = xParam_ID1;
     Param_ID2 = xParam_ID2;
     pSubJoin = null;
 }
        //public DefineView_InputControl()
        //{
        //    Font = new Font("Arial", 10);
        //    FillDegree = 10;
        //    RoundedCornerAngle = 10;
        //    Margin = new Padding(0);
        //    LeftText = "LT";
        //    StatusText = "Not set";
        //    MainText = "Hec";
        //    RightText = "RT";
        //    LeftBarSize = 5;
        //    StatusBarSize = 5;
        //    RightBarSize = 5;
        //    StatusBarColor = 99;
        //    AllowDrag = true;
        //}
        public DefineView_InputControl(Column col, List<DefineView_InputControl> inpCtrlList, string sImportExportLine, bool bNumber,ref int iCtrl)
        {
            Font = new Font("Arial", 10);
            FillDegree = 10;
            RoundedCornerAngle = 10;
            Margin = new Padding(0);
            LeftText = iCtrl.ToString();
            m_col = col;
            StatusText = "Not set";
            Name = col.Name;
            FullName = sImportExportLine;
            MainText = col.Name_in_language.s;

            ColTitleLong = this.MainText + " (" + m_col.Name + ")";
            RightText = iCtrl.ToString();
            LeftBarSize = 30;
            StatusBarSize = 5;
            RightBarSize = 30;
            StatusBarColor = 99;
            AllowDrag = true;
            iCtrl++;
        }
 void myGroupBox_Unique_parameter_exist(SQLTable tbl, Column col, DataTable dt,object value, ref bool bHandled)
 {
     if (pParentTable != null)
     {
         if (pParentTable.myGroupBox!=null)
         {
             pParentTable.myGroupBox.Unique_parameter_exist_Dialog_EventTrigger(tbl, col, dt, value,ref bHandled);
         }
     }
 }
        public void CreateInputControls(SQLTable pPrevTable,
                                        Column fcol, 
                                        string sParentKeys, 
                                        ref List<usrc_InputControl> 
                                        inpCtrlList, 
                                        Object pParentWindow, 
                                        Control pControl,
                                        DBTableControl xDBTables,
                                        bool bReadOnly,
                                        NavigationButtons.Navigation xnav)
        {
            int iCol = 0;
            int iCount = Column.Count();
            this.pParentTable = pPrevTable;
            this.myGroupBox = new usrc_myGroupBox();
            this.myGroupBox.SelectionButtonVisible = m_SelectionButtonVisible;
            this.myGroupBox.Init(this, fcol, sParentKeys, pParentWindow, pControl, xDBTables, bReadOnly,xnav);

            if (pParentWindow.GetType() == typeof(myPanel))
            {
                this.myGroupBox.Left = 5;
                this.myGroupBox.Top = 5;
                Panel pnl = (Panel)pParentWindow;
                pnl.Controls.Add(myGroupBox);
            }
            else if (pParentWindow.GetType() == typeof(usrc_myGroupBox))
            {
                usrc_myGroupBox pParentMyGroupBox = (usrc_myGroupBox)pParentWindow;
                MyControl mctrl = new MyControl(this.myGroupBox);
                pParentMyGroupBox.controls.Add(mctrl);
            }

            for (iCol = 0; iCol < iCount; iCol++)
            {
                Column col = Column[iCol];
                if (!col.IsIdentity)
                {
                    if (col.fKey != null)
                    {
                        string sKey;
                        bool xbReadOnly = bReadOnly;

                        if (col.Style == CodeTables.Column.eStyle.ReadOnlyTable)
                        {
                            xbReadOnly = true;
                        }

                        sKey = sParentKeys + "*" + col.fKey.refInListOfTables.TableName + ">";
                        col.fKey.fTable.CreateInputControls(this, col, sKey, ref inpCtrlList, this.myGroupBox, pControl, xDBTables, xbReadOnly,xnav);
                    }
                    else
                    {
                        string sImportExportLine;
                        usrc_InputControl inpCtrl;
                        if (col.IsNumber())
                        {
                            sImportExportLine = sParentKeys + col.Name + ",";
                            inpCtrl = new usrc_InputControl();
                            inpCtrl.Init(this, col, inpCtrlList, sImportExportLine, true,bReadOnly);
                            if (!bReadOnly)
                            {
                                inpCtrl.ObjectChanged += new usrc_InputControl.delegate_ObjectChanged(inpCtrl_ObjectChanged);
                            }
                            col.InputControl = inpCtrl;
                        }
                        else
                        {
                            sImportExportLine = sParentKeys + col.Name + ",";
                            inpCtrl = new usrc_InputControl();
                            inpCtrl.Init(this, col, inpCtrlList, sImportExportLine, false,bReadOnly);
                            if (!bReadOnly)
                            {
                                inpCtrl.ObjectChanged += new usrc_InputControl.delegate_ObjectChanged(inpCtrl_ObjectChanged);
                            }
                            col.InputControl = inpCtrl;
                        }
                        MyControl mctrl = new MyControl(inpCtrl);
                        this.myGroupBox.controls.Add(mctrl);
                    }
                }
            }

            if (pPrevTable!=null)
            {
                if (pParentWindow is usrc_myGroupBox)
                {
                    if (!bReadOnly)
                    {
                        this.myGroupBox.Unique_parameter_exist += myGroupBox_Unique_parameter_exist;
                        this.myGroupBox.bUnique_parameter_exist = true;
                        this.myGroupBox.RowReferenceFromTable_Check_NoChangeToOther += myGroupBox_RowReferenceFromTable_Check_NoChangeToOther;
                        this.myGroupBox.usrc_myGroupBox_IndexChanged += new usrc_myGroupBox.delegate_IndexChanged(myGroupBox_usrc_myGroupBox_IndexChanged);
                        this.myGroupBox.usrc_InputControl_ObjectChanged += new usrc_myGroupBox.delegate_ObjectChanged(myGroupBox_usrc_InputControl_ObjectChanged);
                    }
                }
                //if (pParentWindow is Panel)
                //{
                //    if (!bReadOnly)
                //    {
                //        this.myGroupBox.Unique_parameter_exist += myGroupBox_Unique_parameter_exist;
                //        this.myGroupBox.bUnique_parameter_exist = true;
                //        this.myGroupBox.RowReferenceFromTable_Check_NoChangeToOther += myGroupBox_RowReferenceFromTable_Check_NoChangeToOther;
                //        //this.myGroupBox.usrc_myGroupBox_IndexChanged += new usrc_myGroupBox.delegate_IndexChanged(myGroupBox_usrc_myGroupBox_IndexChanged);
                //        //this.myGroupBox.usrc_InputControl_ObjectChanged += new usrc_myGroupBox.delegate_ObjectChanged(myGroupBox_usrc_InputControl_ObjectChanged);
                //    }
                //}
            }
        }
示例#8
0
 private void usrc_EditTable_PriceList_SetInputControlProperties(Column col, object obj)
 {
     if (nav.m_eButtons == Navigation.eButtons.PrevNextExit)
     {
         if (col.ownerTable.TableName.Equals("PriceList"))
         {
             if (col.Name.Equals("Name"))
             {
                 col.InputControl.SetValue(lngRPMS.PriceList_Name.s);
             }
             if (col.Name.Equals("Valid"))
             {
                 col.InputControl.SetValue(true);
             }
         }
     }
 }
示例#9
0
 private void m_usrc_EditTable_SetInputControlProperties(Column col, object obj)
 {
     if (col.Name.Equals("dQuantity"))
     {
         if (col.ownerTable.TableName.Equals("Stock"))
         {
             if (obj is int)
             {
                 col.InputControl.SetNumericUpDown((int)obj);
             }
         }
     }
 }
        private void GetJoins(Column.nullTYPE nulltype, SQLTable pParentTable, string PreAliasTableName, string pParentTable_alias_table_name)
        {
            string alias_table_name = PreAliasTableName + SQLTable.VIEW_TableName_SEPARATOR + this.TableName_Abbreviation;
            Join_for_SQLView_InDataBase join = new Join_for_SQLView_InDataBase(null, TableName,TableName_Abbreviation, alias_table_name, PreAliasTableName + "." + this.TableName + "_ID", alias_table_name + ".ID", nulltype);
            Join_for_SQLView_InDataBase RefJoin = null;
            join.tbl = this;
            pParentTable.jList.items.Add(join);

            foreach (Column col in Column)
            {
                if (!col.IsIdentity)
                {
                    if (col.fKey != null)
                    {
                        if (col.fKey.fTable != null)
                        {
                            col.fKey.fTable.GetJoins(col.nulltype, this, alias_table_name, PreAliasTableName);
                        }
                    }
                }
            }
        }
 private void usrc_EditTable1_SetInputControlProperties(Column col, object obj)
 {
     if (nav.m_eButtons == Navigation.eButtons.PrevNextExit)
     {
         if (col.ownerTable.TableName.Equals("FVI_SLO_RealEstateBP"))
         {
             if (col.Name.Equals("BuildingNumber"))
             {
                 col.InputControl.SetValue(1);
             }
             else if (col.Name.Equals("BuildingSectionNumber"))
             {
                 col.InputControl.SetValue(1);
             }
             else if (col.Name.Equals("Community"))
             {
                 col.InputControl.SetValue(lngRPMS.s_Community1.s);
             }
             else if (col.Name.Equals("CadastralNumber"))
             {
                 col.InputControl.SetValue(1738);
             }
             else if (col.Name.Equals("ValidityDate"))
             {
                 col.InputControl.SetValue(new DateTime(2200,1,1));
             }
             else if (col.Name.Equals("ClosingTag"))
             {
                 col.InputControl.SetValue("Z");
             }
             else if (col.Name.Equals("SoftwareSupplier_TaxNumber"))
             {
                 col.InputControl.SetValue("89304489");
             }
             else if (col.Name.Equals("PremiseType"))
             {
                 col.InputControl.SetValue("C");
             }
         }
     }
 }
示例#12
0
        public void Init(SQLTable pParentTbl, Column col, List<usrc_InputControl> inpCtrlList, string sImportExportVec, bool bNumber, bool xbReadOnly)
        {
            bReadOnly = xbReadOnly;
            if (bReadOnly)
            {
                this.Cursor = Cursors.No;
            }
            else
            {
                this.Cursor = Cursors.Arrow;
            }
            m_active_ctrl_List.Clear();
            m_ParentTbl = pParentTbl;
            m_inpCtrlList = inpCtrlList;
            this.m_PathImportPicture = Properties.Settings.Default.SelectPicturePath;
            if (m_PathImportPicture == null)
            {
                m_PathImportPicture = Path.GetDirectoryName(Application.CommonAppDataPath);
            }
            else if (m_PathImportPicture.Length == 0)
            {
                m_PathImportPicture = Path.GetDirectoryName(Application.CommonAppDataPath);
            }

            this.m_PathImportDocument = Properties.Settings.Default.SelectDocumentPath;
            if (m_PathImportDocument == null)
            {
                m_PathImportDocument = Path.GetDirectoryName(Application.CommonAppDataPath);
            }
            else if (m_PathImportDocument.Length == 0)
            {
                m_PathImportDocument = Path.GetDirectoryName(Application.CommonAppDataPath);
            }

            bIsNumber = bNumber;
            sImportExportVector = sImportExportVec;
            Type myType = col.obj.GetType().BaseType;
            m_col = col;
            //Value = Activator.CreateInstance(myType);
            usrc_lbl.Init(m_col, m_inpCtrlList.Count, bReadOnly);
            CreateInputControls(pParentTbl, myType);
            SetDefault();
            EventHandler_Set(true);
            if (!bReadOnly)
            {
                usrc_lbl.null_selected += new CodeTables.usrc_InputControl_Label.delegate_null_selected(this.usrc_lbl_null_selected);
            }
            pParentTbl.myGroupBox.grpBox.Controls.Add(this);
            inpCtrlList.Add(this);
            if (usrc_lbl.Null_Selected)
            {
                hide_when_null(true);
            }
            this.Changed = false;
        }
示例#13
0
        public bool SetValue(Column column)
        {
            Object Obj = column.obj;
            Type basetype = Obj.GetType().BaseType;
            if (basetype == typeof(DB_Int32))
            {
                DB_Int32 xDB_int = (DB_Int32)Obj;
                nmUpDown.Value = xDB_int.val;
                return true;
            }
            else if (basetype == typeof(DB_Int64))
            {
                DB_Int64 xDB_long = (DB_Int64)Obj;
                nmUpDown.Value = Convert.ToDecimal(xDB_long.val);
                return true;
            }
            else if (basetype == typeof(DB_Money))
            {
                DB_Money xDB_Money = (DB_Money)Obj;
                MoneyUpDown.Value = xDB_Money.val;
                return true;
            }
            else if (basetype == typeof(DB_decimal2))
            {
                DB_decimal2 xDB_decimal = (DB_decimal2)Obj;
                nmUpDown.Value = xDB_decimal.val;
                return true;
            }
            else if (basetype == typeof(DB_Percent))
            {
                DB_Percent xDB_Percent = (DB_Percent)Obj;
                PercentUpDown.Value = xDB_Percent.val;
                return true;
            }
            else if (basetype == typeof(DB_smallInt))
            {
                DB_smallInt xDB_smallInt = (DB_smallInt)Obj;
                nmUpDown.Value = xDB_smallInt.val;
                return true;
            }
            else if (basetype == typeof(DB_bit))
            {
                DB_bit xDB_bit = (DB_bit)Obj;
                switch (m_col.Style)
                {
                    case Column.eStyle.none:
                    case Column.eStyle.CheckBox:
                    case Column.eStyle.CheckBox_default_true:
                    case Column.eStyle.ReadOnly_CheckBox_default_true:
                        if (xDB_bit.val)
                        {
                            chkBox.Checked = true;
                        }
                        else
                        {
                            chkBox.Checked = false;
                        }
                        break;

                    case Column.eStyle.RadioButtons:
                        if (xDB_bit.val)
                        {
                            rdbButton1.Checked = true;
                            rdbButton2.Checked = false;
                        }
                        else
                        {
                            rdbButton1.Checked = false;
                            rdbButton2.Checked = true;
                        }
                        break;
                }
                return true;
            }
            else if (basetype == typeof(DB_DateTime))
            {
                DB_DateTime xDB_DateTime = (DB_DateTime)Obj;
                if (xDB_DateTime.val == DateTime.MinValue)
                {
                   this.DateTimeInput.Value = this.DateTimeInput.MinDate;
                }
                else
                {
                    this.DateTimeInput.Value = xDB_DateTime.val;
                }

                return true;
            }
            else if (basetype == typeof(DB_varbinary_max))
            {
                DB_varbinary_max xDB_varbinary_max = (DB_varbinary_max)Obj;
                DataBox.Data = xDB_varbinary_max.val;
                return true;
            }
            else if (basetype == typeof(DB_Image))
            {
                DB_Image xDB_Image = (DB_Image)Obj;
                ImageConverter ic = new ImageConverter();
                Image img = (Image)ic.ConvertFrom(xDB_Image.val);
                Picture_Box.DBm_Image.Image_Data.Image = img;
                return true;
            }
            else if (basetype == typeof(DB_Document))
            {
                DB_Document xDB_Document = (DB_Document)Obj;
                Document_Box.Data = Globals.Decompress(xDB_Document.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_264))
            {
                DB_varchar_264 xDB_varchar_264 = (DB_varchar_264)Obj;
                SetTextValue(xDB_varchar_264.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_250))
            {
                DB_varchar_250 xDB_varchar_250 = (DB_varchar_250)Obj;
                SetTextValue(xDB_varchar_250.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_64))
            {
                DB_varchar_64 xDB_varchar_64 = (DB_varchar_64)Obj;
                SetTextValue(xDB_varchar_64.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_50))
            {
                DB_varchar_50 xDB_varchar_50 = (DB_varchar_50)Obj;
                SetTextValue(xDB_varchar_50.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_45))
            {
                DB_varchar_45 xDB_varchar_45 = (DB_varchar_45)Obj;
                SetTextValue(xDB_varchar_45.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_32))
            {
                DB_varchar_32 xDB_varchar_32 = (DB_varchar_32)Obj;
                SetTextValue(xDB_varchar_32.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_25))
            {
                DB_varchar_25 xDB_varchar_25 = (DB_varchar_25)Obj;
                SetTextValue(xDB_varchar_25.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_10))
            {
                DB_varchar_10 xDB_varchar_10 = (DB_varchar_10)Obj;
                SetTextValue(xDB_varchar_10.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_5))
            {
                DB_varchar_5 xDB_varchar_5 = (DB_varchar_5)Obj;
                SetTextValue(xDB_varchar_5.val);
                return true;
            }
            else if (basetype == typeof(DB_varchar_2000))
            {
                DB_varchar_2000 xDB_varchar_2000 = (DB_varchar_2000)Obj;
                this.RichtxtBox.Text = xDB_varchar_2000.val;
                return true;
            }
            else if (basetype == typeof(DB_varchar_max))
            {
                DB_varchar_max xDB_varchar_max = (DB_varchar_max)Obj;
                this.RichtxtBox.Text = xDB_varchar_max.val;
                return true;
            }
            else if (basetype == typeof(DB_Image))
            {
                DB_Image xDB_Image = (DB_Image)Obj;
                ImageConverter ic = new ImageConverter();
                Image img = (Image)ic.ConvertFrom(xDB_Image.val);
                Picture_Box.DBm_Image.Image_Data.Image = img;
                return true;
            }
            else if (basetype == typeof(DB_Document))
            {
                DB_Document xDB_Documentt = (DB_Document)Obj;
                //ImageConverter ic = new ImageConverter();
                //Image img = (Image)ic.ConvertFrom(xDBm_Image.val);
                //Picture.Image = img;
                return true;
            }
            else
            {
                LogFile.Error.Show("ERROR: Object of type:" + Obj.GetType().ToString() + "Is not one of DBTypes !");
                return false;
            }
        }