Ejemplo n.º 1
0
        private SalesTransactionDetails setSalesTransactionDetails(GLAOrderTenderDetails glaDetails, SalesTransactionDetails mclsSalesTransactionDetails)
        {

            // for update
            
            //mclsSalesTransactionDetails.CustomerID = glaDetails.fk_emp_def;
            //mclsSalesTransactionDetails.AgentID = Constants.C_RETAILPLUS_AGENTID;
            //mclsSalesTransactionDetails.AgentName = Constants.C_RETAILPLUS_AGENT;
            //mclsSalesTransactionDetails.AgentPositionName = Constants.C_RETAILPLUS_AGENT_POSITIONNAME;
            //mclsSalesTransactionDetails.AgentDepartmentName = Constants.C_RETAILPLUS_AGENT_DEPARTMENT_NAME;
            //mclsSalesTransactionDetails.WaiterID = Constants.C_RETAILPLUS_WAITERID;
            //mclsSalesTransactionDetails.WaiterName = Constants.C_RETAILPLUS_WAITER;
            //mclsSalesTransactionDetails.CreatedByID = glaDetails.fk_emp_def;
            //mclsSalesTransactionDetails.CreatedByName = Constants.C_RETAILPLUS_WAITER;
            //mclsSalesTransactionDetails.CashierID = glaDetails.fk_emp_def;
            //mclsSalesTransactionDetails.CashierName = glaDetails.Filename;
            //mclsSalesTransactionDetails.CustomerID = Constants.C_RETAILPLUS_CUSTOMERID;
            //mclsSalesTransactionDetails.CustomerName = Constants.C_RETAILPLUS_CUSTOMER;
            //mclsSalesTransactionDetails.TransactionDate = glaDetails.Chk_Open_Date_Time;
            //mclsSalesTransactionDetails.DateSuspended = Constants.C_DATE_MIN_VALUE;
            //mclsSalesTransactionDetails.TerminalNo = Constants.C_DEFAULT_TERMINAL_01;
            //mclsSalesTransactionDetails.BranchID = Constants.BRANCH_ID_MAIN;
            //mclsSalesTransactionDetails.BranchCode = Constants.BRANCH_MAIN;
            //mclsSalesTransactionDetails.TransactionStatus = TransactionStatus.Closed;
            //mclsSalesTransactionDetails.TransactionType = TransactionTypes.POSNormal;
            //mclsSalesTransactionDetails.TransactionNo = glaDetails.chk_headers_seq_number.ToString();

            ////for update
            //mclsSalesTransactionDetails.Charge = glaDetails.Auto_Svc_Ttl + glaDetails.Other_Svc_Ttl + glaDetails.Tip_ttl;
            //mclsSalesTransactionDetails.Discount = -glaDetails.Dsc_Ttl;
            //mclsSalesTransactionDetails.AmountDue = glaDetails.Sub_Ttl + glaDetails.Tax_Ttl + mclsSalesTransactionDetails.Charge - mclsSalesTransactionDetails.Discount;
            //mclsSalesTransactionDetails.SubTotal = glaDetails.Sub_Ttl + glaDetails.Tax_Ttl + mclsSalesTransactionDetails.Charge;

            //mclsSalesTransactionDetails.DiscountableAmount = mclsSalesTransactionDetails.Discount <= 0 ? 0 : glaDetails.Dsc_Ttl;
            //mclsSalesTransactionDetails.ItemsDiscount = 0;
            //mclsSalesTransactionDetails.VAT = glaDetails.Tax_Ttl;
            //mclsSalesTransactionDetails.VatableAmount = glaDetails.Sub_Ttl + glaDetails.Tax_Ttl;
            //mclsSalesTransactionDetails.NonVATableAmount = 0;
            //mclsSalesTransactionDetails.EVAT = 0;
            //mclsSalesTransactionDetails.EVatableAmount = 0;
            //mclsSalesTransactionDetails.NonEVATableAmount = glaDetails.Sub_Ttl + glaDetails.Tax_Ttl;
            //mclsSalesTransactionDetails.LocalTax = 0;
            //mclsSalesTransactionDetails.TotalItemSold = glaDetails.Cov_Cnt;
            //mclsSalesTransactionDetails.TotalQuantitySold = glaDetails.Num_Dtl;

            //mclsSalesTransactionDetails.AmountPaid = glaDetails.Pymnt_Ttl;
            //mclsSalesTransactionDetails.CashPayment = mclsSalesTransactionDetails.SubTotal;
            //mclsSalesTransactionDetails.ChangeAmount = glaDetails.Pymnt_Ttl;
            //mclsSalesTransactionDetails.ChequePayment = 0;
            //mclsSalesTransactionDetails.CreditCardPayment = 0;
            //mclsSalesTransactionDetails.CreditPayment = 0;
            //mclsSalesTransactionDetails.CreditChargeAmount = 0;
            //mclsSalesTransactionDetails.DebitPayment = 0;
            //mclsSalesTransactionDetails.RewardPointsPayment = 0;
            //mclsSalesTransactionDetails.DateClosed = glaDetails.Chk_Closed_Date_Time;
            //mclsSalesTransactionDetails.DateResumed = glaDetails.DateCreated;
            //mclsSalesTransactionDetails.DataSource = glaDetails.BatchID;

            return mclsSalesTransactionDetails;
        }
