Esempio n. 1
0
        protected override void OnLoaded()
        {
            base.OnLoaded();
            _listBeMonitorField = new List <ConmonFunctionForUpdate.MonitorField>
            {
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_AppDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheLawInfo.dt_AppDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_PubDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheLawInfo.dt_PubDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_CertfDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheLawInfo.dt_CertfDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_PCTAppDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheLawInfo.dt_PCTAppDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_PCTPubDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheLawInfo.dt_PCTPubDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_PCTInNationDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheLawInfo.dt_PCTInNationDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_IssuedPubDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheLawInfo.dt_IssuedPubDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.RelatedInfo, FieldName = "s_AppNo", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheLawInfo.s_AppNo"
                },
            };
            var type = this.GetType();

            _xplCopyOfObject = Activator.CreateInstance(type, new[] { new UnitOfWork() }) as XPLiteObject;
            ConmonFunctionForUpdate.CopyDataEntityFileds(this, _xplCopyOfObject, _listBeMonitorField);
        }
Esempio n. 2
0
 void NewLocationController_ObjectCreated(object sender, ObjectCreatedEventArgs e)
 {
     if (e.CreatedObject is LocationData)
     {
         try
         {
             var view = sender as DevExpress.ExpressApp.ViewController;
             if (view == null || view.View == null || view.View.SelectedObjects == null || view.View.SelectedObjects.Count < 1)
             {
                 return;
             }
             if (view.View.SelectedObjects[0] is System.Data.Objects.DataClasses.EntityObject)
             {
                 var o = (System.Data.Objects.DataClasses.EntityObject)view.View.SelectedObjects[0];
                 var c = ((DevExpress.ExpressApp.EF.EFObjectSpace)view.View.ObjectSpace).ObjectContext;
                 //var t = c.MetadataWorkspace.GetEntityContainer(c.DefaultContainerName, System.Data.Metadata.Edm.DataSpace.CSpace);
                 ((LocationData)e.CreatedObject).TableType      = NKD.Module.BusinessObjects.BusinessObjectHelper.GetTableName(c, view.View.SelectedObjects[0].GetType());
                 ((LocationData)e.CreatedObject).ReferenceID    = (Guid)o.EntityKey.EntityKeyValues[0].Value;
                 ((LocationData)e.CreatedObject).LocationDataID = Guid.NewGuid();
             }
             else if (view.View.SelectedObjects[0] is DevExpress.Xpo.XPLiteObject)
             {
                 XPLiteObject o = view.View.SelectedObjects[0] as XPLiteObject;
                 ((LocationData)e.CreatedObject).ReferenceID = (Guid)o.This.GetType().GetProperty(o.ClassInfo.KeyProperty.Name).GetValue(o.This);
                 ((LocationData)e.CreatedObject).TableType   = o.ClassInfo.TableName;
             }
         }
         catch { }
     }
 }
Esempio n. 3
0
        protected override void OnLoaded()
        {
            base.OnLoaded();
            _listBeMonitorField = new List <ConmonFunctionForUpdate.MonitorField>
            {
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_TransmitDate", CodeNameSpace = "DataEntities.Element.Files.InFile", CodeFieldName = "dt_TransmitDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_GetCertificatedate", CodeNameSpace = "DataEntities.Element.Files.InFile", CodeFieldName = "dt_GetCertificatedate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_ReceiveDate", CodeNameSpace = "DataEntities.Element.Files.BaseFile", CodeFieldName = "dt_ReceiveDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_SendDate", CodeNameSpace = "DataEntities.Element.Files.BaseFile", CodeFieldName = "dt_SendDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_CreateDate", CodeNameSpace = "DataEntities.Element.Files.BaseFile", CodeFieldName = "dt_CreateDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.RelatedInfo, FieldName = "s_Name", CodeNameSpace = "DataEntities.Element.Files.BaseFile", CodeFieldName = "s_Name"
                },
            };
            var type = this.GetType();

            _xplCopyOfObject = Activator.CreateInstance(type, new[] { new UnitOfWork() }) as XPLiteObject;
            ConmonFunctionForUpdate.CopyDataEntityFileds(this, _xplCopyOfObject, _listBeMonitorField);
        }
        protected override void OnValueStored()
        {
            base.OnValueStored();
            //Tạo mới Nơi phát hành nếu chưa tồn tại
            if (View is DetailView && ((DetailView)View).ViewEditMode == ViewEditMode.Edit)
            {
                ASPxComboBox control = this.DropDownEdit.Controls[0] as ASPxComboBox;

                if (control.Text == control.Value.ToString())
                {
                    XPLiteObject doc     = View.CurrentObject as XPLiteObject;
                    Type         ObjType = CurrentObject.GetType();
                    UnitOfWork   uow     = new UnitOfWork(doc.Session.DataLayer);

                    HinhThucThanhToan current = uow.FindObject <HinhThucThanhToan>(new BinaryOperator("TieuDe", control.Text));
                    if (current == null)
                    {
                        current        = new HinhThucThanhToan(uow);
                        current.TieuDe = control.Text;
                        current.Save();
                        uow.CommitTransaction();
                    }
                    PropertyInfo TieuDe = ObjType.GetProperty("HinhThucThanhToan");
                    TieuDe.SetValue(doc, doc.Session.GetObjectByKey <HinhThucThanhToan>(current.Oid));
                    doc.Save();
                    doc.Session.CommitTransaction();
                }
            }
        }
