//  - To get the GetServiceDetails for Sales History, Check In Page and Service Order with History Page

        public List <SalesHistory> GetServiceDetails(string serialNumber, string userName)
        {
            IAXHelper           axHelper  = ObjectFactory.GetInstance <IAXHelper>();
            List <SalesHistory> salesList = new List <SalesHistory>();
            string salesprice;

            try
            {
                DataTable resultTable = axHelper.GetSalesHistory(serialNumber, userName);


                foreach (DataRow row in resultTable.Rows)
                {
                    SalesHistory salesObject = new SalesHistory();
                    salesObject.SalesServiceOrder = row["ServiceOrderId"].ToString();
                    salesprice             = row["SalesPrice"].ToString();
                    salesprice             = salesprice + ".00";
                    salesObject.SalesPrice = string.Format("{0:c}", salesprice);

                    salesObject.DateExecution = row["DateExecution"].ToString();
                    salesObject.Description   = row["Description"].ToString();
                    salesObject.CustomerName  = row["CustomerName"].ToString();


                    salesList.Add(salesObject);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(salesList);
        }
        //- To get the GetSalesDetails for Sales History

        public List <SalesHistory> GetSalesDetails(string serialNumber, string userName)
        {
            IAXHelper           axHelper  = ObjectFactory.GetInstance <IAXHelper>();
            List <SalesHistory> salesList = new List <SalesHistory>();

            try
            {
                DataTable resultTable = axHelper.GetSalesInformation(serialNumber, userName);


                foreach (DataRow row in resultTable.Rows)
                {
                    SalesHistory salesObject = new SalesHistory();
                    salesObject.SalesOrderNumber  = row["SalesNumber"].ToString();
                    salesObject.InvoiceNumber     = row["InvoiceNumber"].ToString();
                    salesObject.InvoiceDate       = row["InvoiceDate"].ToString();
                    salesObject.CustomerName      = row["Name"].ToString();
                    salesObject.ItemNumber        = row["ItemNumber"].ToString();
                    salesObject.SalesSerialNumber = serialNumber;


                    salesList.Add(salesObject);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(salesList);
        }
示例#3
0
        //  - To get the GetServiceDetails for Sales History, Check In Page and Service Order with History Page
        public List<SalesHistory> GetServiceDetails(string serialNumber, string userName)
        {
            IAXHelper axHelper = ObjectFactory.GetInstance<IAXHelper>();
            List<SalesHistory> salesList = new List<SalesHistory>();
            string salesprice;
            try
            {
                DataTable resultTable = axHelper.GetSalesHistory(serialNumber, userName);

                foreach (DataRow row in resultTable.Rows)
                {
                    SalesHistory salesObject = new SalesHistory();
                    salesObject.SalesServiceOrder = row["ServiceOrderId"].ToString();
                    salesprice=row["SalesPrice"].ToString();
                    salesprice = salesprice + ".00";
                    salesObject.SalesPrice = string.Format("{0:c}", salesprice);

                    salesObject.DateExecution = row["DateExecution"].ToString();
                    salesObject.Description = row["Description"].ToString();
                    salesObject.CustomerName = row["CustomerName"].ToString();

                    salesList.Add(salesObject);

                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return salesList;
        }
示例#4
0
        //- To get the GetSalesDetails for Sales History
        public List<SalesHistory> GetSalesDetails(string serialNumber, string userName)
        {
            IAXHelper axHelper = ObjectFactory.GetInstance<IAXHelper>();
            List<SalesHistory> salesList = new List<SalesHistory>();
            try
            {
                DataTable resultTable = axHelper.GetSalesInformation(serialNumber, userName);

                foreach (DataRow row in resultTable.Rows)
                {
                    SalesHistory salesObject = new SalesHistory();
                    salesObject.SalesOrderNumber = row["SalesNumber"].ToString();
                    salesObject.InvoiceNumber = row["InvoiceNumber"].ToString();
                    salesObject.InvoiceDate = row["InvoiceDate"].ToString();
                    salesObject.CustomerName = row["Name"].ToString();
                    salesObject.ItemNumber = row["ItemNumber"].ToString();
                    salesObject.SalesSerialNumber = serialNumber;

                    salesList.Add(salesObject);

                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
            return salesList;
        }
        public JsonResult GetSalesHistoryDetails(string serialNo)
        {
            string userName = null;
            SalesHistory salesHistory = new SalesHistory();
            List<SalesHistory> salesInfoList = new List<SalesHistory>();

            try
            {
                userName = User.Identity.Name.ToString().Split('\\')[1];
                salesInfoList = salesHistory.GetSalesDetails(serialNo, userName);
                if (salesInfoList.Count > 0)
                {
                    salesHistory.SalesSerialNumber = salesInfoList[0].SalesSerialNumber;
                    salesHistory.ItemNumber = salesInfoList[0].ItemNumber;
                    salesHistory.SalesOrderNumber = salesInfoList[0].SalesOrderNumber;
                    salesHistory.CustomerName = salesInfoList[0].CustomerName;
                    salesHistory.InvoiceNumber = salesInfoList[0].InvoiceNumber;
                    salesHistory.InvoiceDate = salesInfoList[0].InvoiceDate;
                }
                salesHistory.ServiceInfoList = salesHistory.GetServiceDetails(serialNo, userName);
                ViewData["ServiceInformation"] = salesHistory.ServiceInfoList;
                TempData.Keep();
            }
            catch (Exception ex)
            {
                TempData.Keep();
                throw ex;
            }
            return Json(salesHistory);
        }