public JArray PostUnit(Units obj)    //insert data to the user table
 {
     try
     {
         int unitid = _units.NextSequenceId(obj);
         obj.unit_id  = unitid;
         obj.audit_ts = DateTime.Now;
         _units.Create(obj);
         return(GetUnit());
         //ObjectId i;
         //i = _units.Create(obj);
         //IList<Units> objUnits = new List<Units>();
         //objUnits = _units.GetAllData();
         //return JArray.Parse(objUnits.ToJson(new JsonWriterSettings { OutputMode = JsonOutputMode.Strict }));
     }
     catch (Exception)
     {
         throw;
     }
 }