Ejemplo n.º 2
0
        public Int64 Insert(GLAOrderTenderDetails Details)
		{
			try  
			{
                string SQL = "INSERT INTO tblgla_order_tender (" +
                                    "identifier," +
                                    "order_hdr_id," +
                                    "tender_seq," +
                                    "tender_id," +
                                    "tender_amt," +
                                    "prorata_sales_amt_gross," +
                                    "prorata_discount_amt," +
                                    "prorata_tax_amt," +
                                    "prorata_grat_amt," +
                                    "prorata_svc_chg_amt," +
                                    "tip_amt," +
                                    "breakage_amt," +
                                    "received_curr_amt," +
                                    "curr_decimal_places," +
                                    "exchange_rate," +
                                    "change_amt," +
                                    "change_tender_id," +
                                    "tax_removed_code," +
                                    "tender_type_id," +
                                    "subtender_id," +
                                    "auth_acct_no," +
                                    "post_acct_no," +
                                    "customer_name," +
                                    "adtnl_info," +
                                    "subtender_qty," +
                                    "charges_to_date_amt," +
                                    "remaining_balance_amt," +
                                    "PMS_post_flag," +
                                    "sales_tippable_flag," +
                                    "post_system1_flag," +
                                    "post_system2_flag," +
                                    "post_system3_flag," +
                                    "post_system4_flag," +
                                    "post_system5_flag," +
                                    "post_system6_flag," +
                                    "post_system7_flag," +
                                    "DateCreated," +
                                    "CreatedBy," +
                                    "Filename," +
                                    "BatchID" +
								") VALUES (" +
                                    "@identifier," +
                                    "@order_hdr_id," +
                                    "@tender_seq," +
                                    "@tender_id," +
                                    "@tender_amt," +
                                    "@prorata_sales_amt_gross," +
                                    "@prorata_discount_amt," +
                                    "@prorata_tax_amt," +
                                    "@prorata_grat_amt," +
                                    "@prorata_svc_chg_amt," +
                                    "@tip_amt," +
                                    "@breakage_amt," +
                                    "@received_curr_amt," +
                                    "@curr_decimal_places," +
                                    "@exchange_rate," +
                                    "@change_amt," +
                                    "@change_tender_id," +
                                    "@tax_removed_code," +
                                    "@tender_type_id," +
                                    "@subtender_id," +
                                    "@auth_acct_no," +
                                    "@post_acct_no," +
                                    "@customer_name," +
                                    "@adtnl_info," +
                                    "@subtender_qty," +
                                    "@charges_to_date_amt," +
                                    "@remaining_balance_amt," +
                                    "@PMS_post_flag," +
                                    "@sales_tippable_flag," +
                                    "@post_system1_flag," +
                                    "@post_system2_flag," +
                                    "@post_system3_flag," +
                                    "@post_system4_flag," +
                                    "@post_system5_flag," +
                                    "@post_system6_flag," +
                                    "@post_system7_flag," +
                                    "@DateCreated," +
                                    "@CreatedBy," +
                                    "@Filename," +
                                    "@BatchID);";
	 			
				MySqlCommand cmd = new MySqlCommand();
				cmd.CommandType = System.Data.CommandType.Text;
				cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@identifier", Details.identifier);
                cmd.Parameters.AddWithValue("@order_hdr_id", Details.order_hdr_id);
                cmd.Parameters.AddWithValue("@tender_seq", Details.tender_seq);
                cmd.Parameters.AddWithValue("@tender_id", Details.tender_id);
                cmd.Parameters.AddWithValue("@tender_amt", Details.tender_amt);
                cmd.Parameters.AddWithValue("@prorata_sales_amt_gross", Details.prorata_sales_amt_gross);
                cmd.Parameters.AddWithValue("@prorata_discount_amt", Details.prorata_discount_amt);
                cmd.Parameters.AddWithValue("@prorata_tax_amt", Details.prorata_tax_amt);
                cmd.Parameters.AddWithValue("@prorata_grat_amt", Details.prorata_grat_amt);
                cmd.Parameters.AddWithValue("@prorata_svc_chg_amt", Details.prorata_svc_chg_amt);
                cmd.Parameters.AddWithValue("@tip_amt", Details.tip_amt);
                cmd.Parameters.AddWithValue("@breakage_amt", Details.breakage_amt);
                cmd.Parameters.AddWithValue("@received_curr_amt", Details.received_curr_amt);
                cmd.Parameters.AddWithValue("@curr_decimal_places", Details.curr_decimal_places);
                cmd.Parameters.AddWithValue("@exchange_rate", Details.exchange_rate);
                cmd.Parameters.AddWithValue("@change_amt", Details.change_amt);
                cmd.Parameters.AddWithValue("@change_tender_id", Details.change_tender_id);
                cmd.Parameters.AddWithValue("@tax_removed_code", Details.tax_removed_code);
                cmd.Parameters.AddWithValue("@tender_type_id", Details.tender_type_id);
                cmd.Parameters.AddWithValue("@subtender_id", Details.subtender_id);
                cmd.Parameters.AddWithValue("@auth_acct_no", Details.auth_acct_no);
                cmd.Parameters.AddWithValue("@post_acct_no", Details.post_acct_no);
                cmd.Parameters.AddWithValue("@customer_name", Details.customer_name);
                cmd.Parameters.AddWithValue("@adtnl_info", Details.adtnl_info);
                cmd.Parameters.AddWithValue("@subtender_qty", Details.subtender_qty);
                cmd.Parameters.AddWithValue("@charges_to_date_amt", Details.charges_to_date_amt);
                cmd.Parameters.AddWithValue("@remaining_balance_amt", Details.remaining_balance_amt);
                cmd.Parameters.AddWithValue("@PMS_post_flag", Details.PMS_post_flag);
                cmd.Parameters.AddWithValue("@sales_tippable_flag", Details.sales_tippable_flag);
                cmd.Parameters.AddWithValue("@post_system1_flag", Details.post_system1_flag);
                cmd.Parameters.AddWithValue("@post_system2_flag", Details.post_system2_flag);
                cmd.Parameters.AddWithValue("@post_system3_flag", Details.post_system3_flag);
                cmd.Parameters.AddWithValue("@post_system4_flag", Details.post_system4_flag);
                cmd.Parameters.AddWithValue("@post_system5_flag", Details.post_system5_flag);
                cmd.Parameters.AddWithValue("@post_system6_flag", Details.post_system6_flag);
                cmd.Parameters.AddWithValue("@post_system7_flag", Details.post_system7_flag);
                cmd.Parameters.AddWithValue("@DateCreated", Details.DateCreated);
                cmd.Parameters.AddWithValue("@CreatedBy", Details.CreatedBy);
                cmd.Parameters.AddWithValue("@Filename", Details.Filename);
                cmd.Parameters.AddWithValue("@BatchID", Details.BatchID);

				base.ExecuteNonQuery(cmd);

				SQL = "SELECT LAST_INSERT_ID();";
				
				cmd.Parameters.Clear(); 
				cmd.CommandText = SQL;

                System.Data.DataTable dt = new System.Data.DataTable("LAST_INSERT_ID");
                base.MySqlDataAdapterFill(cmd, dt);
                
                Int64 iID = 0;
                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    iID = Int64.Parse(dr[0].ToString());
                }

				return iID;
			}

			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}
