Ejemplo n.º 1
0
        public DataTable getPaymentInfoall(BALAgentPayment obj)
        {
            try
            {
                SqlConnection  cn = new SqlConnection(strCon);
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = new SqlCommand("[dbo].[sp_agentPayement]", cn);
                da.SelectCommand.Parameters.Clear();
                da.SelectCommand.Parameters.AddWithValue("@Action", "getPaymentInfoall");


                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                cn.Open();
                da.SelectCommand.ExecuteReader();
                DataTable dtReturnData = new DataTable();
                cn.Close();
                da.Fill(dtReturnData);
                if (dtReturnData != null)
                {
                    return(dtReturnData);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public DataTable AgentInfo(BALAgentPayment obj)
        {
            try
            {
                SqlConnection  cn = new SqlConnection(strCon);
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = new SqlCommand("[dbo].[sp_agentPayement]", cn);
                da.SelectCommand.Parameters.Clear();
                da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action);
                da.SelectCommand.Parameters.AddWithValue("@marketid", obj.MarketId);

                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                cn.Open();
                da.SelectCommand.ExecuteReader();
                DataTable dtReturnData = new DataTable();
                cn.Close();
                da.Fill(dtReturnData);

                if (dtReturnData != null && dtReturnData.Rows.Count > 0)
                {
                    foreach (DataRow row in dtReturnData.Rows)
                    {
                        row["AgentName"]    = DataSecurityManager.Decrypt(row["AgentName"].ToString());
                        row["AgentEmailId"] = DataSecurityManager.Decrypt(row["AgentEmailId"].ToString());
                    }
                }

                if (dtReturnData != null)
                {
                    return(dtReturnData);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception exp)
            {
                return(null);
            }
        }
Ejemplo n.º 3
0
 public int AddpaymentDetails(BALAgentPayment obj)
 {
     try
     {
         SqlConnection  cn = new SqlConnection(strCon);
         SqlDataAdapter da = new SqlDataAdapter();
         da.InsertCommand = new SqlCommand("[dbo].[sp_agentPayement]", cn);
         da.InsertCommand.Parameters.AddWithValue("@Action", obj._Action);
         da.InsertCommand.Parameters.AddWithValue("@firstName", obj._FirstName);
         da.InsertCommand.Parameters.AddWithValue("@lastName", obj._LastName);
         da.InsertCommand.Parameters.AddWithValue("@EmailId", obj._EmailId);
         da.InsertCommand.Parameters.AddWithValue("@Password", obj._Password);
         da.InsertCommand.Parameters.AddWithValue("@AgentCode", obj._AgentCode);
         da.InsertCommand.Parameters.AddWithValue("@billingAddress", obj._BillingAddress);
         da.InsertCommand.Parameters.AddWithValue("@PaymentMethod", obj._PaymentMethod);
         da.InsertCommand.Parameters.AddWithValue("@OnCredit", obj.OnCredit == true ? 1 : 0);
         da.InsertCommand.Parameters.AddWithValue("@CreditLimit", obj.CreditLimit);
         da.InsertCommand.Parameters.AddWithValue("@phoneNumber", obj.Phone);
         da.InsertCommand.Parameters.AddWithValue("@Category", obj._category);
         da.InsertCommand.Parameters.AddWithValue("@country", obj._country);
         da.InsertCommand.Parameters.AddWithValue("@Commision", obj.comission);
         da.InsertCommand.CommandType = CommandType.StoredProcedure;
         cn.Open();
         int Status = da.InsertCommand.ExecuteNonQuery();
         cn.Close();
         if (Status > 0)
         {
             return(Status);
         }
         else
         {
             return(0);
         }
     }
     catch (Exception exp)
     {
         throw exp;
         //return 0;
     }
 }