// GET api/additionalfollowupinfoperservice
        public IEnumerable<AdditionalFollowUpInfoPerServices> Get(int Organization)
        {
            List<AdditionalFollowUpInfoPerServices> listAdditionalFollowUpInfoPerServices = new List<AdditionalFollowUpInfoPerServices>();

            DataView dvUsers = UserBO.GetUsersIDByOrganization(Organization);
            string TempCreatedBy = "";
            if (dvUsers.Count > 0)
            {
                foreach (DataRowView drvUsers in dvUsers)
                {
                    TempCreatedBy += "CreatedBy=" + drvUsers["UserID"] + " OR ";
                }
                string CreatedBy = TempCreatedBy.Remove(TempCreatedBy.Length - 3);
             
                DataView dvServiceProvidedPerSaMI = ServicesProvidedPerSaMIBO.GetServicesProvidedPerSaMIIDForSync(CreatedBy);
                string ServiceProvidedPersaMIID = "";
                if (dvServiceProvidedPerSaMI.Count > 0)
                {
                    foreach (DataRowView drvSPPSaMI in dvServiceProvidedPerSaMI)
                    {
                        ServiceProvidedPersaMIID += "ServiceProvidedPerSaMIID=" + drvSPPSaMI["ServiceProvidedPerSaMIID"] + " OR ";
                    }
                    string listOfServiceProvidedPerSaMIID = ServiceProvidedPersaMIID.Remove(ServiceProvidedPersaMIID.Length - 3);

                    DataView dvAdditionalFollowUpInfoPerServices = AdditionalFollowUpInfoPerServiceBO.GetAdditionalFollowUpInfoPerServicesIDForSync(listOfServiceProvidedPerSaMIID);
                    foreach (DataRowView drvAdditionalFollowUpInfoPerServices in dvAdditionalFollowUpInfoPerServices)
                    {
                        AdditionalFollowUpInfoPerServices AdditionalFollowUpInfoPerServices = new AdditionalFollowUpInfoPerServices();
                        listAdditionalFollowUpInfoPerServices.Add(AdditionalFollowUpInfoPerServiceBO.GetAdditionalFollowUpInfoPerServices(Convert.ToInt32(drvAdditionalFollowUpInfoPerServices["AdditionalFollowUpInfoPerServiceID"])));
                    }
                }
            }
            return listAdditionalFollowUpInfoPerServices;
        }
        public static List<AdditionalFollowUpInfoPerServices> GetAllByServiceProvidedPerSaMIID(int ServiceProvidedPerSaMIID)
        {
            List<AdditionalFollowUpInfoPerServices> lstAdditionalFollowUpInfoPerServices = new List<AdditionalFollowUpInfoPerServices>();

            DataView objDataView = new AdditionalFollowUpInfoPerServiceDAO().SelectAll(ServiceProvidedPerSaMIID);

            foreach (DataRowView drv in objDataView)
            {
                AdditionalFollowUpInfoPerServices objAdditionalFollowUpInfoPerServices = new AdditionalFollowUpInfoPerServices();
                objAdditionalFollowUpInfoPerServices.AdditionalFollowUpInfoPerServiceID = (int)drv["AdditionalFollowUpInfoPerServiceID"];
                objAdditionalFollowUpInfoPerServices.ServiceProvidedPerSaMIID = (int)drv["ServiceProvidedPerSaMIID"];
                objAdditionalFollowUpInfoPerServices.AdditionalFollowupInfoID = (int)drv["AdditionalFollowupInfoID"];
                lstAdditionalFollowUpInfoPerServices.Add(objAdditionalFollowUpInfoPerServices);
            }

            return lstAdditionalFollowUpInfoPerServices;
        }
        public int InsertAdditionalFollowUp(AdditionalFollowUpInfoPerServices objAdditionalFollowUpInfoPerServices)
        {
            objAdditionalFollowUpInfoPerServices.AdditionalFollowUpInfoPerServiceID = 1;
            BeginTransaction();

            try
            {
                objAdditionalFollowUpInfoPerServices.AdditionalFollowUpInfoPerServiceID = Insert(objAdditionalFollowUpInfoPerServices);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objAdditionalFollowUpInfoPerServices.AdditionalFollowUpInfoPerServiceID = -1;
            }

            return objAdditionalFollowUpInfoPerServices.AdditionalFollowUpInfoPerServiceID;
        }
        public int UpdateAdditionalFollowUp(AdditionalFollowUpInfoPerServices objAdditionalFollowUpInfoPerServices)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "AdditionalFollowupInfoID"};
                rowsaffected = Update(objAdditionalFollowUpInfoPerServices, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
        // POST api/additionalfollowupinfoperservice
        public AdditionalFollowUpInfoPerServices Post(AdditionalFollowUpInfoPerServices AdditionalFollowUpInfoPerServices)
        {
            if (AdditionalFollowUpInfoPerServices.GUID> 0)
            {
                AdditionalFollowUpInfoPerServices.SyncStatus = 1;
                AdditionalFollowUpInfoPerServices.AdditionalFollowUpInfoPerServiceID = AdditionalFollowUpInfoPerServices.GUID;
                int rowResult = AdditionalFollowUpInfoPerServiceBO.UpdateAdditionalFollowUp(AdditionalFollowUpInfoPerServices);

                //Return Back to The Client               
                return AdditionalFollowUpInfoPerServices;
            }
            else
            {

                AdditionalFollowUpInfoPerServices.SyncStatus = 1;
                int rowResult = AdditionalFollowUpInfoPerServiceBO.InsertAdditionalFollowUp(AdditionalFollowUpInfoPerServices);
                AdditionalFollowUpInfoPerServices.AdditionalFollowUpInfoPerServiceID = rowResult;
                //Return Back to The Client               
                return AdditionalFollowUpInfoPerServices;
            }
        }
        public static AdditionalFollowUpInfoPerServices GetAdditionalFollowUpInfoPerServices(int AdditionalFollowUpInfoPerServiceID)
        {
            AdditionalFollowUpInfoPerServices objFollowUpPerServicesID = new AdditionalFollowUpInfoPerServices();
            return (AdditionalFollowUpInfoPerServices)(new AdditionalFollowUpInfoPerServiceDAO().FillDTO(objFollowUpPerServicesID, "AdditionalFollowUpInfoPerServiceID=" + AdditionalFollowUpInfoPerServiceID));

        }
        public static AdditionalFollowUpInfoPerServices GetAdditionalFollowUpInfoPerService(int ServiceProvidedPerSaMIID)
        {
            AdditionalFollowUpInfoPerServices objFollowUpPerServicesID = new AdditionalFollowUpInfoPerServices();
            return (AdditionalFollowUpInfoPerServices)(new AdditionalFollowUpInfoPerServiceDAO().FillDTO(objFollowUpPerServicesID, "ServiceProvidedPerSaMIID=" + ServiceProvidedPerSaMIID));

        }
 public static int UpdateAdditionalFollowUp(AdditionalFollowUpInfoPerServices objAdditionalFollowUpInfoPerServices)
 {
     return new AdditionalFollowUpInfoPerServiceDAO().UpdateAdditionalFollowUp(objAdditionalFollowUpInfoPerServices);
 }
 public static int InsertAdditionalFollowUp(AdditionalFollowUpInfoPerServices objAdditionalFollowUpInfoPerServices)
 {
     return new AdditionalFollowUpInfoPerServiceDAO().InsertAdditionalFollowUp(objAdditionalFollowUpInfoPerServices);
 }
示例#10
0
        List<AdditionalFollowUpInfoPerServices> MapAdditionalFollowupInfoList()
        {
            //Additional Info
            List<AdditionalFollowUpInfoPerServices> lstAdditionalFollowUpInfoPerServices = new List<AdditionalFollowUpInfoPerServices>();

            if (rbAdditionalInfoYes.Checked)
            {
                for (int j = 0; j < cblAdditionalDocument.Items.Count; j++)
                {
                    if (cblAdditionalDocument.Items[j].Selected == true)
                    {
                        AdditionalFollowUpInfoPerServices objAdditionalFollowUpInfoPerServices = new AdditionalFollowUpInfoPerServices();
                        objAdditionalFollowUpInfoPerServices.AdditionalFollowupInfoID = Convert.ToInt32(cblAdditionalDocument.Items[j].Value);
                        lstAdditionalFollowUpInfoPerServices.Add(objAdditionalFollowUpInfoPerServices);
                    }
                }
            }

            return lstAdditionalFollowUpInfoPerServices;
        }