예제 #1
0
        public string retcardData1(int associateID, string inUserName)
        {
            DllPurchaseCategory hh = new DllPurchaseCategory();
            int x = hh.RetrieveCardByAssociateID(associateID, inUserName);

            if (x == 0)
            {
                SqlCommand cmd = new SqlCommand("proc_RetrieveCardDataByAssociateID", objCon.Con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@AssociateId", associateID);
                SqlDataAdapter adpt = new SqlDataAdapter();
                DataSet        ds   = new DataSet();
                if (objCon.Con.State == ConnectionState.Open)
                {
                }
                else
                {
                    objCon.Con.Open();
                }
                cmd.Connection     = objCon.Con;
                adpt.SelectCommand = cmd;
                adpt.Fill(ds, "GtCardDetail");
                objCon.Con.Close();
                return(ds.GetXml());
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        public DataTable retcardData(int associateID, string inUserName)
        {
            DllPurchaseCategory hh = new DllPurchaseCategory();
            // hh.RetrieveCardByAssociateID(associateID).Wait();
            int x = hh.RetrieveCardByAssociateID(associateID, inUserName);

            if (x == 0)
            {
                SqlCommand cmd = new SqlCommand("proc_RetrieveCardDataByAssociateID", objCon.Con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@AssociateId", associateID);
                if (objCon.Con.State == ConnectionState.Open)
                {
                }
                else
                {
                    objCon.Con.Open();
                }
                SqlDataReader dr = cmd.ExecuteReader();
                DataTable     dt = new DataTable();
                dt.Load(dr);
                objCon.Con.Close();
                return(dt);
            }
            else
            {
                return(null);
            }
        }