Click here to Skip to main content
15,890,282 members

Comments by Member 11956239 (Top 21 by date)

Member 11956239 23-Jan-17 23:29pm View    
in the above code i want to validate date doesn't allow the feature date and don't allow the 22/9/2016 before this past date
Member 11956239 23-Jan-17 23:27pm View    
<asp:TemplateField HeaderText="Distribution Start Date">
<itemtemplate>
<asp:TextBox ID="txtD" runat="server" Height="15px" MaxLength="50" onpaste="return false;"
onkeydown="return false;" Width="150px">
<ajaxControl:CalendarExtender ID="calExtDOB" runat="server" Enabled="True" Format="dd/MM/yyyy"
TargetControlID="txtD">


Member 11956239 23-Jan-17 0:34am View    
<%-- <asp:BoundField DataField="EFF_DATE" HeaderText="Date Of DISTRIBUTED STARTED" HeaderStyle-CssClass="allWidth100"
DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ControlStyle-CssClass="txtCommon allWidth80 txtCenter" />
<asp:templatefield>
<itemtemplate>
<asp:Label runat="server" ID="lnl1" Text='<%#DataBinder.Eval(Container.DataItem, "EFF_DATE").ToString()%>'>


<edititemtemplate>




--%>
Member 11956239 2-Nov-16 9:57am View    
My aim is want insert that data into the database
Member 11956239 11-Jan-16 4:18am View    
MOdel
>>>>>>>>>>>>>
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.ComponentModel.DataAnnotations;


namespace ResumeServicesApplication.Models
{
public class Model_tbl_user_personal_details
{
public int user_personaldetails_id { get; set; }
[Display(Name = "User Id")]
public int user_id { get; set; }
[Display(Name = "First Name")]
public string user_firstname { get; set; }
[Display(Name = "Middle Name")]
public string user_middlename { get; set; }
[Display(Name = "Last Name")]
public string user_lastname { get; set; }
[Display(Name = "Father Name")]
public string user_fathername { get; set; }
[Display(Name = "Gender")]
public string user_gender { get; set; }
[Display(Name = "Temparary Address 1")]
public string user_temporary_add1 { get; set; }
[Display(Name = "Temparary Address 2")]
public string user_temporary_add2 { get; set; }
[Display(Name = "Temparary Address 3")]
public string user_temporary_add3 { get; set; }
[Display(Name = "Temparary State")]
public string user_temporary_state { get; set; }
[Display(Name = "Temparary Country")]
public string user_temporary_country { get; set; }
[Display(Name = "Temparary Pin")]
public string user_temporary_pin { get; set; }
[Display(Name = "Perminant Address 1")]
public string user_permanent_add1 { get; set; }
[Display(Name = "Perminant Address 2")]
public string user_permanent_add2 { get; set; }
[Display(Name = "Perminant Address 3")]
public string user_permanent_add3 { get; set; }
[Display(Name = "Perminant State")]
public string user_permanent_state { get; set; }
[Display(Name = "Perminant Country")]
public string user_permanent_country { get; set; }
[Display(Name = "Perminant Pin")]
public string user_permanent_pin { get; set; }
[Display(Name = "Date Of Birth")]
public DateTime user_dob { get; set; }
[Display(Name = "Prefered Location")]
public string user_prefered_location { get; set; }
[Display(Name = "Hobbies")]
public string user_hobbies { get; set; }
[Display(Name = "Created By")]
public string user_created_by { get; set; }
[Display(Name = "Created Date")]
public DateTime user_created_date { get; set; }
[Display(Name = "Modified By")]
public string user_modified_by { get; set; }
[Display(Name = "Modified Date")]
public DateTime user_modified_date { get; set; }
[Display(Name = "Active")]
public byte user_personaldetails_isactive { get; set; }
}
}
DAL
>>>>>>>>>>>>>>>>>>>>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;


namespace ResumeServicesApplication.Models
{
public class DAL
{
SqlConnection _connectionDAL = new SqlConnection(ConfigurationManager.ConnectionStrings[Constents.connection].ConnectionString);

public int _SignUp(Model_tbl_user_personal_details _obj)
{

int active = 1;
int _result = 0;
_connectionDAL.Open();
SqlCommand _cmd = new SqlCommand("insert into tbl_user_personal_details values(@user_id,@user_firstname,@user_middlename,@user_lastname,@user_fathername,@user_gender,@user_temporary_add1,@user_temporary_add2,@user_temporary_add3,@user_temporary_state,@user_temporary_country,@user_temporary_pin,@user_permanent_add1,@user_permanent_add2,@user_permanent_add3,@user_permanent_state,@user_permanent_country,@user_permanent_pin,@user_dob,@user_prefered_location,@user_hobbies,@user_created_by,@user_created_date,@user_modified_by,@user_modified_date,@user_personaldetails