Example #1
0
        /// <summary>
        /// Gets the the sales report from the utdwsclient to populate the tables
        /// </summary>
        /// <param name="start">the start date</param>
        /// <param name="end">the end Date</param>
        /// <param name="productTypeID">the product type id</param>
        /// <param name="productID">the id of the product</param>
        /// <param name="providerID">id of the provider</param>
        /// <param name="chain">the name of the chain</param>
        /// <param name="merchant">the merchant</param>
        /// <returns>Returns a list of type {UTDWSClient.Interfaces.SalesReport_Result}</returns>
        public static List<UTDWSClient.Interfaces.SalesReport_Result> getSalesReport(DateTime start, DateTime end, string productTypeID="0", string productID="0", string providerID="0",string chain="0",string merchant="0")
        {
            UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
            r = UTDWSClient.WSClient.Login("00008475", "00008475");
            if (r.RSP_CODE is String && r.SESSION is String)
            {
                UTDWSClient.Interfaces.ReportParameters recparam = new UTDWSClient.Interfaces.ReportParameters();
                start = start.Subtract(start.TimeOfDay);
                recparam.START = start;
                recparam.END = end.AddHours(23.99);
                recparam.PRODUCT_TYPE_ID = Convert.ToInt32(productTypeID);
                recparam.PRODUCT_ID = Convert.ToInt32(productID);
                recparam.PROVIDER_ID = Convert.ToInt32(providerID);
                recparam.NUMRECORDS = 50;
                UTDWSClient.Interfaces.RspReportSales report = new UTDWSClient.Interfaces.RspReportSales();
                report = WSClient.ReportSales(r.SESSION, recparam);
                List<UTDWSClient.Interfaces.SalesReport_Result> result = report.RESULT;

                if (result.Count > 0)
                {
                    return result;
                }

            }
            return null;
        }
Example #2
0
 public static void StoreEdit(UTDWSClient.Interfaces.RspStores parameters)
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     var result = UTDWSClient.WSClient.StoreNew(r.SESSION, parameters);
     GlobalVariables.lasRequestResult = "" + result.RSP_CODE + " " + result.RSP_MESSAGE;
 }
Example #3
0
 public static void getStoresAll()
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     var result = UTDWSClient.WSClient.StoresGetAll(r.SESSION);
     GlobalVariables.storesAll = result.STORES;
     GlobalVariables.lasRequestResult = "" + result.RSP_CODE + " " + result.RSP_MESSAGE;
 }
 public static void accountGet()
 {
     UTDWSClient.Interfaces.RspAccount account = new UTDWSClient.Interfaces.RspAccount();
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     account = UTDWSClient.WSClient.AccountGet(r.SESSION);
     GlobalVariables.accountInfo = account;
 }
Example #5
0
        /// <summary>
        /// gets the report from utdwsclient to populate the grids
        /// </summary>
        /// <param name="start">The star date</param>
        /// <param name="end">The end date</param>
        /// <param name="tiendaID">the id of the store</param>
        /// <returns>Returns a list of type {UTDWSClient.Interfaces.RspPaymentReport}</returns>
        public static UTDWSClient.Interfaces.RspPaymentReport getPaymentReports(DateTime start, DateTime end,string storeId="")
        {
            UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
            r = UTDWSClient.WSClient.Login("00008475", "00008475");
            UTDWSClient.Interfaces.ReportPaymentParams recparam = new UTDWSClient.Interfaces.ReportPaymentParams();

            start = start.Subtract(start.TimeOfDay);
            recparam.START = start;
            recparam.END = end.AddHours(23);
            recparam.ENTITY_ID = storeId;
            UTDWSClient.Interfaces.RspPaymentReport reporte = UTDWSClient.Methods.Payment.Report(r.SESSION, recparam);

            return reporte;
        }
        public static string[] add(string nameAdd, string RepresentateAdd, string cellAdd, string AdressAdd, string AdressAdd2, string CountryComboAdd, string StateComboAdd, string cityComboAdd, string sectorComboAdd, string phoneAdd, string faxAdd, string emailAdd, string distributor, string category, string userAdd, string passwordAdd, string PinAdd, string nameUserAdd, string apellidoAdd)
        {
            if (string.IsNullOrEmpty(nameAdd)) { nameAdd = null; } if (RepresentateAdd == "") { RepresentateAdd = null; }
            if (string.IsNullOrEmpty(cellAdd)) { cellAdd = null; }
            if (string.IsNullOrEmpty(AdressAdd)) { AdressAdd = null; }
            if (string.IsNullOrEmpty(AdressAdd2)) { AdressAdd2 = null; }
            if (string.IsNullOrEmpty(CountryComboAdd)) { CountryComboAdd = null; }
            if (string.IsNullOrEmpty(StateComboAdd)) { StateComboAdd = null; }
            if (string.IsNullOrEmpty(cityComboAdd)) { cityComboAdd = null; }
            if (sectorComboAdd == "") { sectorComboAdd = null; }
            if (phoneAdd == "") { phoneAdd = null; }
            if (faxAdd == "") { faxAdd = null; }
            if (emailAdd == "") { emailAdd = null; }
            if (distributor == "") { distributor = null; }
            if (category == "") { category = null; }

            UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
            r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
            UTDWSClient.Interfaces.RspDistributorParam parameters = new UTDWSClient.Interfaces.RspDistributorParam()
            {

                DISTRIBUTOR = nameAdd,
                REPRESENTATIVE = RepresentateAdd,
                ADDRESS = (AdressAdd),
                ADDRESS2 = (AdressAdd2),
                COUNTRY_ID = Int32.Parse(CountryComboAdd),
                CITY_ID = Int32.Parse(cityComboAdd),
                STATE_ID = Int32.Parse(StateComboAdd),
                SECTOR_ID = Int32.Parse(sectorComboAdd),
                ENTITY_CATEGORY_ID = Int32.Parse(category),
                ENTITY_TYPE_ID = Int32.Parse(distributor),
                FAX = faxAdd,
                EMAIL = (emailAdd),
                PHONE = (phoneAdd),
                CELL = cellAdd,
                CREATION_DATE = DateTime.Now

            };
            UTDWSClient.Interfaces.rspDistributorResultNew result = UTDWSClient.WSClient.DistribuitorNew(r.SESSION, parameters);
            string[] array = { Convert.ToString(result.RSP_CODE), Convert.ToString(result.RSP_MESSAGE) };
            return array;
        }
