public void PaymentSaveRecord(Remit_Con_Log remit_con_logrepo)
        {
            try
            {
                //Get Connection
                DynamicParameters param = new DynamicParameters();

                param.Add(name: "P_ES_ID", value: remit_con_logrepo.ES_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_ACTUAL_RECEIPT_DATE", value: GlobalValue.Scheme_Today_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add(name: "P_MAKER_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_MAKE_DATE", value: GlobalValue.Scheme_Today_Date, dbType: DbType.Date, direction: ParameterDirection.Input);

                db.GetConnection().Execute("MIGRATE_REMIT_RECEIPT", param, commandType: CommandType.StoredProcedure);
                // return this.ES_Id;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                {
                    db.Dispose();
                }
            }
        }
        public string Create_Con_Log(Remit_Con_Log remitconlog)
        {
            try
            {
                ////////////////////////////////////////////////
                if (remitconlog.For_Month.ToString().Length == 1)
                {
                    clog = "0" + remitconlog.For_Month;
                }
                else
                {
                    clog = remitconlog.For_Month.ToString();
                }
                ///////////////////////////////////////////////////

                ///create log for the upload Remit Log
                var    paramb  = new DynamicParameters();
                string batchno = "";
                paramb.Add(name: "p_Con_Log_Id ", value: remitconlog.Con_Log_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_Employer_Id", value: remitconlog.Employer_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_ES_Id", value: remitconlog.ES_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_For_Month", value: clog, dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_For_Year", value: remitconlog.For_Year, dbType: DbType.Int32, direction: ParameterDirection.Input);
                paramb.Add(name: "p_DeadLine_Date", value: GlobalValue.Scheme_Today_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                paramb.Add(name: "p_ISINARREAS_YesNo", value: "NO", dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_Unit_Purchased_YesNo", value: "NO", dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_Total_Contribution", value: 0, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                paramb.Add(name: "p_Maker_Id", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_Make_date", value: GlobalValue.Scheme_Today_Date, dbType: DbType.DateTime, direction: ParameterDirection.Input);
                paramb.Add(name: "p_Auth_Status", value: "AUTHORIZED", dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_Log_Status", value: "ACTIVE", dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_GracePeriod", value: 0, dbType: DbType.Int32, direction: ParameterDirection.Input);
                paramb.Add(name: "p_Con_Type", value: "MAIN_CONTRIBUTION", dbType: DbType.String, direction: ParameterDirection.Input);
                paramb.Add(name: "p_BatchNo", value: remitconlog.ES_Id + "01", dbType: DbType.String, direction: ParameterDirection.Input);

                db.GetConnection().Execute(sql: "ADD_MIGRATE_ALL_CON_LOG", param: paramb, commandType: CommandType.StoredProcedure);

                batchno = paramb.Get <string>("p_Con_Log_Id ");
                return(batchno);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                db.Dispose();
            }
        }
        public string PurchaseSaveRecord_BP(Remit_Con_Log remitconlog)
        {
            try
            {
                ////////////////////////////////////////////////
                if (remitconlog.For_Month.ToString().Length == 1)
                {
                    plog = "0" + remitconlog.For_Month;
                }
                else
                {
                    plog = remitconlog.For_Month.ToString();
                }
                ///////////////////////////////////////////////////


                //Get Connection
                DynamicParameters param = new DynamicParameters();

                param.Add(name: "P_PURCHASE_LOG_ID", value: remitconlog.ES_Id + remitconlog.For_Year + plog + "05", dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_CON_LOG_ID", value: remitconlog.Con_Log_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_TRANS_DATE", value: DateTime.Now, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add(name: "P_MAKER_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_MAKE_DATE", value: GlobalValue.Scheme_Today_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add(name: "p_Purchase_Type", value: "BACKPAY-CONTRIBUTION", dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "p_BatchNo", value: remitconlog.ES_Id + "01", dbType: DbType.String, direction: ParameterDirection.Input);

                db.GetConnection().Execute("ADD_MIGRATE_UNIT_PURCHASES10", param, commandType: CommandType.StoredProcedure);
                return(this.Purchase_Log_Id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                {
                    db.Dispose();
                }
            }
        }