Esempio n. 5
0
        public static T CreateXPObject <T>() where T : XPLiteObject
        {
            //CreateInMemoryDataLayer();

            XPLiteObject xpLiteObject =
                (T)Activator.CreateInstance(typeof(T), UnitOfWork());

            return((T)xpLiteObject);
        }
Esempio n. 6
0
        protected override void OnLoaded()
        {
            base.OnLoaded();
            _listBeMonitorField = new List <ConmonFunctionForUpdate.MonitorField>
            {
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_AppDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_AppDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_PrePubDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_PrePubDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_FormalCheckDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_FormalCheckDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_EssCheckDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_EssCheckDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_RegistrationDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_RegistrationDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_ApprovedDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_ApprovedDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_BeginDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_BeginDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_EndDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_EndDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_WithdrawDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_WithdrawDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_NextRenewal", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_NextRenewal"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_DivSubmitDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_DivSubmitDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_OrigAppDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_OrigAppDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_MadFilingDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_MadFilingDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.Deadline, FieldName = "dt_MadRegDate", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.dt_MadRegDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    MonitorType = ConmonFunctionForUpdate.EnumMonitorType.RelatedInfo, FieldName = "s_AppNo", CodeNameSpace = "DataEntities.Case.Trademarks.BasicTrademark", CodeFieldName = "TheLawInfo.s_AppNo"
                },
            };
            var type = this.GetType();

            _xplCopyOfObject = Activator.CreateInstance(type, new[] { new UnitOfWork() }) as XPLiteObject;
            ConmonFunctionForUpdate.CopyDataEntityFileds(this, _xplCopyOfObject, _listBeMonitorField);
        }
Esempio n. 7
0
        private void TreeList_Click(object sender, EventArgs e)
        {
            var list = (DevExpress.XtraTreeList.TreeList)sender;

            if (list.FocusedNode != null)
            {
                var currRec = (CoreModel.Line)list.GetDataRecordByNode(list.FocusedNode);
                fSelectedRow = currRec;

                var popUpEditor = (PopupContainerControl)this.Parent;
                popUpEditor.OwnerEdit.EditValue = currRec.LineId;
                //popUpEditor.QueryDisplayText += (s, e) => { e.DisplayText = currR; };
                popUpEditor.OwnerEdit.ClosePopup();
            }
        }
Esempio n. 8
0
        protected override void OnLoaded()
        {
            base.OnLoaded();
            _listBeMonitorDateField = new List <ConmonFunctionForUpdate.MonitorField>
            {
                new ConmonFunctionForUpdate.MonitorField {
                    FieldName = "dt_PubDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheOrigPatInfo.dt_PubDate"
                },
                new ConmonFunctionForUpdate.MonitorField {
                    FieldName = "dt_IssuedPubDate", CodeNameSpace = "DataEntities.Case.Patents.BasicPatent", CodeFieldName = "TheOrigPatInfo.dt_IssuedPubDate"
                },
            };
            var type = this.GetType();

            _xplCopyOfObject = Activator.CreateInstance(type, new[] { new UnitOfWork() }) as XPLiteObject;
            ConmonFunctionForUpdate.CopyDataEntityFileds(this, _xplCopyOfObject, _listBeMonitorDateField);
        }
Esempio n. 9
0
        public static T Bl <T>(this XPLiteObject boType) where T : IBllBase
        {
            var type = boType.GetType();

            //if (!DXApplication1Module._type2BllMap.ContainsKey(type))
            //{
            //    var blInstance = (IBllBase)Activator.CreateInstance(typeof(T), new DBRepository());
            //    DXApplication1Module._type2BllMap.Add(blInstance.BoType, blInstance);
            //}

            var blType = DXApplication1Module._type2BllMap[type];

            if (blType.BoType != boType.GetType())
            {
                throw new InvalidOperationException();
            }

            return((T)DXApplication1Module._type2BllMap[type]);
        }