Example #7
0
 //
 // GET: /Login/
 public ActionResult Index(string username, string password,string messague)
 {
     if (username == "" || username == null ||password=="" ||password==null)
     {
         return View();
     }
     else
     {
         UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
         r = UTDWSClient.WSClient.Login(username, password);
         if (r.RSP_CODE == "00")
         {
             Session["Login"] = r;
             return Redirect("/Distribuitors");
         }
         else
         {
             TempData["loginMessague"] = "Combinacion usuar. contra. no son correctas";
             return View();
         }
     }
 }
Example #8
0
 /// <summary>
 /// Gets the the transaccions Report by provider Type from the utdwsclient to populate the tables
 /// </summary>
 /// <returns>Returns a list of products of (utdwsclient.interfaces.product) type</returns>
 public static List<UTDWSClient.Interfaces.Product> getProductsReport()
 {
     try
     {
         UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
         r = UTDWSClient.WSClient.Login("00008475", "00008475");
         UTDWSClient.Interfaces.RspProduct product = WSClient.ProductList(r.SESSION);
         List<UTDWSClient.Interfaces.Product> pList = product.PRODUCT;
         if (pList.Count > 0)
         {
             return pList;
         }
         else
         {
             return null;
         }
     }
     catch (Exception)
     {
         return null;
     }
 }
        public static string[] edit(string ID, string nameAdd, string RepresentateAdd, string cellAdd, string AdressAdd, string AdressAdd2, string CountryComboAdd, string StateComboAdd, string cityComboAdd, string sectorComboAdd, string phoneAdd, string faxAdd, string emailAdd, string distributor, string category)
        {
            if (ID == "") { ID = "0"; }
            if (CountryComboAdd == "") { CountryComboAdd = "0"; }
            if (StateComboAdd == "") { StateComboAdd = "0"; }
            if (cityComboAdd == "") { cityComboAdd = "0"; }
            if (sectorComboAdd == "") { sectorComboAdd = "0"; }
            if (category == "") { category = "0"; }
            if (distributor == "") { distributor = "0"; }
            UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
            r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
            UTDWSClient.Interfaces.RspDistributorParam parameters = new UTDWSClient.Interfaces.RspDistributorParam()
            {

                DISTRIBUTOR = nameAdd,
                REPRESENTATIVE = RepresentateAdd,
                ADDRESS = (AdressAdd),
                ADDRESS2 = (AdressAdd2),
                COUNTRY_ID = Int32.Parse(CountryComboAdd),
                CITY_ID = Int32.Parse(cityComboAdd),
                STATE_ID = Int32.Parse(StateComboAdd),
                SECTOR_ID = Int32.Parse(sectorComboAdd),
                ENTITY_CATEGORY_ID = Int32.Parse(category),
                ENTITY_TYPE_ID = Int32.Parse(distributor),
                FAX = faxAdd,
                EMAIL = (emailAdd),
                PHONE = (phoneAdd),
                CELL = cellAdd,
                MODIFIED_DATE = DateTime.Now,

                DISTRIBUTOR_ID = Int32.Parse(ID)

            };
            UTDWSClient.Interfaces.RspDistribuitorEdit result = UTDWSClient.WSClient.DistribuitorEdit(r.SESSION, parameters);
            string[] array = { Convert.ToString(result.RSP_CODE), Convert.ToString(result.RSP_MESSAGE) };
            return array;
        }
