Esempio n. 1
0
        protected override void DeleteChildEntities(string[] childEntityList, string parentID)
        {
            foreach (string ChildEntity in childEntityList)
            {
                switch (ChildEntity)
                {
                    #region /* Case Statements - All child grids */

                case "ScaleDetails":
                    if (Convert.ToInt32(parentID) > 0)
                    {
                        ScaleDetailsLibrary        ScaleDetailsLibrary = new ScaleDetailsLibrary(ConfigurationHelper.GetsmARTDBContextConnectionString());
                        IEnumerable <ScaleDetails> resultList          = ScaleDetailsLibrary.GetAllByParentID(Convert.ToInt32(parentID));
                        foreach (ScaleDetails scaleDetails in resultList)
                        {
                            ScaleDetailsLibrary.Delete(scaleDetails.ID.ToString());
                        }
                    }
                    break;

                case "ScaleNotes":
                    if (Convert.ToInt32(parentID) > 0)
                    {
                        ScaleNotesLibrary        ScaleNotesLibrary = new ScaleNotesLibrary(ConfigurationHelper.GetsmARTDBContextConnectionString());
                        IEnumerable <ScaleNotes> resultList        = ScaleNotesLibrary.GetAllByParentID(Convert.ToInt32(parentID));
                        foreach (ScaleNotes ScaleNote in resultList)
                        {
                            ScaleNotesLibrary.Delete(ScaleNote.ID.ToString());
                        }
                    }
                    break;

                case "ScaleAttachments":
                    if (Convert.ToInt32(parentID) > 0)
                    {
                        ScaleAttachmentsLibrary        ScaleLibrary = new ScaleAttachmentsLibrary(ConfigurationHelper.GetsmARTDBContextConnectionString());
                        IEnumerable <ScaleAttachments> resultList   = ScaleLibrary.GetAllByParentID(Convert.ToInt32(parentID));

                        foreach (ScaleAttachments scaleAttachment in resultList)
                        {
                            ScaleLibrary.Delete(scaleAttachment.ID.ToString());
                        }
                    }
                    break;
                    //case "ScaleIDCardAttachments":
                    //  if (Convert.ToInt32(parentID) > 0) {
                    //    ScaleIDCardAttachmentsLibrary ScaleLibrary = new ScaleIDCardAttachmentsLibrary(ConfigurationHelper.GetsmARTDBContextConnectionString());
                    //    IEnumerable<ScaleIDCardAttachments> resultList = ScaleLibrary.GetAllByParentID(Convert.ToInt32(parentID));

                    //    foreach (ScaleIDCardAttachments scaleAttachment in resultList) {

                    //      ScaleLibrary.Delete(scaleAttachment.ID.ToString());
                    //    }
                    //  }
                    //break;
                    #endregion
                }
            }
        }
Esempio n. 2
0
        public bool IsLineItemExits(int scaleId)
        {
            bool exits = true;
            IEnumerable <ScaleDetails> resultList;

            if (scaleId <= 0)
            {
                resultList = (IList <ScaleDetails>)Session["ScaleDetails"];
            }
            else
            {
                ScaleDetailsLibrary ScaleDetailsLibrary = new ScaleDetailsLibrary(ConfigurationHelper.GetsmARTDBContextConnectionString());
                resultList = ScaleDetailsLibrary.GetAllByParentID(scaleId);
            }

            if (resultList == null || resultList.Count() <= 0)
            {
                exits = false;
            }

            return(exits);
        }
Esempio n. 3
0
        public IEnumerable <ScaleDetails> GetTicketItemsByTicketId(int ticketId)
        {
            IEnumerable <ScaleDetails> ticketItems = _scaleDetailLib.GetAllByParentID(ticketId, new string[] { "Scale", "Item_Received", "Apply_To_Item" });

            return(ticketItems);
        }