Posts by Dorathoto • 7,426 points
252 posts
-
6
votes3
answers1767
viewsQ: Attribute in Dataannotations for Currency
I would like to format with Dataannotation currency but standard in the model: [Column("cur_mensalidade")] [DataType(DataType.Currency)] [DisplayFormat(DataFormatString = "{0:C0}")] public decimal?…
-
1
votes1
answer499
viewsA: Form validation with MVC Dataannotations
The mistake was the lack of 2 key in the web.config <appSettings> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" />…
-
1
votes1
answer499
viewsQ: Form validation with MVC Dataannotations
I’m trying to validate forms with use of Dataannotation, I tried direct on model or in my viewmodel and none of them works. View Model: public class CieloViewModelTransacaoPartial {…
-
8
votes2
answers653
views -
3
votes1
answer81
viewsQ: Lazyload even putting . include(t => t.Model)
I’m having the mistake: Exception Details: System.Objectdisposedexception: The Objectcontext instance has been disposed and can no longer be used for Operations that require a Connection. When I…
-
4
votes1
answer105
viewsQ: ASP.NET shares resources in the same pool?
I have today on my IIS 8 sites on ASP.NET using the same pool. On average they consume 800mb of RAM. I ended up dismembering them (separate pools) and it seems to be consuming 1,5GB in total. I…
-
4
votes1
answer344
viewsQ: Differences in constructors using property vs field (field)
namespace WMB.CieloB { internal class FuncoesCielo { internal FuncoesCielo(int iDC, Boleto boleto) { IDCliente = iDC; this.boleto = boleto; } public int IDCliente { get; set; } internal Transaction…
-
-1
votes1
answer371
viewsQ: Nullable<Datetime> 01/01/0001
I have a Model field [Column("sdt_dataPagamento")] [Display(Name = "Dt. Pagamento")] [DataType(DataType.Date)] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]…
-
1
votes1
answer1040
viewsQ: Call ajax with Jquery every X seconds
I’m trying to make a call Ajax as soon as the page loads and one every 2 minutes. The first and the second works, but there’s no third call and so on. <script type="text/javascript"> function…
-
2
votes1
answer2872
viewsA: how to create a php stopwatch with start and finish button?
In php I believe it is not what you want, since it runs on server. I made a simple code in pure Javascript. Example working on Fiddle: https://jsfiddle.net/dorathoto/5uswvep8/ But I don’t know if…
-
0
votes0
answers117
viewsQ: Backup App - Online via Onedrive or Local?
Although this question is a personal opinion, it may help to several other people if we put the positive and negative points of every technology. I have a server in the USA, with link 1 Gbt/s Full…
-
1
votes1
answer182
viewsA: Formsauthentication causes an infinite redirect error - ASP.NET C#
Changing Maxurl equals solving performance problem by placing a Stronger CPU. You are using the 2 options at the same time FormsAuthentication.RedirectFromLoginPage and Response.Redirect Both of…
-
1
votes2
answers134
viewsA: Database server in Azure
Say that distance does not impact performance would be wrong. But how much it impacts? A default server response time on Locaweb is usually 30ms against 140ms of Azure. If your query is taking 3…
-
3
votes2
answers1802
viewsA: Framework to create admin dashboards and dashboards
The Best option is to buy some ready. There are several in the market and many use Bootstrap. And with costs starting at U$3.00 (R$ 12.00 for a Responsive template) is banana price. NOTE: Many comes…
-
4
votes2
answers2098
viewsQ: Display decimals (Currency) is rounding
I have an application where the price should go in format int decimal-free. int Valor = (int)(produto.Valor * 100); //o produto.Valor é um decimal The problem is when I want to display this value in…
-
0
votes1
answer95
viewsA: How to put a "show more" on gridview
With the webforms gridview will be punk, I’ve done once with it formatted using Datatables.net but it’s not so easy if you have to show a lot of data on the Child line or uses devexpress gridview…
-
0
votes1
answer48
viewsQ: 0.. 1 to 1 modeling in the Entity Framework - Error The Entity or Complex
I’m trying to make a query but returns the error: Additional information: The Entity or Complex type 'WMB.CieloB.Model.Cielotoken' cannot be constructed in a LINQ to Entities query. My consultation:…
-
5
votes2
answers4277
viewsQ: applicationx-www-form-urlencoded with Httpwebrequest
I’m making a system to authenticate the Token (derived from the credit card) next to Cielo. This token has special characters like + Cielo receives the data via XML. I made the following code to…
-
1
votes1
answer87
viewsQ: Data Annotation - error ratio 1:1
I’m trying to make a 1-to-1 relationship. Apparently it would be something simple but my system is getting lost in this relationship; It doesn’t make a mistake, but the relationship is wrong: Model:…
-
0
votes1
answer32
viewsQ: call a locally designated variable
I need to call a variable that is empty, but how to do it? I created the following code public ActionResult Index() { cliente cliente; try { cliente = db.cliente.find(id); //etc } catch (Exception…
-
0
votes1
answer77
viewsQ: How to override a class from an external project to call a function
I have a solution where contains 2 projects. One of them is the project I pulled from github, so I don’t want to modify it because every time I upgrade I will lose my settings. In this project there…
-
2
votes1
answer169
viewsQ: Is outputcache only valid at controller level?
I’ve been reading the article: http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/improving-performance-with-output-caching-cs And I started using the: [OutputCache(Duration =…
-
1
votes1
answer1377
viewsQ: Linq with 2 different context using Inner Join
I would like to make a query in 2 different databases (2 Dbcontext) I tried it in several ways, one of them: I make a prequery in Dbmega context to recover the employees var FuncionariosLinq = (from…
-
8
votes2
answers1332
viewsQ: Convert string to Datetime in LINQ
I have a model where all fields are string. I want to convert to DateTime and Double For that I created a new model public class CPUStats { public DateTime Data { get; set; } public Double? Disco {…
-
7
votes1
answer94
viewsQ: Update to 2K records <Clients> how to do a single update instead of 2k separately
I have a Customer Model and need to do an update on EnviadoEmailCobranca para 0 I’m doing like this: var clientes = db.Clientes.Where(w => w.Status == 4); foreach (var item in clientes) {…
-
4
votes2
answers1021
viewsA: Problem to get input value with javascript
Suggestion or make on Javascript pure or Jquery, makes it easier to understand the logic. (In your example there was mixture of Jquery with pure Javascript) Below is your example working in Jquery.…
-
2
votes1
answer594
viewsQ: Linq + Lambda, sub-query, distinct and not in, how to improve this query
I had the following syntax in SQL SELECT tbl_boleto.int_IDC, tbl_Admin.int_STATUS, tbl_Admin.int_CONVENIO, tbl_Admin.int_PLANO, tbl_Admin.int_RESTRICAO, tbl_Admin.str_URL FROM tbl_boleto INNER JOIN…
-
1
votes2
answers1579
viewsQ: NOT IN in Inline using a sub-query
I am using as a basis the answer in: https://stackoverflow.com/questions/432954/not-in-clause-in-linq-to-entities I need to make a query where do not contain (NOT IN) the Ids coming from another…
-
2
votes1
answer1049
viewsQ: Date Issue in ASP.NET MVC
In my model I have the following field: [Column("sdt_DataReferencia")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")] [Display(Name = "Data Referência")]…
-
1
votes1
answer966
viewsA: Insert via Entityframework error "IDENTITY_INSERT is set to OFF"
the problem was how to create relationships between boletos and boletoTXT as had been made boletoTXT had several boletos, so he made use of the foreign key. In the model Boletos got public virtual…
-
1
votes1
answer966
viewsQ: Insert via Entityframework error "IDENTITY_INSERT is set to OFF"
I have several models and for some reason one of them presents the following error: Cannot insert explicit value for identity column in table 'tbl_boleto' when IDENTITY_INSERT is set to OFF. I…
-
1
votes1
answer1494
viewsQ: A potentially Dangerous Request.Path value was Detected from the client
I’m trying to submit an action with a parameter like this: <a href="@Url.Action(@"Create/?reference=01/04/2016", "Cobranca")" But it generates a URL like this:…
-
2
votes1
answer437
viewsQ: @Html.Editorfor Datetime property remove hh:mm:ss
In my model have a field DateTime called Dating, I graduated with Attributes, but when I’m in view is filling in hh:mm:ss I just want the date 29/02/2016. Model [Column("sdt_DataReferencia")]…
-
2
votes1
answer160
viewsQ: LEFT Outer Join does not work on LINQ when 0 is the reference? null only
I’m having doubts on Left Outer Join, I’m using MVC 5 C#, Net 4.5.2. I have the following Model Fornecedor public class fechamentoFornecedor { public int FornecedorId { get; set; } public int Tipo {…
-
2
votes1
answer91
viewsQ: Entityframework Executesqlcommand not accepting parameter
I’m running the Executesqlcommand. In the right way, parameter doesn’t work: var SQL = "update POSTOFFICE set Status = 1 where name = '@url'"; dbMailEnable.Database.ExecuteSqlCommand(SQL, new…
-
2
votes2
answers90
viewsA: Doubt Gets/Sets
Recover values from Textbox var Valor = Request.Form["IdTexBox"]; But in Webform I believe it is what you are using (aspx) <asp:TextBox id="textBoxId" runat="server" ></asp:TextBox> var…
-
3
votes3
answers2099
viewsA: Is it safe and feasible to minify PHP files?
You won’t have any problems, spacing, tabulations are more visual than really necessary. However minification is only recommended if you have something that does this for you, I mean, that you still…
-
0
votes1
answer775
viewsQ: MVC - How to load a template html page, modify it and send it by email
I am making a form that sends an email to the customer, this email comes from a template depending on the client’s stage. Ex: Estágio 01 envio o e-mail com a body vindo do modelo_01.html, se o…
-
1
votes2
answers376
viewsQ: Subconsulta in Lambda
I would like to do a sub-query today on SQL: SELECT intid as IDCliente, (SELECT TOP (1) int_EP FROM tbl_estagioprocesso WHERE (int_IDC = tbl_Admin.intid) ORDER BY int_ID DESC) AS int_EP FROM…
-
2
votes1
answer518
viewsQ: Model arriving empty in controller
I basically have a Controller who sends a iList to the View, that one View could edit any record of that iList, but when the Controller receives it is already empty. I did so: Controller: public…
-
2
votes2
answers355
viewsQ: Lambda, Where com subconsulta
I need a consult like that on the lambda SELECT ClienteId --Aqui eu tenho varios campos do Cliente e estagioprocesso FROM Cliente WHERE ((SELECT TOP (1) EP FROM estagioprocesso WHERE…
-
1
votes2
answers86
viewsQ: Model, relationship with Dataannotations
If I have an entity Customers public class Cliente { public int ClienteId { get; set; } public string Email { get; set; } public string Nome { get; set; } } If I create a Boleto entity public class…
-
1
votes1
answer617
viewsQ: View with 2 model inside a Viewmodel
Goal: Manipulate 2 model in the view using a Viewmodel. I made a Viewmodel to encapsulate the 2 models, but I can’t use one of them. Viewmodel: public class BoletoConfigViewModel { public Boleto…
-
1
votes2
answers287
views -
1
votes2
answers301
viewsQ: Xmltextreader() identify end of node and duplicate tags
1 - How to identify equal tags with different nodes? ex: Categoria inside Dados and Formato 2 - How to identify who finished one product and started another? I have XML (fictitious):…
-
4
votes1
answer535
views -
3
votes1
answer535
views -
0
votes2
answers2375
viewsA: Set up site on IIS 7. Do not start site
Enable tracking and check what happens;…
-
0
votes0
answers45
viewsQ: How to paginate data? Via Storedprocedure or Dataview?
I am using Datatables.net with server-side via Webform and Ado.net. I need to paginate the data (sort, filter, etc), I see 2 possibilities: - via stored procedure ou - via DataView The problem is…
-
1
votes2
answers609
viewsA: manipulating Datatables.net data with Json [like manipulating json to display img in the column]
I managed to do it with a method not recommended but that worked "render": function ( data, type, full, meta ) { return '<img src="http://imgteste.wmb.com.br/"'+ data.foto +' style="width:50px;"…