1. Dynamic assignment,
This problem took two days. The first result was: on the salary add page, you do not need to enter the employee code, because users may not be able to remember the code of each employee, a new window will pop up when double-clicking the control or clicking the button next to the control, in the new window that appears, use the table (gridview) to display the employee information. When you double-click the information of a row in the table, the window is automatically closed, and assign the value to the original subwindow. This is also often used in many enterprise software, such as U3.
However, the session is used to store the value and obtained in the original window. In this case, the value cannot be obtained in real time. The selection button is used, but this method cannot be obtained across browsers, intelligently pass values in the current browser window
Protected void gvmessageemp_rowdatabound (Object sender, gridviewroweventargs e) </P> <p >{</P> <p> If (E. row. rowtype = datacontrolrowtype. datarow) </P> <p >{</P> <p> ........ </P> <p> // double-click a row to dynamically update the salary page; stored in the session will occupy the cache </P> <p> // session ["selectempid"] = E. row. cells [0]. text. tostring (). trim (); </P> <p> // session ["selectempname"] = E. row. cells [1]. text. tostring (). trim (); </P> <p> // session ["selectdepid"] = E. row. cells [2]. text. tostring (). trim (); </P> <p> // session ["selectdepname"] = E. row. cells [3]. text. tostring (). trim (); </P> <p> string jsstring = "too many opener.doc ument. getelementbyid ('txtempid '). value = '"+ E. row. cells [0]. text. tostring (). trim () + "'{}}opener.doc ument. getelementbyid ('txtempname '). value = '"+ E. row. cells [1]. text. tostring (). trim () + "'{}}opener.doc ument. getelementbyid ('txtdepid '). value = '"+ E. row. cells [2]. text. tostring (). trim () + "'{}}opener.doc ument. getelementbyid ('txtdepname '). value = '"+ E. row. cells [3]. text. tostring (). trim () + "'; window. close (); "; </P> <p> E. row. attributes. add ("ondblclick", jsstring); </P> <p >}</P> <p>
Finally, I solved the problem by asking a. net friend in the Forum:
The above is the solution to this problem. I originally put it in the session, but this occupies the browser cache. If the data is too much, it will affect the user's browsing speed.
The key to the problem is that opener uses the zookeeper opener.doc ument. getelementbyid ('txtempname') code to reference the parent window of a subwindow.
2. You need to query data between different tables and make statistics on the table.
The function I want to implement is to query the information statistics of candidates for admission, TBD, and elimination. These fields are not included in this table, and there is only one application status mark, in addition, the job information here is obtained from the recruitment position in the Recruitment Form. In the beginning, we wanted to query statistics through the association between tables, but the data processing volume and logic would be very troublesome.
The final solution is to create a new view and calculate the information in the SQL statement of the view.
The Code is as follows:
Select distinct </P> <p> Top 100 percent DBO. hrh_recruitment.positionname as psname, </P> <p> DBO. hrh_recruitment.several as psseveral, </P> <p> (select count (applyid) as recruitstate </P> <p> from DBO. hrh_apply </P> <p> where (applyid in </P> <p> (select applyid </P> <p> from hrh_apply </P> <p> where applystate = 1 ))) as recruitstate, </P> <p> (select count (applyid) as undeterminedstate </P> <p> from DBO. hrh_apply </P> <p> where (applyid in </P> <p> (select applyid </P> <p> from hrh_apply </P> <p> where applystate = 0 ))) as undeterminedstate, </P> <p> (select count (applyid) as eliminatestate </P> <p> from DBO. hrh_apply </P> <p> where (applyid in </P> <p> (select applyid </P> <p> from hrh_apply </P> <p> where applystate = 2 ))) as eliminatestate, </P> <p> DBO. hrh_recruitment.usefultime as usetime, </P> <p> DBO. hrh_recruitment.state as psstate </P> <p> from DBO. hrh_apply inner join </P> <p> DBO. hrh_recruitment on </P> <p> DBO. hrh_apply.applyposition = DBO. hrh_recruitment.positionname </P> <p> order by DBO. hrh_recruitment.usefultime </P> <p>
This does not affect the table structure, and saves a lot of code at the business logic layer.