本文整理汇总了C#中DataLayer类的典型用法代码示例。如果您正苦于以下问题:C# DataLayer类的具体用法?C# DataLayer怎么用?C# DataLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataLayer类属于命名空间,在下文中一共展示了DataLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDashBoardContacts
public List<Patient_Contact> GetDashBoardContacts(long PatientID)
{
dl = new DataLayer();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Portal_GetDashBoardContacts";
cmd.Parameters.AddWithValue("PatientID", PatientID);
List<Patient_Contact> contacts = new List<Patient_Contact>();
DataTable dt = dl.Execute(cmd);
foreach (DataRow dr in dt.Rows)
{
Patient_Contact contact = new Patient_Contact
{
ID = Int64.Parse(dr["ID"].ToString()),
ContactName = dr["ContactName"].ToString(),
ContactType = dr["ContactType"].ToString(),
ContactPhoneNumber = dr["PhoneNumber"].ToString(),
Emergency = bool.Parse(dr["Emergency"].ToString())
};
contacts.Add(contact);
}
return contacts;
}
示例2: GetMediaGroups
public List<MediaGroup> GetMediaGroups()
{
DataLayer dal = new DataLayer();
dal.ConnectionString = ConectionString;
dal.Connect();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetMediaGroups";
DataTable dt = dal.Execute(cmd);
List<MediaGroup> MediaGroups = new List<MediaGroup>();
foreach (DataRow dr in dt.Rows)
{
MediaGroup mediagroup = new MediaGroup
{
MediaID = Int32.Parse(dr["MediaID"].ToString()),
MediaTitle = dr["MediaTitle"].ToString(),
MediaType = dr["MediaType"].ToString(),
DateCreated = DateTime.Parse(dr["DateCreated"].ToString())
};
MediaGroups.Add(mediagroup);
}
return MediaGroups;
}
示例3: GetEvent
public HopeEvent GetEvent(Int64 EventID )
{
dl = new DataLayer(pConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetEvent";
cmd.Parameters.AddWithValue("@EventID", EventID);
DataTable dt = dl.Execute(cmd);
foreach (DataRow dr in dt.Rows)
{
HopeEvent the_event = new HopeEvent
{
ID = Int64.Parse(dr["ID"].ToString()),
EventName = dr["EventName"].ToString(),
ShortDescription = dr["ShortDescription"].ToString(),
LongDescription = dr["LongDescription"].ToString(),
AdditionalInformation = dr["AdditionalInformation"].ToString(),
RegistrationInformation = dr["RegistrationInformation"].ToString(),
Sort = Int32.Parse(dr["Sort"].ToString()),
DateCreated = Convert.ToDateTime(dr["DateCreated"].ToString())
};
return the_event;
}
return null;
}
示例4: GetEventPictures
public List<EventPicture> GetEventPictures(Int64 EventID)
{
DataLayer dl = new DataLayer();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "[GetEventsPictures]";
cmd.Parameters.AddWithValue("@EventID", EventID);
List<EventPicture> Pictures = new List<EventPicture>();
DataTable dt = dl.Execute(cmd);
foreach (DataRow dr in dt.Rows)
{
EventPicture picture = new EventPicture
{
PictureID = Int64.Parse(dr["PictureID"].ToString()),
PictureURL = dr["PictureURL"].ToString(),
};
Pictures.Add(picture);
}
return Pictures;
}
示例5: frmDepartment
public frmDepartment(ref DataLayer objDL)
{
InitializeComponent();
m_DL = objDL;
InitializeUI();
}
示例6: btnSumbit_Click
protected void btnSumbit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
string sMemberName = "<i>Anonymous</i>";
if (User.Identity.IsAuthenticated)
{
if (!cbxAnonymous.Checked)
{
sMemberName = dl.GetFullMemberNameBy_Email(User.Identity.Name);
}
}
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = "[email protected];[email protected]";
mm.From = "[email protected]";
mm.Subject = "New \"Ask The Success Coach\" question!";
mm.Body = sMemberName + " submitted a question to the Success Coach.<br /><br />";
mm.Body += tbxQuestion.Text.Replace("\n", "<br />").Replace("\r", "");
SmtpMail.Send(mm);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Question Sent";
Session["resultMessage"] = "The Success Coach will answer your question in his next blog update.";
Session["resultReturnURL"] = "Blogs.aspx";
Response.Redirect("Result.aspx", true);
}
示例7: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (tbxCode.Text == Session["CaptchaImageText"].ToString())
{
if (this.IsValid)
{
DataLayer dl = new DataLayer();
dl.AddNonMember(tbxNonMemberEmail.Text, tbxNonMemberName.Text, true, true);
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = "[email protected];[email protected]";
mm.From = "[email protected]";
mm.Subject = "Someone signed up for the RNX free content.";
mm.Body = tbxNonMemberName.Text + " subscribed to the RNX free content using this email: " + tbxNonMemberEmail.Text;
SmtpMail.Send(mm);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Success!";
Session["resultMessage"] = "You have successfully subscribed to the RNX free content!";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx", true);
}
}
else
{
cvInvalidCode.IsValid = false;
}
}
示例8: lbtnQuotePost_Click
protected void lbtnQuotePost_Click(object sender, EventArgs e)
{
if (Request.QueryString["rt"] != null)
{
int iRTPostID = Convert.ToInt32(Request.QueryString["rt"]);
DataLayer dl = new DataLayer();
DataTable dtRTPost = dl.GetForumPostBy_PostID(iRTPostID);
rteBody.Value += "<div style=\"background-color:#ddddee; border: solid 2px #000077;padding:10px;\">";
rteBody.Value += dtRTPost.Rows[0].ItemArray[4].ToString();
rteBody.Value += "<br /><br /><div style=\"font-size: 12px;font-weight:bold;\">Posted by <a href=\"Profile.aspx?member=" + dtRTPost.Rows[0].ItemArray[2].ToString() + "\">";
rteBody.Value += dl.GetFullMemberNameBy_Email(dtRTPost.Rows[0].ItemArray[2].ToString());
rteBody.Value += "</a> on " + dtRTPost.Rows[0].ItemArray[3].ToString() + "</div></div><br />";
}
else
{
int iRTTopicID = Convert.ToInt32(Request.QueryString["topic"]);
DataLayer dl = new DataLayer();
DataTable dtRTTopic = dl.GetForumTopicBy_TopicID(iRTTopicID);
rteBody.Value += "<div style=\"background-color:#ddddee; border: solid 2px #000077;padding:10px;\">";
rteBody.Value += dtRTTopic.Rows[0].ItemArray[5].ToString();
rteBody.Value += "<br /><br /><div style=\"font-size: 12px;font-weight:bold;\">Posted by <a href=\"Profile.aspx?member=" + dtRTTopic.Rows[0].ItemArray[2].ToString() + "\">";
rteBody.Value += dl.GetFullMemberNameBy_Email(dtRTTopic.Rows[0].ItemArray[2].ToString());
rteBody.Value += "</a> on " + dtRTTopic.Rows[0].ItemArray[3].ToString() + "</div></div><br />";
}
}
示例9: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
try
{
OrgID = System.Convert.ToInt32(Session["TenantID"]);
}
catch (Exception ex)
{
try
{
OrgID = System.Convert.ToInt32(Request.QueryString["OrgID"]);
}
catch (Exception ex2)
{
}
}
DataLayer dl = new DataLayer();
string loginurl = dl.getNextService(OrgID,0,"User Login");
string registerurl = dl.getNextService(OrgID, 0, "User Registration");
login.HRef = loginurl;
register.HRef = registerurl;
if (Session["user"] != null)
Response.Redirect("members.aspx");
if (Session["user1"] != null)
Response.Redirect("CustomerPage.aspx");
}
示例10: GetMyChildrens
public DataTable GetMyChildrens()
{
DataLayer dl=new DataLayer();
Person myPersion=new Person();
DataTable dt = dl.GetStudentList(base.SchoolID, "-1", "", "", "-1", "-1", _pepoleID, "", "order by StudentNumber asc", 70, 1);
return dt;
}
示例11: ProcessInvoice
public string ProcessInvoice(DataLayer.Entities.Invoice invoice)
{
invoice.InvoiceDate = DateTime.Today.Date.ToShortDateString();
invoice.InvoiceNum = InvoiceNumberGenerator.GenerateInvoiceNumber();
return _repo.POSProcessInvoices(invoice);
}
示例12: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
UITextFieldCondition firstCondition = new UITextFieldCondition (delegate {
txtFirstName.ResignFirstResponder();
return false;
});
txtFirstName.ShouldReturn = firstCondition;
UITextFieldCondition secondCondition = new UITextFieldCondition (delegate {
txtSurname.ResignFirstResponder();
return false;
});
txtSurname.ShouldReturn = secondCondition;
UITextFieldCondition emailCondition = new UITextFieldCondition (delegate {
txtEMail.ResignFirstResponder();
return false;
});
txtEMail.ShouldReturn = emailCondition;
UITextFieldCondition mobileCondition = new UITextFieldCondition (delegate {
txtMobile.ResignFirstResponder();
return false;
});
txtMobile.ShouldReturn = mobileCondition;
btnUpdate.TouchUpInside += (object sender, EventArgs e) => {
DataLayer dl = new DataLayer();
string gender = "Female";
if (segGender.SelectedSegment == 1)
gender = "Male";
if (PersonID == 0)
{
List<Person> duplicates = dl.getPersonByName(txtFirstName.Text, txtSurname.Text);
if (duplicates.Count > 0)
PersonID = duplicates[0].ID;
}
PersonID = dl.updatePerson(PersonID, dl.GetCampusID(), txtFirstName.Text, txtSurname.Text, gender, dpDoB.Date,txtMobile.Text, txtEMail.Text, 0);
if (Relationship != 0)
{
switch (Relationship)
{
case 1:
dl.updateSpouse1(MarriedRelionshipID, PersonID);
break;
case 2:
dl.updateSpouse2(MarriedRelionshipID, PersonID);
break;
default:
dl.createParentRelationship(MarriedRelionshipID, PersonID, false);
break;
}
}
UINavigationController parent = this.NavigationController;
parent.PopViewControllerAnimated(true);
};
}
示例13: ExpenditureDetails
public ExpenditureDetails()
{
InitializeComponent();
_expenditures = new List<EXPENDITUREDETAIL>();
data = DataLayer.Instance;
dateOfExpenditure.SelectedDate = DateTime.Today;
}
示例14: GetDashBoardInsurance
public List<Insurance_DashBoard> GetDashBoardInsurance(long PatientID)
{
dl = new DataLayer();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Portal_GetDashBoardInsuranceProviders";
cmd.Parameters.AddWithValue("PatientID", PatientID);
List<Insurance_DashBoard> Insurances = new List<Insurance_DashBoard>();
DataTable dt = dl.Execute(cmd);
foreach (DataRow dr in dt.Rows)
{
Insurance_DashBoard Insurance = new Insurance_DashBoard
{
ID = Int64.Parse(dr["ID"].ToString()),
ProviderName = dr["ProviderName"].ToString(),
InsuranceType = dr["InsuranceType"].ToString(),
CreatedBy = dr["CreatedBy"].ToString(),
GroupNumber = dr["GroupNumber"].ToString(),
PolicyNumber = dr["PolicyNumber"].ToString(),
DateCreated = Convert.ToDateTime(dr["DateCreated"].ToString()),
};
Insurances.Add(Insurance);
}
return Insurances;
}
示例15: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
if (dl.EmailExists(tbxEmail.Text))
{
string sPassword = dl.GetMemberBy_Email(tbxEmail.Text).Rows[0].ItemArray[1].ToString();
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
MailMessage mm;
mm = new MailMessage();
mm.BodyFormat = MailFormat.Html;
mm.To = tbxEmail.Text;
mm.From = "[email protected]";
mm.Subject = "Your password for ReferralNetworX.com";
mm.Body = "You requested to have your password sent to you. It is listed below.<br /><br />Username: " + tbxEmail.Text + "<br />Password: " + sPassword;
SmtpMail.Send(mm);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Password Sent";
Session["resultMessage"] = "Your password has been sent to your email.";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx", true);
}
else
{
Session["resultColor"] = "#ff0000";
Session["resultTitle"] = "Email Not Found";
Session["resultMessage"] = "The email you provided was not found.";
Session["resultReturnURL"] = "Default.aspx";
Response.Redirect("Result.aspx", true);
}
}