コード例 #1
0
ファイル: Program.cs プロジェクト: hari81/MobileService
        static void Main(string[] args)
        {
            EquipmentInspectionListEntity obj = new EquipmentInspectionListEntity();

            List <InspectionDetails> insList = new List <InspectionDetails>();
            InspectionDetails        insObj  = new InspectionDetails();

            insObj.Comments      = "Comments";
            insObj.CompartIdAuto = 1234;
            insObj.Reading       = "100";

            insList.Add(insObj);

            UndercarriageInspectionEntity        obj1     = new UndercarriageInspectionEntity();
            List <UndercarriageInspectionEntity> obj1List = new List <UndercarriageInspectionEntity>();

            obj1.Abrasive = 0;
            obj1.Examiner = "Riya";
            obj1.Details  = insList.ToArray();

            obj1List.Add(obj1);
            obj.EquipmentsCount           = 1;
            obj.EquipmentsInspectionsList = obj1List.ToArray();


            MobileServiceClient _c = new MobileServiceClient("test", "http://localhost:53781/MobileService.svc");

            _c.SaveEquipmentsInspectionsData(obj);
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(long id)
        {
            InspectionDetails inspectionDetails = db.InspectionDetails.Find(id);

            db.InspectionDetails.Remove(inspectionDetails);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "InspectionNo,Date,PremisesRef,Officer,GeneralHygieneStatus")] InspectionDetails inspectionDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(inspectionDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(inspectionDetails));
 }
コード例 #4
0
        public ActionResult Create([Bind(Include = "Date,MLRQ1, MLRQ2, MLRQ3, MLRQ4, MLRQ5,PremisesRef,Officer,GeneralHygieneStatus")] InspectionDetails inspectionDetails)
        {
            if (ModelState.IsValid)
            {
                db.InspectionDetails.Add(inspectionDetails);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(inspectionDetails));
        }
コード例 #5
0
        // GET: InspectionDetails/Delete/5
        public ActionResult Delete(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InspectionDetails inspectionDetails = db.InspectionDetails.Find(id);

            if (inspectionDetails == null)
            {
                return(HttpNotFound());
            }
            return(View(inspectionDetails));
        }
コード例 #6
0
        /// <summary>
        /// Method SaveInspectionDetails
        ///
        /// </summary>
        /// <remarks>@author RCordova-2017/08/15</remarks>
        /// <returns>true/false</returns>
        public bool SaveInspectionDetails()
        {
            double lDbQuantity = 0;
            bool   lBoolResult = true;

            int lIntResult = 0;

            DeleteRowList();

            //DetailsList();

            for (int i = 1; i < mObjMtxInspDetails.RowCount + 1; i++)
            {
                if (llstInspDetDTO[i - 1].RowCode == null)
                {
                    InspectionDetails inspD = new InspectionDetails();
                    inspD.CodeInsp = mlstInspection[0].IdInspection;
                    inspD.ItemCode = mlstInspection[0].Type;
                    //inspD.MvtoType = Convert.ToInt64(((SAPbouiCOM.EditText)(mObjMtxInspDetails.Columns.Item("ColType").Cells.Item(i).Specific)).Value);
                    inspD.MvtoType = Convert.ToInt64(mObjInspectionCheckListDAO.GetTypeByType(((SAPbouiCOM.EditText)mObjMtxInspDetails
                                                                                               .Columns.Item(4).Cells.Item(i).Specific).Value, ((SAPbouiCOM.EditText)(mObjMtxInspDetails.Columns.Item("ColType").Cells.Item(i).Specific)).Value));
                    lDbQuantity      = double.Parse(((SAPbouiCOM.EditText)(mObjMtxInspDetails.Columns.Item("ColQuan").Cells.Item(i).Specific)).Value);
                    inspD.Quantity   = (long)lDbQuantity;
                    inspD.Commentary = ((SAPbouiCOM.EditText)(mObjMtxInspDetails.Columns.Item("ColComm").Cells.Item(i).Specific)).Value;

                    lIntResult = mObjInspDetailsService.SaveInspectionDetails(inspD);
                    if (lIntResult != 0)
                    {
                        Application.SBO_Application.MessageBox(DIApplication.Company.GetLastErrorDescription());
                        lBoolResult = false;
                    }
                }
            }
            lBoolResult = true;



            return(lBoolResult);
        }
