in sql server : 2008
select object_name(referenced_object_id) as [primary table], object_name(parent_object_id) [child table]
from sys.foreign_keys
WHERE object_name(referenced_object_id) ='PatientMaster'
ORDER by object_name(parent_object_id)
in sql server : 2005
select o1.name, o2.name
from sysforeignkeys fk
join sysobjects o1 on o1.id = fk.fkeyid
join sysobjects o2 on o2.id = fk.rkeyid
where o2.name = 'PatientMaster'
11:55 PM |
Category: |
/*************.ascx page*********************/
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:TextBox ID="txtDate" runat="server" MaxLength="11"></asp:TextBox>
<ajax:CalendarExtender ID="clndrDate" runat="server" TargetControlID="txtDate" Format="MM/dd/yyyy"
CssClass="MyCalendar">
</ajax:CalendarExtender>
<div class="mandatory">
<asp:RequiredFieldValidator ID="reqUCDate" runat="server"
ControlToValidate="txtDate" Display="Dynamic" SetFocusOnError="true"
ErrorMessage="please select date" Text="*"></asp:RequiredFieldValidator>
<asp:RangeValidator
ID="rangeUCDate"
runat="server"
SetFocusOnError="true"
ControlToValidate="txtDate"
ErrorMessage="Please enter valid date"
Type="Date" Display="Dynamic"
Enabled="false" />
</div>
<input id="txtCurrDate" type="hidden" value="<%=DateTime.Now.AddHours(20).ToString("MM/dd/yyyy") %>"/>
<asp:TextBox ID="txtTempDate" Visible="false" runat="server" MaxLength="11"></asp:TextBox>
/*************. Code Behind Page *********************/
/// <summary>
/// This Control is use for Date Textbox with Calender control on page
/// For this control use on page some of functions are created in javascript for validation
/// </summary>
/// <CreatedBy>Khushant Dhingra</CreatedBy>
/// <CreatedDate>20/may/2011</CreatedDate>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//DateRequired = false;
}
}
#region Variable
private string date;
#endregion
#region Property
/// <summary>
/// This Property use for get and set date in dd MMM yyyy format
/// </summary>
/// <CreatedBy>Khushant Dhingra</CreatedBy>
/// <CreatedDate>20/may/2011</CreatedDate>
public string Date
{
get
{
date = txtDate.Text;
return date;
}
set
{
date = value;
if (date != string.Empty)
{
txtDate.Text = Convert.ToDateTime(date).ToString("MM/dd/yyyy");
}
else
{
txtDate.Text = "";
}
}
}
/// <summary>
/// This Property is used to set width of data control
/// </summary>
/// <CreatedBy>Khushant Dhingra</CreatedBy>
/// <CreatedDate>20/may/2011</CreatedDate>
public int DateControlWidth
{
set
{
txtDate.Width = value;
}
}
/// <summary>
/// This Property is used to set height of date control
/// </summary>
/// <CreatedBy>Khushant Dhingra</CreatedBy>
/// <CreatedDate>20/may/2011</CreatedDate>
public int DateControlHeight
{
set
{
txtDate.Height = value;
}
}
/// <summary>
/// This Property is used to make date cotrol read only
/// </summary>
/// <CreatedBy>Khushant Dhingra</CreatedBy>
/// <CreatedDate>20/may/2011</CreatedDate>
public bool DateControlReadOnly
{
set
{
txtDate.ReadOnly = value;
clndrDate.TargetControlID = "txtTempDate";
}
get
{
return txtDate.ReadOnly;
}
}
/// <summary>
/// This property used to make date mandatory
/// </summary>
/// <CreatedBy>Khushant Dhingra</CreatedBy>
/// <CreatedDate>20/may/2011</CreatedDate>
public bool DateRequired
{
set
{
reqUCDate.Enabled = value;
}
}
public string ValidationGroup
{
set
{
reqUCDate.ValidationGroup = value;
rangeUCDate.ValidationGroup = value;
}
}
#endregion
#region Methods
/// <summary>
/// Used to set maximum date
/// </summary>
/// <CreatedBy>Khushant Dhingra</CreatedBy>
/// <CreatedDate>20/may/2011</CreatedDate>
/// <param name="dt"></param>
public void DateMaximum(DateTime dt)
{
rangeUCDate.Enabled = true;
rangeUCDate.MaximumValue = dt.ToString("MM/dd/yyyy");
rangeUCDate.MinimumValue = new DateTime(1600, 01, 01).ToString("MM/dd/yyyy");
}
/// <summary>
/// Used to set minimum date
/// </summary>
/// <CreatedBy>Khushant Dhingra</CreatedBy>
/// <CreatedDate>20/may/2011</CreatedDate>
/// <param name="dt"></param>
public void DateMinimum(DateTime dt)
{
rangeUCDate.Enabled = true;
rangeUCDate.MinimumValue = dt.ToString("MM/dd/yyyy");
rangeUCDate.MaximumValue = DateTime.Now.AddYears(50).ToString("MM/dd/yyyy");
}
#endregion
3:11 AM |
Category: |
/*Below Different Tab controls themes*/
/* ajax__tab_xp-theme theme */
.Tab .ajax__tab_header
{
color: #4682b4;
font-family: Calibri;
font-size: 14px;
font-weight: bold;
background: url("../../Images/black_navi.jpg") repeat-x;
margin-left: 0px;
width: 980px;
height: 38px;
vertical-align: middle;
}
/*Body*/
.Tab .ajax__tab_body
{
border: 1px solid #b4cbdf;
padding-top: 0px;
width: 978px;
padding-bottom: 10px;
}
/*Tab Active*/
.Tab .ajax__tab_active .ajax__tab_tab
{
color: #75BECF;
background: url("../../Images/tab_active.gif") repeat-x;
height: 20px;
}
.Tab .ajax__tab_active .ajax__tab_inner
{
color: #75BECF;
background: url("../../Images/tab_active.gif") no-repeat left;
padding-left: 10px;
}
.Tab .ajax__tab_active .ajax__tab_outer
{
color: #75BECF;
background: url("../../Images/tab_active.gif") no-repeat right;
padding-right: 6px;
margin-top: 8px;
}
/*Tab Hover*/
.Tab .ajax__tab_hover .ajax__tab_tab
{
color: #75BECF;
background: url("../../Images/tab_hover.gif") repeat-x;
height: 20px;
}
.Tab .ajax__tab_hover .ajax__tab_inner
{
color: #75BECF;
background: url("../../Images/tab_hover.gif") no-repeat left;
padding-left: 10px;
}
.Tab .ajax__tab_hover .ajax__tab_outer
{
color: #75BECF;
background: url("../../Images/tab_hover.gif") no-repeat right;
padding-right: 6px;
}
/*Tab Inactive*/
.Tab .ajax__tab_tab
{
color: #ffffff;
background: url("../../Images/tab_Inactive.gif") repeat-x;
height: 20px;
}
.Tab .ajax__tab_inner
{
color: #ffffff;
background: url("../../Images/tab_inactive.gif") no-repeat left;
padding-left: 10px;
}
.Tab .ajax__tab_outer
{
padding-right: 6px;
margin-right: 1px;
border-right: 1px solid #FFFFFF;
}
/*Above Different Tab controls theme*/
/*Below Calendar controls themes*/
.MyCalendar .ajax__calendar_container
{
background-color: #e2e2e2;
border: solid 1px #cccccc;
}
.MyCalendar .ajax__calendar_header
{
background-color: #ffffff;
margin-bottom: 4px;
}
.MyCalendar .MyCalendar .ajax__calendar_next, .MyCalendar .ajax__calendar_prev
{
color: #004080;
padding-top: 3px;
}
.MyCalendar .ajax__calendar_title
{
color: #004080;
padding-bottom:5px;
}
.MyCalendar .ajax__calendar_body
{
background-color: #e9e9e9;
border: solid 1px #cccccc;
}
.MyCalendar .ajax__calendar_dayname
{
text-align: center;
font-weight: bold;
margin-bottom: 4px;
margin-top: 2px;
}
.MyCalendar .ajax__calendar_day
{
text-align: center;
}
.MyCalendar .ajax__calendar_hover .ajax__calendar_day, .MyCalendar .ajax__calendar_hover .ajax__calendar_month, .MyCalendar .ajax__calendar_hover .ajax__calendar_year, .MyCalendar .ajax__calendar_active
{
color: #004080;
font-weight: bold;
background-color: #ffffff;
}
.MyCalendar .ajax__calendar_today
{
font-weight: bold;
padding-top:0px;
padding-bottom:5px;
}
.MyCalendar .ajax__calendar_other, .MyCalendar .ajax__calendar_hover .ajax__calendar_today, .MyCalendar .ajax__calendar_hover .ajax__calendar_title
{
color: #bbbbbb;
}
/*Above Calendar controls theme*/
3:09 AM |
Category: |