About the time of conversion, and backfilling

About the time of conversion, and backfilling

文献种类:专题技术文献;
开发工具与关键技术:Vs
作者:蛋蛋;
撰写时间:2019/06/6

Among the main table have the time (datetime) you need to create an entity class you can declare a string type of field to be replaced LockDate = tbLock.LockDate time type query table // lock date
which time the database type field LockTime = tbLock.LockDate.ToString ( ),
the entity class declaration Vo new
public string LockTime {get; set; } // declare a new lock time except
// cycle time to traverse
the foreach (Item in listMerge var)
{item.MergeTime dateToString = ((the DateTime) Item. MergeDate);
}

Splicing: Year / Month / Day

Here Insert Picture Description
The results obtained are as shown in Fig
Here Insert Picture Description
this time but there can be converted to another format, it is directlyVo entity classWhich transition is made with the new string type declaration of the time
Here Insert Picture Description
Locktime as reception, converts the reception LockTime type
while not forget to change LockTime LockDate table data in which, as is the data out of the database type detetime use string type LockTime conversion, while the need of explanation locking time LockTime
Here Insert Picture Description
structural conversion obtained under ( "yyyy-mM-dd- HH-mm") to the scribe line is divided, date, day, hour behalf; 2. so how do backfill because when data are often backfill is the most primitive style
Here Insert Picture Description
so that what we see is the need for binary conversion, so it looks not very intuitive; that I usually submit data form form, so name = "" which need to be consistent with the database field, but it can be backfilled data LOCKTIME LockDate changed, because for receiving,
loadDatatoForm ( "formInsetSuoDing", data) backfilling transactions;
encapsulation method (form a form ID, and the callback method) because it is a multi-table query data out, so when the backfill should be noted that the drop-down box Label, if it is a text box is a multi-criteria query data out of the need to backfill then also need to pay attention not to query the data again so as to render the table with a set of forms as a receiver, with the var generics, less error-prone Where filter by final condition data backfill based on the master table's primary key ID with single () the reason to use single () because a single data, so only backfill a data among the tables when the backfill; use single () thought needs to be captured abnormal try () catch ();
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/qq_42577408/article/details/91128485