コード例 #7
0
 public virtual int Fill(InspectionDetails.InspectionTypeMasterDataTable dataTable) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
コード例 #8
0
 public virtual int Update(InspectionDetails.InspectionQueriesDataTable dataTable) {
     return this.Adapter.Update(dataTable);
 }
コード例 #9
0
 public virtual int Update(InspectionDetails dataSet) {
     return this.Adapter.Update(dataSet, "InspectionMemoAction");
 }
コード例 #10
0
 public virtual int Update(InspectionDetails.InspectingOfficerDataTable dataTable) {
     return this.Adapter.Update(dataTable);
 }
コード例 #11
0
        /// <summary>
        /// Mining Shovel APIs
        /// </summary>
        /// <param name="Equip"></param>
        /// <returns></returns>
        public Stream PostValidateMiningShovelEquipInfo(BLL.Core.MiningShovel.Models.SyncModel Equip)
        {
            List <BLL.Core.Domain.ResultMessageExtended> rmList = new List <BLL.Core.Domain.ResultMessageExtended>();

            try
            {
                ///////////////////////////////////////////////////////////
                // Update TRACK_INSPECTION and TRACK_INSPECTION_DETAIL
                EquipmentInspectionListEntity EquipList = new EquipmentInspectionListEntity();

                ///////////////////
                // Equipment count
                EquipList.EquipmentsCount = 1;

                ///////////////////
                // New equipment
                List <NewEquipmentEntity> newEquip = new List <NewEquipmentEntity>();
                EquipList.NewEquipmentsInspectionsList = newEquip;

                ///////////////////
                // Equipment list
                List <UndercarriageInspectionEntity> EquipmentsInspectionsList = new List <UndercarriageInspectionEntity>();
                UndercarriageInspectionEntity        equipInspection           = new UndercarriageInspectionEntity();
                equipInspection.Abrasive              = Equip.abrasive;
                equipInspection.Impact                = Equip.impact;
                equipInspection.Moisture              = Equip.moisture;
                equipInspection.Packing               = Equip.packing;
                equipInspection.SMU                   = Equip.smu.ToString();
                equipInspection.DryJointsLeft         = 0;
                equipInspection.DryJointsRight        = 0;
                equipInspection.EquipmentIdAuto       = Equip.equipmentid_auto;
                equipInspection.Examiner              = Equip.examiner;
                equipInspection.ExtCannonLeft         = 0;
                equipInspection.ExtCannonRight        = 0;
                equipInspection.InspectionDate        = Equip.currentDateandTime;
                equipInspection.InspectorComments     = Equip.notes;
                equipInspection.JobsiteComments       = Equip.Jobsite_Comms;
                equipInspection.leftCannonExtComment  = "";
                equipInspection.leftCannonExtImage    = "";
                equipInspection.leftScallop           = 0;
                equipInspection.leftTrackSagComment   = "";
                equipInspection.leftTrackSagImage     = "";
                equipInspection.rightCannonExtComment = "";
                equipInspection.rightCannonExtImage   = "";
                equipInspection.rightScallop          = 0;
                equipInspection.rightTrackSagComment  = "";
                equipInspection.rightTrackSagImage    = "";
                equipInspection.TrackSagLeft          = 0;
                equipInspection.TrackSagRight         = 0;
                equipInspection.travelForward         = 0;
                equipInspection.travelReverse         = 0;
                equipInspection.TrammingHours         = Equip.TrammingHours;
                equipInspection.CustomerContact       = Equip.CustomerContact;

                // InspectionDetails
                //equipInspection.Details = ???
                List <InspectionDetails> inspectionDetailList = new List <InspectionDetails>();
                foreach (var item in Equip.InspectionDetails)
                {
                    InspectionDetails inspectionDetail = new InspectionDetails();
                    inspectionDetail.AttachmentType = 0;
                    inspectionDetail.Comments       = "";
                    inspectionDetail.TrackUnitAuto  = item.EqunitAuto;

                    DAL.LU_COMPART            compart   = new LU_COMPART();
                    BLL.Core.Domain.Component component = new BLL.Core.Domain.Component(new UndercarriageContext());
                    compart = component.getCompart(item.EqunitAuto);

                    inspectionDetail.CompartIdAuto   = compart.compartid_auto;
                    inspectionDetail.FlangeType      = "";
                    inspectionDetail.Image           = "";
                    inspectionDetail.InspectionImage = "";
                    inspectionDetail.PercentageWorn  = 0;
                    inspectionDetail.Reading         = "";
                    inspectionDetail.ToolUsed        = "";

                    inspectionDetailList.Add(inspectionDetail);
                }

                equipInspection.Details = inspectionDetailList;

                EquipmentsInspectionsList.Add(equipInspection);

                EquipList.EquipmentsInspectionsList = EquipmentsInspectionsList;

                /////////////
                // Validate
                //List<BLL.Core.Domain.ResultMessageExtended> returnList = SaveEquipmentsInspectionsData(EquipList);
                try
                {
                    rmList = EquipmentInspectionList.Instance.SaveRopeShovelEquipmentInspections(EquipList);
                }
                catch (Exception ex)
                {
                    BLL.Core.Domain.ResultMessageExtended rmException = new BLL.Core.Domain.ResultMessageExtended();
                    rmException.ActionLog = "In Service " + ex.Message;
                    if (ex.InnerException != null)
                    {
                        rmException.ActionLog += ex.InnerException.Message;
                    }
                    rmException.OperationSucceed = false;
                    rmException.Id          = -1;
                    rmException.LastMessage = ex.Message;
                    rmList.Add(rmException);
                }
            }
            catch (Exception ex)
            {
                BLL.Core.Domain.ResultMessageExtended rmException = new BLL.Core.Domain.ResultMessageExtended();
                rmException.ActionLog = "In Service " + ex.Message;
                if (ex.InnerException != null)
                {
                    rmException.ActionLog += ex.InnerException.Message;
                }
                rmException.OperationSucceed = false;
                rmException.Id          = -1;
                rmException.LastMessage = ex.Message;
                rmList.Add(rmException);
            }

            //return rmList.First().Id;
            var stream = new MemoryStream();
            var writer = new StreamWriter(stream);

            writer.Write(JsonConvert.SerializeObject(rmList));
            writer.Flush();
            stream.Position = 0;
            return(stream);
        }
コード例 #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pObjInsp"></param>
        /// <returns></returns>
        public int SaveInspectionDetails(InspectionDetails pObjInspDetails)
        {
            int result = mObjInspDetailsDAO.Add(pObjInspDetails);

            return(result);
        }
コード例 #13
0
 public virtual int Update(InspectionDetails dataSet) {
     return this.Adapter.Update(dataSet, "InspectionCheckListMaster");
 }
コード例 #14
0
 public virtual int Update(InspectionDetails.InspectionCheckListMasterDataTable dataTable) {
     return this.Adapter.Update(dataTable);
 }
コード例 #15
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     InspectionDetails ds = new InspectionDetails();
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
コード例 #16
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     InspectionDetails ds = new InspectionDetails();
     global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "InspectingOfficerDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
コード例 #17
0
 public virtual int Update(InspectionDetails dataSet) {
     return this.Adapter.Update(dataSet, "InspectingOfficer");
 }