Exemplo n.º 1
0
        public override void replace(object o)
        {
            EquipmentBid equipmentBid = o as EquipmentBid;

            if (equipmentBid == null)
            {
                return;
            }
            Id_modification = equipmentBid.Id_modification;
            Id_bid          = equipmentBid.Id_bid;
            Serial_number   = equipmentBid.Serial_number;
            Is_blank_print  = equipmentBid.Is_blank_print;
            Is_archive      = equipmentBid.Is_archive;

            raiseAllProperties();
        }
Exemplo n.º 2
0
 public bool generateSerialNumber()
 {
     try {
         HTTPManager.HTTPRequest http = HTTPManager.HTTPRequest.Create(Settings.uri);
         http.UseCookie = true;
         http.addParameter("entity", "Bid/generateEquipmentBidSerialNumber");
         http.addParameter("id", Id);
         if (!http.post())
         {
             LastError = HTTPManager.HTTPRequest.LastError;
             return(false);
         }
         ResponseParser parser = ResponseParser.Parse(http.ResponseData);
         if (!parser.NoError)
         {
             LastError = parser.LastError;
             return(false);
         }
         if (parser.ServerErrorFlag != 0)
         {
             LastError = parser.ToObject <string>();
             return(false);
         }
         List <TempEquipmentBid> updatedEquipmentBid = parser.ToObject <List <TempEquipmentBid> >();
         for (int i = 0; i < updatedEquipmentBid.Count; i++)
         {
             EquipmentBid equipmentBid = EquipmentBidViewModel.instance().getById(updatedEquipmentBid[i].Id);
             if (equipmentBid == null)
             {
                 continue;
             }
             equipmentBid.setSerialNumber(updatedEquipmentBid[i].SerialNumber);
         }
         return(true);
     }
     catch (Exception ex)
     {
         LastError = ex.ToString();
         return(false);
     }
 }