Example #10
0
 /// <summary>
 ///  Gets the the sales report summarized by provider Type from the utdwsclient to populate the tables
 /// </summary>
 /// <param name="start">The start date</param>
 /// <param name="end">The end date</param>
 /// <returns>Returns a list of type {UTDWSClient.Interfaces.SalesReportByProvider_Result} </returns>
 public static List<UTDWSClient.Interfaces.SalesReportByProvider_Result> getSalesReportByProvider(DateTime start, DateTime end)
 {
     try
     {
         UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
         r = UTDWSClient.WSClient.Login("00008475", "00008475");
         if (r.RSP_CODE is String && r.SESSION is String)
         {
             UTDWSClient.Interfaces.ReportParameters recparam = new UTDWSClient.Interfaces.ReportParameters();
             start = start.Subtract(start.TimeOfDay);
             recparam.START = start;
             recparam.END = end.AddHours(23.99);
             UTDWSClient.Interfaces.RspReportSalesByProvider report = new UTDWSClient.Interfaces.RspReportSalesByProvider();
             report = WSClient.ReportSalesByProvider(r.SESSION, recparam);
             List<UTDWSClient.Interfaces.SalesReportByProvider_Result> result = report.RESULT;
             return result;
         }
         else
         {
             return null;
         }
     }
     catch (Exception)
     {
         return null;
     }
 }
Example #11
0
 public static void getStoreById(int id)
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     GlobalVariables.storeByID = UTDWSClient.WSClient.StoreGet(r.SESSION, id);
 }
Example #12
0
 public static string[] getStates()
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     GlobalVariables.stateList = UTDWSClient.WSClient.getStates(r.SESSION).STATES;
     string[] result = { UTDWSClient.WSClient.getStates(r.SESSION).RSP_CODE, UTDWSClient.WSClient.getStates(r.SESSION).RSP_MESSAGE };
     return result;
 }
Example #13
0
 public static string[] getSectors()
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     var sectors = UTDWSClient.WSClient.getSectors(r.SESSION);
     GlobalVariables.sectorList = sectors.SECTORS;
     string[] result = { sectors.RSP_CODE, sectors.RSP_MESSAGE };
     return result;
 }
Example #14
0
 public static UTDWSClient.Interfaces.RspDistribuitorsList getReports(string name, int DEALER_STATUS_ID = 0, string adress = "", string adress2 = "", string billingID = "", string cell = "", int cityID = 0, int COUNTRY_ID = 0)
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     UTDWSClient.Interfaces.DistributorParams parameters = new UTDWSClient.Interfaces.DistributorParams()
     {
         NAME = name,
         ADDRESS = adress,
         ADDRESS2 = adress2,
         BILLING_ID = billingID,
         CELL = cell,
         CITY_ID = cityID,
         COUNTRY_ID = COUNTRY_ID,
         DEALER_STATUS_ID = DEALER_STATUS_ID,
     };
     UTDWSClient.Interfaces.RspDistribuitorsList list = new UTDWSClient.Interfaces.RspDistribuitorsList();
     list = UTDWSClient.Methods.Distribuitor.get(r.SESSION, parameters);
     return list;
 }
Example #15
0
 public static List<UTDWSClient.Interfaces.pDistributorList_Result> getReports()
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     GlobalVariables.distribuitorAll = UTDWSClient.Methods.Distribuitor.List(r.SESSION).DISTRIBUTORS;
     return GlobalVariables.distribuitorAll;
 }
Example #16
0
 public static string[] getEntityTypes()
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     var categoriesMain = UTDWSClient.WSClient.getEntityTypes(r.SESSION);
     GlobalVariables.Entitytypes = categoriesMain.ENTITY_TYPES;
     string[] result = { categoriesMain.RSP_CODE, categoriesMain.RSP_MESSAGE };
     return result;
 }