Ejemplo n.º 3
0
        private GLAOrderTenderDetails setOrderTenderDetails(string line, DateTime DateCreated, string CreatedBy, string filename, string BatchID)
        {
            DateTime dteRetvalue = Constants.C_DATE_MIN_VALUE;
            long lngRetValue = 0;
            int intRetValue = 0;
            decimal decRetValue = 0;
            GLAOrderTenderDetails clsDetails = new GLAOrderTenderDetails();

            int iCol = 0;
            int iColText = 0;
            foreach (string colText in line.Split('"'))
            {
                switch (iColText)
                {
                    case 0: break;
                    case 1: clsDetails.identifier = colText; break;
                    case 2:
                        iCol = 0;
                        foreach (string col in colText.Split(','))
                        {
                            dteRetvalue = Constants.C_DATE_MIN_VALUE;
                            intRetValue = 0;

                            string col2 = col.Replace("$", "").Trim();
                            switch (iCol)
                            {
                                case 0: break;
                                case 1: clsDetails.order_hdr_id = long.TryParse(col2, out lngRetValue) ? lngRetValue : 0; break;
                                case 2: clsDetails.tender_seq = long.TryParse(col2, out lngRetValue) ? lngRetValue : 0; break;
                                case 3: clsDetails.tender_id = long.TryParse(col2, out lngRetValue) ? lngRetValue : 0; break;
                                case 4: clsDetails.tender_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 5: clsDetails.prorata_sales_amt_gross = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 6: clsDetails.prorata_discount_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 7: clsDetails.prorata_tax_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 8: clsDetails.prorata_grat_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 9: clsDetails.prorata_svc_chg_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 10: clsDetails.tip_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 11: clsDetails.breakage_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 12: clsDetails.received_curr_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 13: clsDetails.curr_decimal_places = int.TryParse(col2, out intRetValue) ? intRetValue : 0; break;
                                case 14: clsDetails.exchange_rate = int.TryParse(col2, out intRetValue) ? intRetValue : 0; break;
                                case 15: clsDetails.change_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 16: clsDetails.change_tender_id = int.TryParse(col2, out intRetValue) ? intRetValue : 0; break;
                                case 17: clsDetails.tax_removed_code = int.TryParse(col2, out intRetValue) ? intRetValue : 0; break;
                                case 18: clsDetails.tender_type_id = int.TryParse(col2, out intRetValue) ? intRetValue : 0; break;
                                case 19: clsDetails.subtender_id = int.TryParse(col2, out intRetValue) ? intRetValue : 0; break;
                                
                            }
                            iCol++;
                        }
                        break;
                    case 3: clsDetails.auth_acct_no = colText; break;
                    case 4: break;
                    case 5: clsDetails.post_acct_no = colText; break;
                    case 6: break;
                    case 7: clsDetails.customer_name = colText; break;
                    case 8:
                        iCol = 0;
                        foreach (string col in colText.Split(','))
                        {
                            dteRetvalue = Constants.C_DATE_MIN_VALUE;
                            intRetValue = 0;

                            string col2 = col.Replace("$", "").Trim();
                            switch (iCol)
                            {
                                case 0: break;
                                case 1: break;
                                case 2: clsDetails.adtnl_info = col2; break;
                                case 3: clsDetails.subtender_qty = int.TryParse(col2, out intRetValue) ? intRetValue : 0; break;
                                case 4: clsDetails.charges_to_date_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 5: clsDetails.remaining_balance_amt = decimal.TryParse(col2, out decRetValue) ? decRetValue : 0; break;
                                case 6: clsDetails.PMS_post_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 7: clsDetails.sales_tippable_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 8: clsDetails.post_system1_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 9: clsDetails.post_system2_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 10: clsDetails.post_system3_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 11: clsDetails.post_system4_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 12: clsDetails.post_system5_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 13: clsDetails.post_system6_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 14: clsDetails.post_system7_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                                case 15: clsDetails.post_system8_flag = Convert.ToBoolean(int.TryParse(col2, out intRetValue) ? intRetValue : 0); break;
                            }
                            iCol++;
                        }
                        break;
                }
                iColText++;
            }

            clsDetails.DateCreated = DateCreated;
            clsDetails.CreatedBy = CreatedBy;
            clsDetails.Filename = filename;
            clsDetails.BatchID = BatchID;

            return clsDetails;
        }
