Esempio n. 1
0
        public ReceiptsInputModel Get()
        {
            ReceiptsInputModel input      = new ReceiptsInputModel();
            DataTable          dt         = new DataTable();
            string             JsonString = string.Empty;

            JsonString               = JsonConvert.SerializeObject(dt);
            input.plantcd            = input.getDataFromDB("exec helper.usp_Detailed_Receipts_inputs 'plantcd'", " ");
            input.suppliersitename   = input.getDataFromDB("exec helper.usp_Detailed_Receipts_inputs 'suppliersitename'", " ");
            input.ParentSupplierName = input.getDataFromDB("exec helper.usp_Detailed_Receipts_inputs 'ParentSupplierName'", " ");

            return(input);
        }
Esempio n. 2
0
        public ReceiptsOutputModel Post(ReceiptsInputModel model)
        {
            ReceiptsOutputModel result = new ReceiptsOutputModel();
            ReceiptsInputModel  action = new ReceiptsInputModel();
            DataTable           dt     = new DataTable();
            string JsonString          = string.Empty;

            JsonString = JsonConvert.SerializeObject(dt);

            if (model.dataflag == "Summary")
            {
                result.Summary = action.getDataFromDB("EXEC [helper].[usp_Detailed_Receipts_report_data]   '" + model.dataflag + "','" + model.materialnum + "','" + model.plantcd + "','" + model.fromdate + "','" + model.todate + "','" + model.suppliersitename + "','" + model.ParentSupplierName + "'", " ");
            }
            else if (model.dataflag == "Detailed")
            {
                result.Detailed = action.getDataFromDB("EXEC [helper].[usp_Detailed_Receipts_report_data]   '" + model.dataflag + "','" + model.materialnum + "','" + model.plantcd + "','" + model.fromdate + "','" + model.todate + "','" + model.suppliersitename + "','" + model.ParentSupplierName + "'", " ");
            }

            result.exportFilename = writeExcelFile(result, model.dataflag);
            return(result);
        }
Esempio n. 3
0
        // GET api/values


        // GET api/values/5
        public string Get(int id)
        {
            ReceiptsInputModel model = new ReceiptsInputModel();
            var str = "";

            var query = "";


            if (id == 1)
            {
                str = HttpContext.Current.Request.LogonUserIdentity.Name.ToString();


                query = "dbo.usp_gscobi_app_assitant  '" + str + "','login'";
            }

            if (id == 2)
            {
                str   = HttpContext.Current.Request.LogonUserIdentity.Name.ToString();
                str   = str.Replace("AMAT\\", "");
                query = "insert into  [GSCA_APPS].[dbo].[gscobi_apps_users_access_log] values ('" + str + "','DetailedReceipts',GETDATE())";
            }
            if (id == 3)
            {
                str   = HttpContext.Current.Request.LogonUserIdentity.Name.ToString();
                str   = str.Replace("AMAT\\", "");
                query = "select EMPLOYEE_NTID, Favouriteslist from [dbo].[gscobi_apps_users_favourites_list] where [EMPLOYEE_NTID]='" + str + "' and [APPLICATION_NAME] = 'DetailedReceipts'";
            }
            if (id == 4)
            {
                query = "select max(receipt_date) refreshdate  from gsca_apps.helper.detailed_receipts_app_receipt";
            }



            return(model.getDataFromDB(query, " "));;
        }