コード例 #1
0
        public string SaveZone(Zone aZone)
        {
            int value = zoneGateway.SaveZonetype(aZone);

            if (value > 0)
            {
                return "Zone Type Saved Successfully!";
            }
            else
            {
                return "Sorry! Save failed!";
            }
        }
コード例 #2
0
 private void zoneTypeSaveButton_Click(object sender, EventArgs e)
 {
     Zone aZone = new Zone();
     aZone.ZoneType = typeNameTextBox.Text;
     if (aZone.ZoneType == "") {
         MessageBox.Show("Enter Zone type!");
         return;
     }
     if(zoneManager.IsZoneExixts(aZone.ZoneType)){
         MessageBox.Show("This Zone Type Already Exists!");
         return;
     }
     MessageBox.Show(zoneManager.SaveZone(aZone));
     typeNameTextBox.Clear();
     ShowAllZoneType();
 }
コード例 #3
0
 public int CheckedZone(int visitorId)
 {
     int check = 0;
     foreach (Control box in visitorGroupBox.Controls) {
         if (box is CheckBox)
         {
             CheckBox temp = (CheckBox)box;
             if (temp.Checked)
             {
                 check = 1;
                 Visitor aVisitor = new Visitor();
                 Zone selectedZone = (Zone)temp.Tag;
                 Zone aZone = new Zone();
                 aZone.Id = selectedZone.Id;
                 aVisitor.AZon = aZone;
                 visitorManager.SaveInRelation(visitorId,aVisitor.AZon.Id);
                 zoneManager.UpdateTotalVisitors(aZone.Id);
               }
           }
       }
     return check;
 }