本文整理汇总了C#中LoanManagement.Domain.finalContext类的典型用法代码示例。如果您正苦于以下问题:C# finalContext类的具体用法?C# finalContext怎么用?C# finalContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
finalContext类属于LoanManagement.Domain命名空间,在下文中一共展示了finalContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:30,代码来源:wpfChequeReturning.xaml.cs
示例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");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:29,代码来源:MyAccount_Edit.aspx.cs
示例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; }
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:30,代码来源:wpfReportForLoans.xaml.cs
示例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");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:28,代码来源:Services.aspx.cs
示例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;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:29,代码来源:wpfLoanRestructure.xaml.cs
示例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;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:26,代码来源:wpfRequirementsChecklist.xaml.cs
示例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;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:28,代码来源:wpfUsers.xaml.cs
示例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;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:35,代码来源:wpfLoanApproval.xaml.cs
示例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");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:32,代码来源:Index.aspx.cs
示例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;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:27,代码来源:wpfUserInfo.xaml.cs
示例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");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:33,代码来源:Confirmation.aspx.cs
示例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");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:31,代码来源:Downloads.aspx.cs
示例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");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:28,代码来源:About.aspx.cs
示例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;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:28,代码来源:wpfPositionInfo.xaml.cs
示例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");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:25,代码来源:Login.aspx.cs
示例16: 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;
resetGrid();
using (var ctx = new finalContext())
{
var usr = ctx.Employees.Find(UserID);
var pos = ctx.PositionScopes.Find(usr.PositionID);
if (pos.UScopes == true)
{
btnScope.IsEnabled = true;
}
else
{
btnScope.IsEnabled = false;
}
}
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:33,代码来源:wpfPosition.xaml.cs
示例17: 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["UpdateChecker"] = null;
Session["Service"] = null;
Session["iService"] = null;
using (var ctx = new finalContext())
{
var ser = from se in ctx.Services
where se.Active == true
select new { ServiceNumber = se.ServiceID, Name = se.Name, Department = se.Department, Type = se.Type };
dg1.DataSource = ser.ToList();
dg1.DataBind();
}
}
catch (Exception)
{
Response.Redirect("/Index.aspx");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:27,代码来源:Services.aspx.cs
示例18: reset
private void reset()
{
using (var ctx = new finalContext())
{
var lon = ctx.Loans.Find(lId);
lblName.Content = name;
byte[] imageArr;
imageArr = lon.Client.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;
lblAmt.Content = lon.ReleasedLoan.Principal.ToString("N2");
string[] mdt = lon.ReleasedLoan.DateReleased.ToString().Split(' ');
string d = mdt[0];
lblDt.Content = d;
lblMode.Content = lon.Mode;
lblTOL.Content = lon.Service.Name;
lblType.Content = lon.Service.Type;
lblHF.Content = ctx.FPaymentInfo.Where(x => x.PaymentStatus.Contains("Due") && x.LoanID==lId).Count().ToString();
var ctr = ctx.FPaymentInfo.Where(x => x.PaymentStatus == "Cleared" && x.LoanID == lId).Count();
if (ctr > 0)
{
var lst = ctx.FPaymentInfo.Where(x => x.PaymentStatus == "Cleared" && x.LoanID == lId);
int n = 1;
var str = "";
foreach (var itm in lst)
{
if (n == ctr)
{
str = itm.ClearCheque.DateCleared.ToString().Split(' ')[0];
}
}
lblLastP.Content = str;
}
else
{
lblLastP.Content = "-";
}
var sm = ctx.FPaymentInfo.Where(x => x.PaymentStatus != "Cleared" && x.LoanID == lId);
double sum = 0;
foreach (var itm in sm)
{
sum = sum + itm.Amount;
}
lblRemaining.Content = sum.ToString("N2");
var sm2 = ctx.FPaymentInfo.Where(x => x.PaymentStatus.Contains("Due") && x.LoanID == lId);
sum = 0;
foreach (var itm in sm2)
{
sum = sum + itm.Amount;
}
lblBal.Content = sum.ToString("N2");
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:59,代码来源:wpfLoanInfo.xaml.cs
示例19: btnContinue_Click
private void btnContinue_Click(object sender, RoutedEventArgs e)
{
try
{
MessageBoxResult mr = MessageBox.Show("Are you sure you want to proceed?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (mr == MessageBoxResult.Yes)
{
if (rdDaif.IsChecked == true)
{
using (var ctx = new finalContext())
{
FPaymentInfo fp = ctx.FPaymentInfo.Find(fId);
ReturnedCheque rc = new ReturnedCheque { DateReturned = DateTime.Today.Date, Fee = DaifFee, FPaymentInfoID = fId, Remarks = "DAIF", isPaid = false };
fp.PaymentStatus = "Returned";
ctx.ReturnedCheques.Add(rc);
AuditTrail at = new AuditTrail { EmployeeID = UserID, DateAndTime = DateTime.Now, Action = "Processed returned cheque " + fp.ChequeInfo };
ctx.AuditTrails.Add(at);
ctx.SaveChanges();
MessageBox.Show("Okay", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
this.Close();
}
}
else
{
using (var ctx = new finalContext())
{
FPaymentInfo fp = ctx.FPaymentInfo.Find(fId);
ClosedAccount cc = new ClosedAccount { DateClosed = DateTime.Today.Date, Fee = ClosedFee, LoanID = fp.LoanID, isPaid = false };
//fp.PaymentStatus = "Returned";
fp.Loan.Status = "Closed Account";
ctx.ClosedAccounts.Add(cc);
var chq = from c in ctx.FPaymentInfo
where c.PaymentStatus != "Cleared" && c.LoanID==fp.LoanID
select c;
foreach (var item in chq)
{
item.PaymentStatus = "Void";
}
AuditTrail at = new AuditTrail { EmployeeID = UserID, DateAndTime = DateTime.Now, Action = "Processed returned cheque " + fp.ChequeInfo };
ctx.AuditTrails.Add(at);
ctx.SaveChanges();
MessageBox.Show("Transaction has been successfully processed", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
this.Close();
}
}
}
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:58,代码来源:wpfChequeReturning.xaml.cs
示例20: btnSave_Click
private void btnSave_Click(object sender, RoutedEventArgs e)
{
try
{
if (txtPosition.Text == "Administrator")
{
System.Windows.MessageBox.Show("Administrator cannot be used as position name", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
if (status == "Add")
{
using (var ctx = new finalContext())
{
var ctr = ctx.Positions.Where(x => x.PositionName == txtPosition.Text).Count();
if (ctr > 0)
{
System.Windows.MessageBox.Show("Position already exists.", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
Domain.Position pos = new Domain.Position { PositionName = txtPosition.Text, Description = txtDesc.Text };
PositionScope scp = new PositionScope { MAgent = false, MClient = false, MHoliday = false, MBank = false, MEmployee = false, MPosition = false, MRegistration = false, MService = false, TApplication = false, TApproval = false, TCollection = false, TManageClosed = false, TOnlineConfirmation = false, TPaymentAdjustment = false, TPayments = false, TReleasing = false, TResturcture = false, UArchive = false, UBackUp = false, UOnlineSettings = false, UReports = false, UScopes = false, UStatistics = false, UUserAccounts = false };
ctx.Positions.Add(pos);
AuditTrail at = new AuditTrail { EmployeeID = UserID, DateAndTime = DateTime.Now, Action = "Added new Position " + txtPosition.Text };
ctx.AuditTrails.Add(at);
ctx.SaveChanges();
scp.PositionID = pos.PositionID;
ctx.PositionScopes.Add(scp);
ctx.SaveChanges();
System.Windows.MessageBox.Show("Record has been successfully added", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
this.Close();
}
}
else
{
using (var ctx = new finalContext())
{
Domain.Position pos = ctx.Positions.Find(pID);
pos.PositionName = txtPosition.Text;
pos.Description = txtDesc.Text;
AuditTrail at = new AuditTrail { EmployeeID = UserID, DateAndTime = DateTime.Now, Action = "Updated Position " + txtPosition.Text };
ctx.AuditTrails.Add(at);
ctx.SaveChanges();
System.Windows.MessageBox.Show("Record has been successfully updated", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
this.Close();
}
}
}
catch (Exception ex)
{
System.Windows.MessageBox.Show("Runtime Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
开发者ID:stisf-g1,项目名称:LoanManagement,代码行数:58,代码来源:wpfPositionInfo.xaml.cs
注:本文中的LoanManagement.Domain.finalContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论