Пример #1
0
 public void Delete(modelClient client, bool reload = true)
 {
     db.Delete("tblClient", "ID", client);
     if (reload)
     {
         LoadClients();
     }
 }
Пример #2
0
 public void Update(modelClient client, bool reload = true)
 {
     if (client.CreatedDate.Year < 2000)
     {
         client.CreatedDate = new DateTime(2000, 1, 1);
     }
     client.UpdatedDate = DateTime.Now;
     db.Update("tblClient", "ID", client);
     if (reload)
     {
         LoadClients();
     }
 }
Пример #3
0
 public void Insert(modelClient client, bool reload = true)
 {
     if (client.ID == 0)
     {
         client.ID          = Program.GData.LongID();
         client.CreatedDate = DateTime.Now;
         client.UpdatedDate = DateTime.Now;
     }
     db.Insert("tblClient", "ID", false, client);
     if (reload)
     {
         LoadClients();
     }
 }
Пример #4
0
        public void InitData()
        {
            dataLOV = new domainListOfValues();
            dataLOV.LoadData();

            dataPerson = new domainPerson();
            dataPerson.LoadData();

            dataOrganization = new domainOrganization();
            dataOrganization.LoadData();

            dataProject = new domainProject();
            dataProject.LoadData();

            dataActivity = new domainActivity();
            dataActivity.LoadData();

            string computerName = SystemInformation.ComputerName;
            var    client       = dataLOV.getClients.FirstOrDefault(c => c.ComputerName.ToUpper() == computerName.ToUpper());

            if (client != null)
            {
                CFGStationID = client.ComputerID;
            }
            else
            {
                CFGStationID = dataLOV.getClients.Max(c => c.ComputerID) + 1;
                var clnt = new modelClient(computerName, CFGStationID);
                dataLOV.Insert(clnt);
            }

            projectCalls = new List <modelProjectCall>();
            projectCalls.Add(new modelProjectCall("2017-1", new DateTime(2017, 5, 1)));
            projectCalls.Add(new modelProjectCall("2017-2", new DateTime(2017, 8, 1)));
            projectCalls.Add(new modelProjectCall("2017-3", new DateTime(2018, 1, 1)));
            projectCalls.Add(new modelProjectCall("2018-1", new DateTime(2018, 5, 1)));
            projectCalls.Add(new modelProjectCall("2018-2", new DateTime(2018, 8, 1)));
            projectCalls.Add(new modelProjectCall("2018-3", new DateTime(2019, 1, 1)));
            projectCalls.Add(new modelProjectCall("2019-1", new DateTime(2019, 5, 1)));
            projectCalls.Add(new modelProjectCall("2019-2", new DateTime(2019, 8, 1)));
        }