Ejemplo n.º 4
0
        public Int64 Insert(GLAOrderTenderDetails Details)
        {
            try
            {
                string SQL = "INSERT INTO tblgla_order_tender (" +
                             "identifier," +
                             "order_hdr_id," +
                             "tender_seq," +
                             "tender_id," +
                             "tender_amt," +
                             "prorata_sales_amt_gross," +
                             "prorata_discount_amt," +
                             "prorata_tax_amt," +
                             "prorata_grat_amt," +
                             "prorata_svc_chg_amt," +
                             "tip_amt," +
                             "breakage_amt," +
                             "received_curr_amt," +
                             "curr_decimal_places," +
                             "exchange_rate," +
                             "change_amt," +
                             "change_tender_id," +
                             "tax_removed_code," +
                             "tender_type_id," +
                             "subtender_id," +
                             "auth_acct_no," +
                             "post_acct_no," +
                             "customer_name," +
                             "adtnl_info," +
                             "subtender_qty," +
                             "charges_to_date_amt," +
                             "remaining_balance_amt," +
                             "PMS_post_flag," +
                             "sales_tippable_flag," +
                             "post_system1_flag," +
                             "post_system2_flag," +
                             "post_system3_flag," +
                             "post_system4_flag," +
                             "post_system5_flag," +
                             "post_system6_flag," +
                             "post_system7_flag," +
                             "DateCreated," +
                             "CreatedBy," +
                             "Filename," +
                             "BatchID" +
                             ") VALUES (" +
                             "@identifier," +
                             "@order_hdr_id," +
                             "@tender_seq," +
                             "@tender_id," +
                             "@tender_amt," +
                             "@prorata_sales_amt_gross," +
                             "@prorata_discount_amt," +
                             "@prorata_tax_amt," +
                             "@prorata_grat_amt," +
                             "@prorata_svc_chg_amt," +
                             "@tip_amt," +
                             "@breakage_amt," +
                             "@received_curr_amt," +
                             "@curr_decimal_places," +
                             "@exchange_rate," +
                             "@change_amt," +
                             "@change_tender_id," +
                             "@tax_removed_code," +
                             "@tender_type_id," +
                             "@subtender_id," +
                             "@auth_acct_no," +
                             "@post_acct_no," +
                             "@customer_name," +
                             "@adtnl_info," +
                             "@subtender_qty," +
                             "@charges_to_date_amt," +
                             "@remaining_balance_amt," +
                             "@PMS_post_flag," +
                             "@sales_tippable_flag," +
                             "@post_system1_flag," +
                             "@post_system2_flag," +
                             "@post_system3_flag," +
                             "@post_system4_flag," +
                             "@post_system5_flag," +
                             "@post_system6_flag," +
                             "@post_system7_flag," +
                             "@DateCreated," +
                             "@CreatedBy," +
                             "@Filename," +
                             "@BatchID);";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@identifier", Details.identifier);
                cmd.Parameters.AddWithValue("@order_hdr_id", Details.order_hdr_id);
                cmd.Parameters.AddWithValue("@tender_seq", Details.tender_seq);
                cmd.Parameters.AddWithValue("@tender_id", Details.tender_id);
                cmd.Parameters.AddWithValue("@tender_amt", Details.tender_amt);
                cmd.Parameters.AddWithValue("@prorata_sales_amt_gross", Details.prorata_sales_amt_gross);
                cmd.Parameters.AddWithValue("@prorata_discount_amt", Details.prorata_discount_amt);
                cmd.Parameters.AddWithValue("@prorata_tax_amt", Details.prorata_tax_amt);
                cmd.Parameters.AddWithValue("@prorata_grat_amt", Details.prorata_grat_amt);
                cmd.Parameters.AddWithValue("@prorata_svc_chg_amt", Details.prorata_svc_chg_amt);
                cmd.Parameters.AddWithValue("@tip_amt", Details.tip_amt);
                cmd.Parameters.AddWithValue("@breakage_amt", Details.breakage_amt);
                cmd.Parameters.AddWithValue("@received_curr_amt", Details.received_curr_amt);
                cmd.Parameters.AddWithValue("@curr_decimal_places", Details.curr_decimal_places);
                cmd.Parameters.AddWithValue("@exchange_rate", Details.exchange_rate);
                cmd.Parameters.AddWithValue("@change_amt", Details.change_amt);
                cmd.Parameters.AddWithValue("@change_tender_id", Details.change_tender_id);
                cmd.Parameters.AddWithValue("@tax_removed_code", Details.tax_removed_code);
                cmd.Parameters.AddWithValue("@tender_type_id", Details.tender_type_id);
                cmd.Parameters.AddWithValue("@subtender_id", Details.subtender_id);
                cmd.Parameters.AddWithValue("@auth_acct_no", Details.auth_acct_no);
                cmd.Parameters.AddWithValue("@post_acct_no", Details.post_acct_no);
                cmd.Parameters.AddWithValue("@customer_name", Details.customer_name);
                cmd.Parameters.AddWithValue("@adtnl_info", Details.adtnl_info);
                cmd.Parameters.AddWithValue("@subtender_qty", Details.subtender_qty);
                cmd.Parameters.AddWithValue("@charges_to_date_amt", Details.charges_to_date_amt);
                cmd.Parameters.AddWithValue("@remaining_balance_amt", Details.remaining_balance_amt);
                cmd.Parameters.AddWithValue("@PMS_post_flag", Details.PMS_post_flag);
                cmd.Parameters.AddWithValue("@sales_tippable_flag", Details.sales_tippable_flag);
                cmd.Parameters.AddWithValue("@post_system1_flag", Details.post_system1_flag);
                cmd.Parameters.AddWithValue("@post_system2_flag", Details.post_system2_flag);
                cmd.Parameters.AddWithValue("@post_system3_flag", Details.post_system3_flag);
                cmd.Parameters.AddWithValue("@post_system4_flag", Details.post_system4_flag);
                cmd.Parameters.AddWithValue("@post_system5_flag", Details.post_system5_flag);
                cmd.Parameters.AddWithValue("@post_system6_flag", Details.post_system6_flag);
                cmd.Parameters.AddWithValue("@post_system7_flag", Details.post_system7_flag);
                cmd.Parameters.AddWithValue("@DateCreated", Details.DateCreated);
                cmd.Parameters.AddWithValue("@CreatedBy", Details.CreatedBy);
                cmd.Parameters.AddWithValue("@Filename", Details.Filename);
                cmd.Parameters.AddWithValue("@BatchID", Details.BatchID);

                base.ExecuteNonQuery(cmd);

                SQL = "SELECT LAST_INSERT_ID();";

                cmd.Parameters.Clear();
                cmd.CommandText = SQL;

                System.Data.DataTable dt = new System.Data.DataTable("LAST_INSERT_ID");
                base.MySqlDataAdapterFill(cmd, dt);

                Int64 iID = 0;
                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    iID = Int64.Parse(dr[0].ToString());
                }

                return(iID);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }