本文整理汇总了C#中LoanManagement.Domain.finalContext类的典型用法代码示例。如果您正苦于以下问题:C# finalContext类的具体用法?C# finalContext怎么用?C# finalContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
finalContext类属于LoanManagement.Domain命名空间,在下文中一共展示了finalContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: wdw1_Loaded
private void wdw1_Loaded(object sender, RoutedEventArgs e)
{
try
{
ImageBrush myBrush = new ImageBrush();
System.Windows.Controls.Image image = new System.Windows.Controls.Image();
image.Source = new BitmapImage(
new Uri(AppDomain.CurrentDomain.BaseDirectory + "\\Icons\\bg5.png"));
myBrush.ImageSource = image.Source;
//Grid grid = new Grid();
wdw1.Background = myBrush;
using (var ctx = new finalContext())
{
FPaymentInfo fp = ctx.FPaymentInfo.Find(fId);
double n = 0;
n = fp.Amount * (fp.Loan.Service.DaifPenalty / 100);
lblDaif.Content = "(Fee: " + n.ToString("N2") + ")";
DaifFee = Double.Parse(n.ToString("N2"));
n = fp.Amount * (fp.Loan.Service.ClosedAccountPenalty / 100);
lblClosed.Content = "(Fee: " + n.ToString("N2") + ")";
ClosedFee = Double.Parse(n.ToString("N2"));
}
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
try
{
using (var ctx = new finalContext())
{
var set = ctx.OnlineSettings.Find(1);
lblVisitor.Text = set.Visitor.ToString();
}
lblTime.Text = DateTime.Now.ToString("MMM dd, yyyy | hh:mm tt");
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
Session["Service"] = null;
Session["iService"] = null;
if (Session["ID"] == null)
{
Response.Redirect("/Login.aspx");
}
using (var ctx = new finalContext())
{
int cID = Convert.ToInt32(Session["ID"]);
var clt = ctx.Clients.Find(cID);
lblUsername.Text = clt.Username;
}
}
catch (Exception)
{
Response.Redirect("/Login.aspx");
}
}
示例3: checkServices
private void checkServices()
{
try
{
using (var ctx = new finalContext())
{
string dept = "";
ComboBoxItem typeItem = (ComboBoxItem)cmbDept.SelectedItem;
string value = typeItem.Content.ToString();
if (value == "Both")
dept = "";
else
dept = value;
var ser = from s in ctx.Services
where s.Active == true && s.Department.Contains(dept)
select s;
cmbTOL.Items.Clear();
cmbTOL.Items.Add(new ComboBoxItem { Content = "All" });
foreach (var i in ser)
{
ComboBoxItem cb = new ComboBoxItem { Content = i.Name };
cmbTOL.Items.Add(cb);
}
}
}
catch (Exception)
{ return; }
}
示例4: GridView1_SelectedIndexChanged
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
int sID = Convert.ToInt32(dg1.SelectedRow.Cells[1].Text);
using (var ctx = new finalContext())
{
var ser = ctx.Services.Find(sID);
double ded = ser.AgentCommission;
var de = from d in ctx.Deductions
where d.ServiceID == sID
select d;
foreach (var itm in de)
{
ded = ded + itm.Percentage;
}
lblDeduction.Text = ded.ToString("N2") + "%";
lblAmt.Text = ser.MinValue.ToString("N2") + " to " + ser.MaxValue.ToString("N2");
lblDesc.Text = ser.Description;
lblInt.Text = ser.Interest.ToString() + "%";
lblTerm.Text = ser.MinTerm + " month(s) to " + ser.MaxTerm + " month(s)";
}
}
catch (Exception)
{
Response.Redirect("/Index.aspx");
}
}
示例5: reset
public void reset()
{
try
{
using (var ctx = new finalContext())
{
var lon = ctx.Loans.Find(lId);
var rmn = from rm in ctx.FPaymentInfo
where rm.LoanID == lId && rm.PaymentStatus == "Cleared"
select rm;
double r = 0;
foreach (var item in rmn)
{
r = r + item.Amount;
}
double remain = lon.ReleasedLoan.TotalLoan - r;
txtTerm.Text = lon.Term.ToString();
txtAmt.Text = remain.ToString("N2");
txtInt.Text = lon.Service.RestructureInterest.ToString();
cmbMode.Text = lon.Mode;
refresh();
}
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
示例6: rg
public void rg()
{
try
{
using (var ctx = new finalContext())
{
var lon = ctx.Loans.Find(lID);
var chq = from ch in ctx.Requirements
where ch.ServiceID == lon.ServiceID
&& !(from o in ctx.RequirementChecklists where o.LoanID==lID select o.RequirementId).Contains(ch.RequirementId)
select new { ReqNum = ch.RequirementNum, Requirement = ch.Name };
dg1.ItemsSource = chq.ToList();
var chq1 = from ch in ctx.RequirementChecklists
where ch.LoanID == lID
select new { ReqNum = ch.Requirement.RequirementNum, Requirement = ch.Requirement.Name, ConfirmedBy = ch.Employee.LastName + ", " + ch.Employee.FirstName, DateConfirmed = ch.DateConfirmed };
dg2.ItemsSource = chq1.ToList();
}
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
示例7: dgEmp_SelectionChanged
private void dgEmp_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
using (var ctx = new finalContext())
{
img.Visibility = Visibility.Visible;
var emp = ctx.Employees.Find(Convert.ToInt32(getRow(dgEmp, 0)));
byte[] imageArr;
imageArr = emp.Photo;
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.CreateOptions = BitmapCreateOptions.None;
bi.CacheOption = BitmapCacheOption.Default;
bi.StreamSource = new MemoryStream(imageArr);
bi.EndInit();
img.Source = bi;
lblName.Content = emp.FirstName + " " + emp.MI + ". " + emp.LastName + " " + emp.Suffix;
lblPosition.Content = "Position: " + emp.Position;
lblDept.Content = "Department: " + emp.Department;
}
}
catch (Exception ex)
{
//System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
示例8: wdw1_Loaded
private void wdw1_Loaded(object sender, RoutedEventArgs e)
{
try
{
dtDate.SelectedDate = DateTime.Today.Date;
ImageBrush myBrush = new ImageBrush();
System.Windows.Controls.Image image = new System.Windows.Controls.Image();
image.Source = new BitmapImage(
new Uri(AppDomain.CurrentDomain.BaseDirectory + "\\Icons\\bg5.png"));
myBrush.ImageSource = image.Source;
//Grid grid = new Grid();
wdw1.Background = myBrush;
using (var ctx = new finalContext())
{
var lon = ctx.Loans.Find(lId);
lblDesAmt.Content = "Php " + lon.LoanApplication.AmountApplied.ToString("N2");
lblDesTerm.Content = lon.Term.ToString();
txtAmt.Text = lon.LoanApplication.AmountApplied.ToString("N2");
if (status == "UApproval")
{
dtDate.SelectedDate = lon.ApprovedLoan.ReleaseDate;
txtAmt.Text = lon.ApprovedLoan.AmountApproved.ToString("N2");
btnApprove.Content = "Update Approval";
}
lblName.Content = lon.Client.LastName + ", " + lon.Client.FirstName + " " + lon.Client.MiddleName;
}
refr();
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
示例9: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
try
{
lblTime.Text = DateTime.Now.ToString("MMM dd, yyyy | hh:mm tt");
Session["Service"] = null;
Session["UpdateChecker"] = null;
Session["iService"] = null;
if (Session["Visit"] == null)
{
Session["Visit"] = "Visited";
using (var ctx = new finalContext())
{
var set = ctx.OnlineSettings.Find(1);
set.Visitor = set.Visitor + 1;
ctx.SaveChanges();
}
}
using (var ctx = new finalContext())
{
var set = ctx.OnlineSettings.Find(1);
lblDesc.Text = set.HomeDescription.Replace("\n", "<br />"); ;
lblVisitor.Text = set.Visitor.ToString();
}
}
catch (Exception)
{
Response.Redirect("/Index.aspx");
}
}
示例10: MetroWindow_Loaded_1
private void MetroWindow_Loaded_1(object sender, RoutedEventArgs e)
{
try
{
ImageBrush myBrush = new ImageBrush();
System.Windows.Controls.Image image = new System.Windows.Controls.Image();
image.Source = new BitmapImage(
new Uri(AppDomain.CurrentDomain.BaseDirectory + "\\Icons\\bg5.png"));
myBrush.ImageSource = image.Source;
wdw1.Background = myBrush;
if (status == "view")
{
using (var ctx = new finalContext())
{
var u = ctx.Users.Find(eId);
txtUserName.Text = u.Username;
txtUserName.IsEnabled = false;
}
}
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
try
{
using (var ctx = new finalContext())
{
var set = ctx.OnlineSettings.Find(1);
lblVisitor.Text = set.Visitor.ToString();
}
lblTime.Text = DateTime.Now.ToString("MMM dd, yyyy | hh:mm tt");
string tnum = Request.QueryString["id"];
using (var ctx = new finalContext())
{
var clt = ctx.Clients.Where(x => x.TrackingNumber == tnum).First();
if (clt.isRegistered == true)
{
Response.Redirect("/Index.aspx");
}
else
{
clt.isRegistered = true;
var exp = ctx.iClientExpirations.Find(clt.ClientID);
lblContent.Text = "Your currently registered account will be deleted if not confirmed on or before " + exp.ExpirationDate + "\n Please visit our office to confirm this account regarding the information. Thank You.";
Session["newID"] = null;
ctx.SaveChanges();
}
}
}
catch (Exception)
{
Response.Redirect("/Index.aspx");
}
}
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
try
{
using (var ctx = new finalContext())
{
var set = ctx.OnlineSettings.Find(1);
lblVisitor.Text = set.Visitor.ToString();
}
lblTime.Text = DateTime.Now.ToString("MMM dd, yyyy | hh:mm tt");
Session["Service"] = null;
Session["iService"] = null;
Session["UpdateChecker"] = null;
string path = @"F:/Loan Files/Downloads/";
List<String> lst = new List<String>();
foreach (string s in Directory.GetFiles(path).Select(Path.GetFileName))
lst.Add(s);
dg.DataSource = lst;
dg.DataBind();
foreach (GridViewRow row in dg.Rows)
{
LinkButton lb = (LinkButton)row.Cells[0].Controls[0];
lb.Text = "Download";
}
}
catch (Exception)
{
Response.Redirect("/Index.aspx");
}
}
示例13: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
try
{
lblTime.Text = DateTime.Now.ToString("MMM dd yyyy, | hh:mm tt");
Session["Service"] = null;
Session["UpdateChecker"] = null;
Session["iService"] = null;
using (var ctx = new finalContext())
{
var set = ctx.OnlineSettings.Find(1);
lblVisitor.Text = set.Visitor.ToString();
}
using(var ctx = new finalContext())
{
var set = ctx.OnlineSettings.Find(1);
lblAbout.Text = set.AboutDescription.Replace("\n", "<br />"); ;
lblMission.Text = set.MissionVision.Replace("\n", "<br />"); ;
lblContact.Text = set.ContactInfo.Replace("\n", "<br />"); ;
}
}
catch (Exception)
{
Response.Redirect("/Index.aspx");
}
}
示例14: wdw1_Loaded
private void wdw1_Loaded(object sender, RoutedEventArgs e)
{
try
{
ImageBrush myBrush = new ImageBrush();
System.Windows.Controls.Image image = new System.Windows.Controls.Image();
image.Source = new BitmapImage(
new Uri(AppDomain.CurrentDomain.BaseDirectory + "\\Icons\\bg5.png"));
myBrush.ImageSource = image.Source;
wdw1.Background = myBrush;
if (status == "View")
{
using (var ctx = new finalContext())
{
Domain.Position pos = ctx.Positions.Find(pID);
txtPosition.Text = pos.PositionName;
txtDesc.Text = pos.Description;
btnSave.Content = "Save";
}
}
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
示例15: btnLogin_Click
protected void btnLogin_Click(object sender, EventArgs e)
{
try
{
using (var ctx = new finalContext())
{
var ctr1 = ctx.Clients.Where(x => x.Username == txtUsername.Text && x.Password == txtPassword.Text && x.isRegistered == true).Count();
if (ctr1 > 0)
{
var clt = ctx.Clients.Where(x => x.Username == txtUsername.Text && x.Password == txtPassword.Text && x.isRegistered == true).First();
Session["ID"] = clt.ClientID;
Session["NAME"] = clt.LastName + ", " + clt.FirstName;
Response.Redirect("/Index.aspx");
}
else
{
lclCheck.Visible = true;
}
}
}
catch (Exception)
{
Response.Redirect("/Index.aspx");
}
}