private bool SavePayHeadDetails(SalaryPackageDetailsSP spSalaryPackageDetails, string jsonDetails, int nSalaryPackageId)
        {
            bool isSave = false;

            try
            {
                List <Dictionary <string, object> > items = JsonConvert.DeserializeObject <List <Dictionary <string, object> > >(jsonDetails);

                for (int i = 0; i < items.Count; i++)
                {
                    SalaryPackageDetailsInfo infoSalaryPackageDetails = new SalaryPackageDetailsInfo();
                    infoSalaryPackageDetails.PayHeadId       = Convert.ToDecimal(items[i]["payHeadId"]);
                    infoSalaryPackageDetails.Amount          = Convert.ToDecimal(items[i]["Amount"]);
                    infoSalaryPackageDetails.Narration       = items[i]["Narration"].ToString();
                    infoSalaryPackageDetails.SalaryPackageId = nSalaryPackageId;
                    infoSalaryPackageDetails.Extra1          = string.Empty;
                    infoSalaryPackageDetails.Extra2          = string.Empty;
                    if (spSalaryPackageDetails.SalaryPackageDetailsAdd(infoSalaryPackageDetails))
                    {
                        isSave = true;
                    }
                    else
                    {
                        isSave = false;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                isSave = false;
            }

            return(isSave);
        }
        /// <summary>
        /// Function to insert values to SalaryPackageDetails Table
        /// </summary>
        /// <param name="salarypackagedetailsinfo"></param>
        /// <returns></returns>
        public bool SalaryPackageDetailsAdd(SalaryPackageDetailsInfo salarypackagedetailsinfo)
        {
            bool isSave = false;

            try
            {
                isSave = spSalaryPackageDetails.SalaryPackageDetailsAdd(salarypackagedetailsinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("AL2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(isSave);
        }