Esempio n. 1
0
        public ContractForm()
        {
            InitializeComponent(); if (DesignMode || (Site != null && Site.DesignMode))
            {
                return;
            }

            CntrlCL = DBControllersFactory.Client();
            CntrlCG = DBControllersFactory.BillingCategory();
            CntrlSR = DBControllersFactory.Service();
            CntrlCU = DBControllersFactory.Currency();
            CntrlVT = DBControllersFactory.VAT();

            //template
            Mapper["Id"]        = txtId;
            Mapper["CreatedBy"] = txtCreatedBy;
            Mapper["CreatedOn"] = txtCreatedOn;
            Mapper["UpdatedBy"] = txtUpdatedBy;
            Mapper["UpdatedOn"] = txtUpdatedOn;
            Mapper["ReadOnly"]  = chkReadOnly;
            //data
            Mapper["ContractCode"] = txtContractCode;
            Mapper["StartDate"]    = txtStartDate;
            Mapper["EndDate"]      = txtEndDate;
            Mapper["ClientId"]     = txtClientId;
            Mapper["IsActive"]     = chkIsActive;
            Mapper["Conditions"]   = txtConditions;
            //actions
            SaveButton   = btnSave;
            DeleteButton = btnDelete;
            NewButton    = btnNew;
            //pick lists
            PickList[btnPLClient]   = txtClientId;
            PickList[btnPLContract] = txtId;

            Services = new List <ServiceModel>();

            ModelChanged = delegate() {
                Console.WriteLine("-==================== model changed");
                RequeryServicesGrid();
            };
        }