public long SaveOrUpdateDiscrepancyMasterDetails(DiscrepancyMaster dm)
 {
     try
     {
         mbc.SaveOrUpdateDiscrepancyMasterDetails(dm);
         return(dm.Id);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally { }
 }
        public long GetDeleteDiscrepancyMasterById(DiscrepancyMaster dm)
        {
            try
            {
                if (dm.Id > 0)
                {
                    mbc.GetDeleteDiscrepancyrowById(dm);
                    return(dm.Id);
                }

                return(0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally { }
        }
 public long GetDeleteDiscrepancyrowById(DiscrepancyMaster dm)
 {
     try
     {
         if (dm != null)
         {
             PSF.Delete <DiscrepancyMaster>(dm);
         }
         else
         {
             throw new Exception("Value is required and it cannot be null..");
         }
         return(0);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public long SaveOrUpdateDiscrepancyMasterDetails(DiscrepancyMaster dm)
 {
     try
     {
         if (dm != null)
         {
             PSF.SaveOrUpdate <DiscrepancyMaster>(dm);
         }
         else
         {
             throw new Exception("All Fields are required and it cannot be null..");
         }
         return(dm.Id);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public DiscrepancyMaster GetDiscrepancyDetailsById(long Id)
        {
            try
            {
                DiscrepancyMaster DiscrepancyDetails = null;

                if (Id > 0)
                {
                    DiscrepancyDetails = PSF.Get <DiscrepancyMaster>(Id);
                }
                else
                {
                    throw new Exception("Id is required and it cannot be 0");
                }
                return(DiscrepancyDetails);
            }
            catch (Exception)
            {
                throw;
            }
        }