//New Payment Table Design Test API public int CustomerInsertPaymentDetilsInfo_New(PaymentInsertML Mobj, string spName) { int IntStatus = 0; DataSet dsPaymentDetails = new DataSet(); int? Istatus = null; int? inull = null; List <Smtpemailsending> li = new List <Smtpemailsending>(); SqlDataAdapter daPaymentDetails = new SqlDataAdapter(); SqlConnection connection = new SqlConnection(); connection = SQLHelper.GetSQLConnection(); connection.Open(); try { SqlCommand cmd = new SqlCommand(spName, connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@dtPaymentDetails", Mobj.dtPaymentDetails); cmd.Parameters.AddWithValue("@PaysmsID", Mobj.PaysmsID); SqlParameter outputParamStatus = cmd.Parameters.Add("@Status", SqlDbType.Int); outputParamStatus.Direction = ParameterDirection.Output; SqlParameter outputParamErrorLog = cmd.Parameters.Add("@ErrorMsg", SqlDbType.VarChar, 1000); outputParamErrorLog.Direction = ParameterDirection.Output; daPaymentDetails.SelectCommand = cmd; daPaymentDetails.Fill(dsPaymentDetails); if (dsPaymentDetails != null && dsPaymentDetails.Tables.Count > 0 && dsPaymentDetails != null) { for (int i = 0; i < dsPaymentDetails.Tables[0].Rows.Count; i++) { Smtpemailsending smtp = new Smtpemailsending(); { smtp.profile_name = dsPaymentDetails.Tables[0].Columns.Contains("profile_name") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["profile_name"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["profile_name"].ToString() : string.Empty; smtp.recipients = dsPaymentDetails.Tables[0].Columns.Contains("recipients") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["recipients"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["recipients"].ToString() : string.Empty; smtp.body = dsPaymentDetails.Tables[0].Columns.Contains("body") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["body"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["body"].ToString() : string.Empty; smtp.subject = dsPaymentDetails.Tables[0].Columns.Contains("subject") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["subject"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["subject"].ToString() : string.Empty; smtp.body_format = dsPaymentDetails.Tables[0].Columns.Contains("body_format") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["body_format"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["body_format"].ToString() : string.Empty; Istatus = smtp.Status = dsPaymentDetails.Tables[0].Columns.Contains("Status") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["Status"].ToString()) ? Convert.ToInt32(dsPaymentDetails.Tables[0].Rows[i]["Status"]) : inull; } li.Add(smtp); } IntStatus = (Istatus != null && Istatus != 0) ? 1 : 0; if (Mobj.PaysmsID == 1) { Commonclass.SendMailSmtpMethod(li, "info"); Commonclass.PaymentinsertSMS(dsPaymentDetails, Mobj); } } else { if (Convert.ToInt32(cmd.Parameters[0].Value) == 1) { IntStatus = 1; } else { IntStatus = 0; } } } catch (Exception EX) { Commonclass.ApplicationErrorLog(spName, Convert.ToString(EX.Message), null, null, null); } finally { connection.Close(); } if (dsPaymentDetails.Tables.Count == 0) { dsPaymentDetails = null; } return(IntStatus); }