Example #17
0
        /// <summary>
        /// Gets the the transaccions Report by provider Type from the utdwsclient to populate the tables
        /// </summary>
        /// <param name="start">The start date</param>
        /// <param name="end">The end date</param>
        /// <param name="productId">the id of the product</param>
        /// <param name="type">The type of the product</param>
        /// <param name="numRecords">The number of records</param>
        /// <param name="phonePin">The phone pin</param>
        /// <param name="response">the Response code generate in the transaccion</param>
        /// <param name="authNumber">The number of authentification generated in the transaccion</param>
        /// <returns>returns a list of transaccion of type {UTDWSClient.Interfaces.TransactionList} </returns>
        public static List<UTDWSClient.Interfaces.TransactionList> transaccionsReport(DateTime start, DateTime end, int productId, string type, int numRecords, string phonePin, string response, string authNumber)
        {
            try
            {   UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
                r = UTDWSClient.WSClient.Login("00008475", "00008475");

                if (r.RSP_CODE is String && r.SESSION is String)
                {
                    start = start.Subtract(start.TimeOfDay);
                    UTDWSClient.Interfaces.RecordParameters recparam = new UTDWSClient.Interfaces.RecordParameters() { START = start, END = end.AddHours(23.99), PRODUCT_ID = productId, TYPE = type,
                    NUMRECORDS = numRecords, PHONE_PIN = phonePin, RESPONSE = response, AUTH_NUMBER = authNumber };
                    UTDWSClient.Interfaces.RspReportTransaction trans = new UTDWSClient.Interfaces.RspReportTransaction();
                    trans = WSClient.ReportTransactions(r.SESSION, recparam);
                    List<UTDWSClient.Interfaces.TransactionList> list = trans.TRANSACTION;
                    if (list.Count > 0)
                    {
                        return list;
                    }
                    return null;

                }
                 return null;

                } catch (Exception)
                 {

                     return null;

                }
        }
Example #18
0
        public static void getDistributorByParam(int? page_size, string distributor, string id, string state)
        {
            UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
            r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
            if (distributor != null && id != null && state != null)
            {
                UTDWSClient.Interfaces.RspDistributorListParam param = new UTDWSClient.Interfaces.RspDistributorListParam() { PAGE_SIZE = page_size ?? 10, DISTRIBUTOR = distributor, STATE_ID = Convert.ToInt32(state), DISTRIBUTOR_ID = Convert.ToInt32(id) };

                GlobalVariables.distribuitorById = UTDWSClient.WSClient.FilterDistributor(r.SESSION, param).DISTRIBUTORS;

            }
            if (distributor == null && id != null && state != null)
            {
                UTDWSClient.Interfaces.RspDistributorListParam param = new UTDWSClient.Interfaces.RspDistributorListParam() { PAGE_SIZE = page_size ?? 10, STATE_ID = Convert.ToInt32(state), DISTRIBUTOR_ID = Convert.ToInt32(id) };

                GlobalVariables.distribuitorById = UTDWSClient.WSClient.FilterDistributor(r.SESSION, param).DISTRIBUTORS;
            }
            if (distributor != null && id == null && state != null)
            {
                UTDWSClient.Interfaces.RspDistributorListParam param = new UTDWSClient.Interfaces.RspDistributorListParam() { PAGE_SIZE = page_size ?? 10, DISTRIBUTOR = distributor, STATE_ID = Convert.ToInt32(state) };

                GlobalVariables.distribuitorById = UTDWSClient.WSClient.FilterDistributor(r.SESSION, param).DISTRIBUTORS;
            }
            if (distributor == null && id == null && state == null)
            {
                UTDWSClient.Interfaces.RspDistributorListParam param = new UTDWSClient.Interfaces.RspDistributorListParam() { PAGE_SIZE = page_size ?? 10 };

                GlobalVariables.distribuitorById = UTDWSClient.WSClient.FilterDistributor(r.SESSION, param).DISTRIBUTORS;
            }
            if (distributor == null && id == null && state != null)
            {
                UTDWSClient.Interfaces.RspDistributorListParam param = new UTDWSClient.Interfaces.RspDistributorListParam() { STATE_ID = Convert.ToInt32(state) };

                GlobalVariables.distribuitorById = UTDWSClient.WSClient.FilterDistributor(r.SESSION, param).DISTRIBUTORS;

            } if (distributor == null && id != null && state == null)
            {
                UTDWSClient.Interfaces.RspDistributorListParam param = new UTDWSClient.Interfaces.RspDistributorListParam() { DISTRIBUTOR_ID = Convert.ToInt32(id) };

                GlobalVariables.distribuitorById = UTDWSClient.WSClient.FilterDistributor(r.SESSION, param).DISTRIBUTORS;

            }
        }
Example #19
0
 public static List<UTDWSClient.Interfaces.pDistributorList_Result> getDistributorByID(int id)
 {
     UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
     r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
     return UTDWSClient.WSClient.DistributorGet(r.SESSION, id).DISTRIBUTORS;
 }
Example #20
0
        public static void getCountrys()
        {
            try
            {
                UTDWSClient.Interfaces.RspLogin r = new UTDWSClient.Interfaces.RspLogin();
                r = (UTDWSClient.Interfaces.RspLogin)System.Web.HttpContext.Current.Session["Login"];
                GlobalVariables.countryList = UTDWSClient.WSClient.getCountries(r.SESSION).Countries;
            }
            catch
            {

            }
        }