/// <Summary>
/// Obtain the date of the first day of the week, that is, Sunday.
/// </Summary>
/// <Returns> </returns>
Public static string GetWeekFirstDate ()
{
Return DateTime. Now. AddDays (Convert. ToDouble (0-Convert. ToInt16 (DateTime. Now. DayOfWeek). ToShortDateString ();
}
/// <Summary>
/// Obtain the date of the last day of the week
/// </Summary>
/// <Returns> </returns>
Public static string GetWeekLastDate ()
{
Return DateTime. Now. AddDays (Convert. ToDouble (6-Convert. ToInt16 (DateTime. Now. DayOfWeek). ToShortDateString ();
}
/// <Summary>
/// Convert to Long type. The error is returned.-1
/// </Summary>
/// <Param name = "value"> </param>
/// <Returns> </returns>
Public static long ConvertToLong (object value)
{
Long id =-1;
Long. TryParse (value. ToString (), out id );
Return id;
}
/// <Summary>
/// Convert to Double type, error returns-1
/// </Summary>
/// <Param name = "value"> </param>
/// <Returns> </returns>
Public static double ConvertToDouble (object value)
{
Double id =-1;
Double. TryParse (value. ToString (), out id );
Return id;
}
/// <Summary>
/// Converted to Int type,-1 conversion error
/// </Summary>
/// <Param name = "value"> </param>
/// <Returns> </returns>
Public static int ConvertToInt (object value)
{
Int id =-1;
Int. TryParse (value. ToString (), out id );
Return id;
}
/// <Summary>
/// Bind data to ListControl
/// </Summary>
/// <Param name = "lc"> </param>
/// <Param name = "dt"> </param>
/// <Param name = "strText"> </param>
/// <Param name = "strValue"> </param>
Public static void BindDrop (ListControl lc, DataTable dt, string strText, string strValue)
{
Lc. Items. Clear ();
Foreach (DataRow myRow in dt. Rows)
{
Lc. Items. Add (new ListItem (myRow [strText]. ToString (), myRow [strValue]. ToString ()));
}
Lc. DataBind ();
}
/// <Summary>
/// Bind data to ListControl
/// </Summary>
/// <Param name = "lc"> </param>
/// <Param name = "dt"> </param>
/// <Param name = "strText"> </param>
/// <Param name = "strValue"> </param>
Public static void BindDrop (ListControl lc, DataTable dt, string strText, string strValue, string FirstText, string FirstValue)
{
Lc. Items. Clear ();
Lc. Items. Add (new ListItem (FirstText, FirstValue ));
Foreach (DataRow myRow in dt. Rows)
{
Lc. Items. Add (new ListItem (myRow [strText]. ToString (), myRow [strValue]. ToString ()));
}
Lc. DataBind ();
}
/// <Summary>
/// Bind data to ListControl
/// </Summary>
/// <Param name = "lc"> </param>
/// <Param name = "FirstText"> </param>
/// <Param name = "FirstValue"> </param>
Public static void BindDrop (ListControl lc, string FirstText, string FirstValue)
{
Lc. Items. Clear ();
Lc. Items. Add (new ListItem (FirstText, FirstValue ));
Lc. DataBind ();
}
Public static void BindDataDrop (ListControl list, int iBegin, int iEnd)
{
&