Exemplo n.º 1
0
        public DataSet fillcustomerView()
        {
            objData = new ClsData();
            DataSet dsAIPLData = new DataSet("AIPLData");

            try
            {
                if ((dtResult.Columns.Count == 0))
                {
                    dtResult.Columns.Add("Result");
                    dtResult.Columns.Add("Code");
                    dtResult.Columns.Add("Description");
                    dtResult.Rows.Add();
                }

                dsAIPLData = objData.fillcustomerView();
                if (dsAIPLData != null)
                {
                    dtResult.Rows[0]["Result"]      = "A";
                    dtResult.Rows[0]["Code"]        = "000";
                    dtResult.Rows[0]["Description"] = "Success";
                    dtResult.AcceptChanges();

                    dsAIPLData.Tables.Add(dtResult.Copy());
                    dsAIPLData.Tables[0].TableName = "tblCust";
                }
                else
                {
                    dtResult.Rows[0]["Result"]      = "R";
                    dtResult.Rows[0]["Code"]        = "001";
                    dtResult.Rows[0]["Description"] = "No Data Found";
                    dtResult.AcceptChanges();
                    dsAIPLData = new DataSet();
                    dsAIPLData.Tables.Add(dtResult.Copy());
                }
                return(dsAIPLData);
            }
            catch (Exception ex)
            {
                SendEMail(ErrorMailSendTo, "fillcustomerView", ex.Message.ToString());
                return(null);
            }
        }