コード例 #1
0
ファイル: Service.cs プロジェクト: 23095502/RFPRest
    public GetCustomer[] GetCustomers(int _CUSTOMERID, string _CUSTOMERCODE, string _CUSTOMERNAME, string _ADDRESS, string _EMAIL, string _CONTACTPERSON, string _CONTACTNO,
                                      string _ACTIVE, int _CREATEDBY, string _CREATEDON, string _MODE)
    {
        List <GetCustomer> returnObj = new List <GetCustomer>();

        using (BLCustomer obj = new BLCustomer())
        {
            //============
            obj._CUSTOMERID    = _CUSTOMERID;
            obj._CUSTOMERCODE  = _CUSTOMERCODE;
            obj._CUSTOMERNAME  = _CUSTOMERNAME;
            obj._ADDRESS       = _ADDRESS;
            obj._EMAIL         = _EMAIL;
            obj._CONTACTPERSON = _CONTACTPERSON;
            obj._CONTACTNO     = _CONTACTNO;
            obj._ACTIVE        = _ACTIVE;
            obj._CREATEDBY     = _CREATEDBY;
            obj._CREATEDON     = _CREATEDON;
            obj._MODE          = _MODE;
            //============
            DataSet ds = obj.GetCustomers();
            //============
            foreach (DataRow item in ds.Tables[0].Rows)
            {
                returnObj.Add(new GetCustomer()
                {
                    CUSTOMERID    = Convert.ToInt32(item["CUSTOMERID"]),
                    CUSTOMERCODE  = Convert.ToString(item["CUSTOMERCODE"]),
                    CUSTOMERNAME  = Convert.ToString(item["CUSTOMERNAME"]),
                    ADDRESS       = Convert.ToString(item["ADDRESS"]),
                    CONTACTPERSON = Convert.ToString(item["CONTACTPERSON"]),
                    CONTACTNO     = Convert.ToString(item["CONTACTNO"]),
                    EMAIL         = Convert.ToString(item["EMAIL"]),
                    ACTIVE        = Convert.ToString(item["ACTIVE"]),
                });
            }
        }
        return(returnObj.ToArray());
    }