public Boolean ChangeCreditlimit(ChangeCreditLimit oChange) { Log.writeLog("INICIO llamado a WC: ChangeCreditlimit , LongDate: " + DateTime.Now.ToLongDateString() + ", LongTime: " + DateTime.Now.ToLongTimeString(), System.Diagnostics.EventLogEntryType.Information); stopwatch.Start(); Boolean bResut = true; loadConnectionString(oChange.CountryAbbrev); Log.writeLog(String.Format(" Duracion en cargar el connection String : {0:hh\\:mm\\:ss}", stopwatch.Elapsed), System.Diagnostics.EventLogEntryType.Information); //stopwatch.Restart(); Log.writeLog("Ejecucion de Store Procedure, LongDate: " + DateTime.Now.ToLongDateString() + ", LongTime: " + DateTime.Now.ToLongTimeString(), System.Diagnostics.EventLogEntryType.Information); DataAccess.NET.RemoteData oRemoteData = new DataAccess.NET.RemoteData(); DataAccess.NET.RemoteParameterCollection oParams = new DataAccess.NET.RemoteParameterCollection(); DataSet ds = new DataSet(); oRemoteData.CommandTimeOut = 0; oRemoteData.ConnectionTimeOut = 0; String sRecordSource = "Set_Planilla"; try { oRemoteData.ConnectionString = connectionString; DataAccess.NET.RemoteParameter firstParam = new DataAccess.NET.RemoteParameter("@Email", 0, ParameterDirection.Input, SqlDbType.Text, oChange.Email.ToString()); oParams.Add(firstParam); DataAccess.NET.RemoteParameter secondParam = new DataAccess.NET.RemoteParameter("@ChangePlanilla", 0, ParameterDirection.Input, SqlDbType.Float, Double.Parse(oChange.PlanillaChanged.ToString())); oParams.Add(secondParam); if (oRemoteData.GetDataSetSP("custm_BelcorpSetPlanilla", oParams, sRecordSource, ref ds) == 0) { bResut = false; } else { if (ds.Tables[0].Rows[0]["existed"].ToString().Trim() == "0") { bResut = false; } else { bResut = true; } } } catch (Exception ex) { Log.writeLog(" Message : " + ex.Message + " , StackTrace : " + ex.StackTrace + "PROC. = custm_BelcorpSetPlanilla", System.Diagnostics.EventLogEntryType.Error); bResut = false; } finally { ds = null; oRemoteData = null; oParams = null; Log.writeLog(String.Format(" Duracion Total : {0:hh\\:mm\\:ss}", stopwatch.Elapsed), System.Diagnostics.EventLogEntryType.Information); stopwatch.Stop(); } return(bResut); }
public PoductsResponse getAcumulatedProductsByEmployee(PoductsRequest oProductsRequest) { Log.writeLog("INICIO llamado a WC: getAcumulatedProductsByEmployee , LongDate: " + DateTime.Now.ToLongDateString() + ", LongTime: " + DateTime.Now.ToLongTimeString(), System.Diagnostics.EventLogEntryType.Information); stopwatch.Start(); loadConnectionString(oProductsRequest.CountryAbbrev); Log.writeLog(String.Format(" Duracion en cargar connection String : {0:hh\\:mm\\:ss}", stopwatch.Elapsed), System.Diagnostics.EventLogEntryType.Information); PoductsResponse oResponse = new PoductsResponse(); oResponse.ListProduct = new List <ProductResponse>(); DataAccess.NET.RemoteData oRemoteData = new DataAccess.NET.RemoteData(); DataAccess.NET.RemoteParameterCollection oParams = new DataAccess.NET.RemoteParameterCollection(); String ListSkus = String.Empty; DataSet dsResult = new DataSet(); try { oRemoteData.ConnectionString = connectionString; foreach (ProductRequest oProductRequest in oProductsRequest.ListProduct) { ListSkus += oProductRequest.SKU + ","; } if (oProductsRequest.ListProduct.Count > 0) { ListSkus = ListSkus.Substring(0, ListSkus.Length - 1); } DataAccess.NET.RemoteParameter firstParam = new DataAccess.NET.RemoteParameter("@SKUList", 0, ParameterDirection.Input, SqlDbType.Text, ListSkus.ToString()); oParams.Add(firstParam); DataAccess.NET.RemoteParameter secondParam = new DataAccess.NET.RemoteParameter("@Email", 0, ParameterDirection.Input, SqlDbType.Text, oProductsRequest.EmailCustomer.ToString()); oParams.Add(secondParam); DataAccess.NET.RemoteParameter thirdParam = new DataAccess.NET.RemoteParameter("@WebId", 0, ParameterDirection.Input, SqlDbType.Int, oProductsRequest.WebId); oParams.Add(thirdParam); oRemoteData.GetDataSetSP("custm_BelcorpGetAcumulatedProductsByEmployee", oParams, "AcumulatedProductsByEmployee", ref dsResult); foreach (DataRow dr in dsResult.Tables[0].Rows) { ProductResponse opProductResponse = new ProductResponse(); opProductResponse.allowed = Double.Parse(dr["AvailableQty"].ToString()) >= oProductsRequest.getTotal(dr["SKU"].ToString()); opProductResponse.SKU = dr["SKU"].ToString(); opProductResponse.Available = dr["AvailableQty"].ToString(); oResponse.ListProduct.Add(opProductResponse); } } catch (Exception ex) { Log.writeLog(" Message : " + ex.Message + " , StackTrace : " + ex.StackTrace + "PROC = custm_BelcorpGetAcumulatedProductsByEmployee", System.Diagnostics.EventLogEntryType.Error); throw; } finally { oRemoteData = null; dsResult = null; oParams = null; ListSkus = null; Log.writeLog(String.Format(" Duracion Total : {0:hh\\:mm\\:ss}", stopwatch.Elapsed), System.Diagnostics.EventLogEntryType.Information); stopwatch.Stop(); } return(oResponse); }