private void UserControl_Loaded_1(object sender, RoutedEventArgs e) { vCityList.DataContext = GetTable(); vCityList.DisplayMemberPath = "VCityName"; vCityList.SelectedValuePath = "VCityName"; Globalized.ShowMsg(lblErrorMsg); }
private void InsertRecord() { dhItems objInsert = new dhItems(); objInsert = (dhItems)this.ItemGrid_.DataContext; DataSet ds = iFacedeLayer.iFacede.InsertUpdateItem(Globalized.ObjDbName, objInsert); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["iItemID"].ToString() != "-1") { if (objInsert.IUpdate == 1) { Globalized.SetMsg("I02", DataHolders.MsgType.Info); } else { Globalized.SetMsg("I01", DataHolders.MsgType.Info); objInsert.IUpdate = 1; } AddItemViewModel ObjSetToEdit = new AddItemViewModel(objInsert); Globalized.LoadThisObject(ObjSetToEdit, "Edit Item '" + objInsert.VItemName + "'", Globalized.AppModuleList.Where(xx => xx.VModuleName == "Store").FirstOrDefault().VShortDescription); } else{ Globalized.SetMsg("I013", MsgType.Error); Globalized.ShowMsg(lblErrorMsg); } } }
private void vEmployeeMobileTextBox_KeyDown(object sender, KeyEventArgs e) { try { Boolean Have = Globalized.NumaricKey.Contains(e.Key); if (!Globalized.NumaricKey.Contains(e.Key)) { e.Handled = false; } ////char c = (char)e.Key; ////if (Char.IsLetterOrDigit(c)) { //if (!char.IsControl(c) && !char.IsDigit(c) && c != '.') //{ // e.Handled = true; //} //// only allow one decimal point //if (c == '.' && (sender as TextBox).Text.IndexOf('.') > -1) //{ // e.Handled = true; //} } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
//private void SalaryDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) //{ // try // { // SelectedSalary = SalaryDataGrid.SelectedItem as dhSalary; // ChangeSalary(SelectedSalary); // } // catch (Exception ex) // { // Globalized.setException(ex, lblErrorMsg, MsgType.Error); // } //} private void ChangeSalary(dhSalary dhsal) { try { this.SalleryBox.DataContext = dhsal; if (dhsal.bIsPaid == true) { txtIAbsentdays.IsEnabled = false; txtIOverTimeAmount.IsEnabled = false; txtiDeduction.IsEnabled = false; dddEndDate.IsEnabled = false; CalculateSallary(); this.gnrtSalary.Content = "Paid"; } else { txtIAbsentdays.IsReadOnly = true; txtIOverTimeAmount.IsReadOnly = true; txtiDeduction.IsReadOnly = true; dddEndDate.IsEnabled = true; CalculateSallary(); this.gnrtSalary.Content = "Pay Salary"; } } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void Button_Click_2(object sender, RoutedEventArgs e) { try { // Button SenderBtn = sender as Button; if (gnrtSalary.Content.ToString() == "Calculate") { if (SalleryBox.DataContext != null) { GenrateSallary((dhSalary)(SalleryBox.DataContext)); } else { GenrateSallary(); } return; } if (gnrtSalary.Content.ToString() == "Save") { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Once Salary is generated you will be unable to Edit, please double check the calculation. Click Yes to generate, No to change.", "Salary Confirmation", System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Information); if (messageBoxResult == MessageBoxResult.Yes) { SaveSalary(); return; } } if (gnrtSalary.Content.ToString() == "Pay Salary") { if (SalleryBox.DataContext != null) { PaySalary(); this.SalleryBox.DataContext = new dhSalary(); this.gnrtSalary.Content = "Calculate"; return; } } if (gnrtSalary.Content.ToString() == "Calculate") { if (SalleryBox.DataContext != null) { GenrateSallary((dhSalary)(SalleryBox.DataContext)); // BindSalary(); } else { GenrateSallary(); // BindSalary(); } return; } } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void loadData() { // get data dsGeneral.dtAppPreferenceDataTable dt = iFacede.GetAppPreference(Globalized.ObjDbName, GlobalObjPreference); // intialize object if (dt.Rows.Count > 0) { ObservableCollection <dhAppPreference> listItem = ReflectionUtility.DataTableToObservableCollection <dhAppPreference>(dt); if (listItem.Count > 0) { GlobalObjPreference = listItem.Cast <dhAppPreference>().SingleOrDefault(); GlobalObjPreference.IUpdate = 1; // GlobalObjPreference.ImgCompanyLogo =(byte[])dt.Rows[0]["imgCompanyLogo"]; GlobalObjPreference.ImgCompanyLogo = !string.IsNullOrEmpty(dt.Rows[0]["imgCompanyLogo"].ToString()) ? (byte[])dt.Rows[0]["imgCompanyLogo"] : null; GlobalObjPreference.VCompanyName = !string.IsNullOrEmpty(dt.Rows[0]["vCompanyName"].ToString()) ? dt.Rows[0]["VCompanyName"].ToString() : null; GlobalObjPreference.VHeaderAdress = !string.IsNullOrEmpty(dt.Rows[0]["vHeaderAdress"].ToString()) ? dt.Rows[0]["vHeaderAdress"].ToString() : null; GlobalObjPreference.VCompanyMobile = !string.IsNullOrEmpty(dt.Rows[0]["vCompanyMobile"].ToString()) ? dt.Rows[0]["vCompanyMobile"].ToString() : null; // VSaleType.SelectedItem = GlobalObjPreference.VSaleType; this.DataContext = GlobalObjPreference; cstmUtilities.LoadImage(GlobalObjPreference.ImgCompanyLogo, image1); //VSaleType.SelectedValue = GlobalObjPreference.VSaleType; //Globalized.ObjPrefernce = GlobalObjPreference; } } else { GlobalObjPreference.IUpdate = 0; GlobalObjPreference = new dhAppPreference(); this.DataContext = GlobalObjPreference; } Globalized.ShowMsg(lblErrorMsg); //Globalized.SetMsg(null); }
private void ShowAccount_Click_1(object sender, RoutedEventArgs e) { try { dhTransactionList objtoBind = new dhTransactionList(); objtoBind.IAccountID = ((dhEmployee)EmpInfo.DataContext).IAccountid; objtoBind.BShowBlance = true; objtoBind.WinTitle = "Account Transactions Detail of ‘" + GlobalObjEmployee.VEmpfName + "’ Account Number ‘" + GlobalObjEmployee.VAccountNo + "’"; objtoBind.WinHeading = objtoBind.WinTitle; objtoBind.WinDetial = ""; lstTransaction ObjAcctountWin = new lstTransaction(objtoBind); //objPre.docview1.Document = xps.GetFixedDocumentSequence(); Window window = new Window { Title = objtoBind.WinTitle, Content = ObjAcctountWin, Height = 600, // just added to have a smaller control (Window) Width = 915, ResizeMode = ResizeMode.NoResize }; window.ShowDialog(); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
//private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e) //{ // UserControl usc = null; // GridMain.Children.Clear(); // switch (((ListViewItem)((ListView)sender).SelectedItem).Name) // { // case "ItemHome": // usc = new PartyView(); // GridMain.Children.Add(usc); // break; // case "ItemCreate": // usc = new PartyView(); // GridMain.Children.Add(usc); // break; // default: // break; // } //} private void LoadComponent() { dhDBnames objDBNames = new dhDBnames(); objDBNames.ServerName = System.Configuration.ConfigurationManager.AppSettings["ServerName"].ToString(); objDBNames.Default_DB_Name = System.Configuration.ConfigurationManager.AppSettings["DBName"].ToString(); objDBNames.DBUser = System.Configuration.ConfigurationManager.AppSettings["DBUser"].ToString(); objDBNames.DBPassword = System.Configuration.ConfigurationManager.AppSettings["DBPassword"].ToString(); string path = AppDomain.CurrentDomain.BaseDirectory;//System.Reflection.Assembly.GetExecutingAssembly().Location; objDBNames.XmlFilePath = path + "XMLFiles\\" + System.Configuration.ConfigurationManager.AppSettings["DBXmlFilePath"].ToString(); Globalized.ObjDbName = objDBNames; if (Globalized.objAppPreference == null) { dsGeneral.dtAppPreferenceDataTable dtApp = iFacede.GetAppPreference(Globalized.ObjDbName, objAppPreference); ObservableCollection <dhAppPreference> sequence = ReflectionUtility.DataTableToObservableCollection <dhAppPreference>(dtApp); if (sequence.Count > 0) { objAppPreference = sequence[0]; //objAppPreference.ImgCompanyLogo = (System.Byte[])dtApp.Rows[0]["ImgCompanyLogo"]; objAppPreference.VEnableModules = string.IsNullOrEmpty(dtApp.Rows[0]["vEnableModules"].ToString()) ? "" : dtApp.Rows[0]["vEnableModules"].ToString(); objAppPreference.ImgCompanyLogo = !string.IsNullOrEmpty(dtApp.Rows[0]["imgCompanyLogo"].ToString()) ? (byte[])dtApp.Rows[0]["imgCompanyLogo"] : null; objAppPreference.VCompanyName = !string.IsNullOrEmpty(dtApp.Rows[0]["vCompanyName"].ToString()) ? dtApp.Rows[0]["VCompanyName"].ToString() : null; Globalized.objAppPreference = objAppPreference; // cstmUtilities.LoadImage(Globalized.objAppPreference.ImgCompanyLogo, Image1); // this.AppName.Text = String.IsNullOrEmpty(Globalized.objAppPreference.VApplicationName) ? "POS" : Globalized.objAppPreference.VApplicationName; this.CompanyName.Text = String.IsNullOrEmpty(Globalized.objAppPreference.VCompanyName) ? "ABFA" : Globalized.objAppPreference.VCompanyName; // ModernWindow Obj = (ModernWindow)Application.Current.MainWindow; // Obj.Title = String.IsNullOrEmpty(Globalized.objAppPreference.VApplicationName) ? "POS" : Globalized.objAppPreference.VApplicationName; ////this.lblErrorMsg.Visibility = Visibility.Hidden; ////this.UserName.Text = ""; ////this.Password.Password = ""; //= sequence; } else { Globalized.SetMsg("Application is Not Initialized Properly please contact support team. ", MsgType.Error); // lblErrorMsg.Visibility = System.Windows.Visibility.Visible; // Globalized.ShowMsg(lblErrorMsg); } } //byte[] img = (byte[])objAppPreference.ImgCompanyLogo; //MemoryStream str = new MemoryStream(); // str.Write(img, 0, img.Length); // BitmapImage bit = new BitmapImage(str); //byte[] objimg = (byte[])objAppPreference.ImgCompanyLogo; //imgCompanyLogo.DataContext = ImageFromBytearray(objimg); // byte[] bytImageDataBytes = objAppPreference.ImgCompanyLogo; //// byte[] bytImageDataBytes = (byte[])objAppPreference.ImgCompanyLogo.; // System.IO.MemoryStream ms = new System.IO.MemoryStream(bytImageDataBytes); // ms.Seek(0, System.IO.SeekOrigin.Begin); // BitmapImage newBitmapImage = new BitmapImage(); // newBitmapImage.BeginInit(); // newBitmapImage.StreamSource = ms; // newBitmapImage.EndInit(); // imgCompanyLogo.Source = newBitmapImage;//ConvertToImage(objAppPreference.ImgCompanyLogo); }
private void BtnDeleteProc_Click(object sender, RoutedEventArgs e) { try { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { if (ObjToEditPro != null) { dhDocProcedures obj = MyViewModel.db.DocProcedures.Find(ObjToEditPro.IDocProceduresId); if (obj != null) { obj.BIsActive = false; MyViewModel.db.SaveChanges(); MyViewModel.ObjNewDoctor.DocProcedures.Remove(ObjToEditPro); this.DocProcedures.ItemsSource = this.MyViewModel.ObjNewDoctor.DocProcedures; } else { MyViewModel.ObjNewDoctor.DocProcedures.Remove(ObjToEditPro); this.DocProcedures.ItemsSource = this.MyViewModel.ObjNewDoctor.DocProcedures; } } MyViewModel.ObjNewDoctor.DocProcedures = MyViewModel.GetDocProcedures(); Globalized.SetMsg("DOC04", DataHolders.MsgType.Info); Globalized.ShowMsg(lblErrorMsg); } } catch (Exception ex) { // throw; } }
// dhParty GlobalObjParty = new dhParty(); public AddPartyView(dhParty Obj) { InitializeComponent(); dhSaleMan objSaleMan = new dhSaleMan(); Globalized.ShowMsg(lblErrorMsg); }
private void Button_Click_1(object sender, RoutedEventArgs e) { try { InsertUpdateAccount(); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void UserControl_Loaded_1(object sender, RoutedEventArgs e) { try { LoadData(); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void dddEndDate_LostFocus(object sender, RoutedEventArgs e) { try { CalculateDays(); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void txtIOverTimeAmount_LostFocus(object sender, RoutedEventArgs e) { try { UpdateSource(sender); CalculateSallary(); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void InsertUpdateAccount() { dhAccount objInsert = new dhAccount(); objInsert = (dhAccount)this.AccountDt.DataContext; dhAccountValidator validator = new dhAccountValidator(); FluentValidation.Results.ValidationResult results = validator.Validate(objInsert); bool validationSucceeded = results.IsValid; IList <ValidationFailure> failures = results.Errors; if (validationSucceeded) { if (this.vAccountType.SelectedValue != null) { objInsert.IFinaceType = Convert.ToInt32(this.vAccountType.SelectedValue.ToString()); } else { throw new ApplicationException("Please Select Account Type."); } DataSet ds = iFacede.InsertUpdateAccount(Globalized.ObjDbName, objInsert); if (ds.Tables[0].Rows.Count > 0) { if (objInsert.IUpdate == 1) { string msg = "Account '" + objInsert.AccountName + "' information is updated successfully."; Globalized.setException(msg, lblErrorMsg, DataHolders.MsgType.Info); //Globalized.SetMsg(msg, DataHolders.MsgType.Info); //Globalized.ShowMsg(lblErrorMsg); } else { System.Media.SystemSounds.Beep.Play(); lblErrorMsg.Visibility = Visibility.Hidden; Globalized.SetMsg("New Acount '" + objInsert.AccountName + "' is added successfully.", DataHolders.MsgType.Info); objTodisplay.IUpdate = 1; this.DataContext = objTodisplay; Globalized.ShowMsg(lblErrorMsg); } } Globalized.AccountListOptimizated(); } else { throw new ApplicationException(failures.First().ErrorMessage); } }
private void UserControl_Loaded_1(object sender, RoutedEventArgs e) { Globalized.ShowMsg(lblErrorMsg); //if ((GlobalDhItem == null) && (GlobalDhItem.IUpdate != 1)) //{ // GlobalDhItem = new dhItems(); // if (Globalized.ObjCurrentUser.BCanMakeEditAble != false) // { // this.bIsEditable.Visibility = Visibility.Visible; // } //} }
private void showall_Click(object sender, RoutedEventArgs e) { try { ObjFilterObject = new dhAccount(); loadData(ObjFilterObject); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void btnCancel_Click(object sender, RoutedEventArgs e) { try { Reset(); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void Button_Click_2(object sender, RoutedEventArgs e) { try { dhAccount objSearchAccount = new dhAccount(); // objSearchAccount = (dhAccount)AccountSearchBox.DataContext; // objSearchAccount.VUserType = string.IsNullOrEmpty(VUserType.SelectedValue.ToString()) ? null : VUserType.SelectedValue.ToString(); loadData(objSearchAccount, true); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void AccountControl_Loaded_1(object sender, RoutedEventArgs e) { try { //string abc = iFacede.GetProcessorID(); //AccountSearchBox.DataContext = new dhAccount(); //VUserType.SelectedValue = ""; loadData(GlobalDhAccount); } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void SaveAppointment(object sender, RoutedEventArgs e) { try { blAppointment objBlAppointment = new blAppointment(); dhAppointment ObjNewAppointment = (dhAppointment)this.AppointmentInfo.DataContext; // cehck for patient dhPatient ObjPatient = (dhPatient)this.PatientInformationGrid.DataContext; // doctor long iDocId = ((dhDoctorView)this.DoctorInformationGrid.DataContext).IDocid; dhDoctors objDoc = MyViewModel.db.Doctors.AsNoTracking().Where(x => x.IDocid == iDocId && x.BActive == true).FirstOrDefault(); if (objDoc == null) { return; } if (ObjPatient.iPatid == 0 || ObjPatient.iPatid < 0) { BlPatient objBl = new BlPatient(); objBl.AddNewPatient(ObjPatient); // need to save the patient first //MyViewModel.db.Patients.Add(ObjPatient); //MyViewModel.db.SaveChanges(); // set for patatient id ObjNewAppointment.IPatid = ObjPatient.iPatid; } // check for doctors if (ObjNewAppointment != null) { Dictionary <long, string> objDic = objBlAppointment.GetNextToken(objDoc, ObjNewAppointment); ObjNewAppointment.FormatedTokenNumber = objDic.First().Value; ObjNewAppointment.IToken_Number = objDic.First().Key; MyViewModel.db.Appointments.Add(ObjNewAppointment); MyViewModel.db.SaveChanges(); } this.AppointmentInfo.DataContext = ObjNewAppointment; Globalized.SetMsg("AOC01", DataHolders.MsgType.Info); Globalized.ShowMsg(lblErrorMsg); } catch (Exception ex) { Globalized.SetMsg(ex.Message, MsgType.Error); Globalized.ShowMsg(lblErrorMsg); } }
private void loadData(dhEmployee objEmployee, Boolean ShowResultCount = false) { dsGeneral.dtEmployeeDataTable dtEmployee = iFacede.GetEmployee(Globalized.ObjDbName, objEmployee); sequence = ReflectionUtility.DataTableToObservableCollection <dhEmployee>(dtEmployee); EmployeeList.ItemsSource = sequence; // pageControl.PageContract = null; //pageControl.PageContract = this; Globalized.ShowMsg(lblErrorMsg); // show msg for local search if ((ShowResultCount) && (sequence != null)) { String msg = String.Format(" {0} Search Results Found", sequence.Count); //pageControl.ReLoad(); Globalized.setException(msg, lblErrorMsg, DataHolders.MsgType.Info); } }
private void InvestigationList_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == Key.Enter) { if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)) { // MessageBox.Show("Shift + Enter pressed"); // return true; e.Handled = true; var child = Globalized.FindChildByType <TextBox>(InvestigationList); child.Text = ""; child.Focus(); // this.btnSaveDoctor.IsDefault = false; } } }
private void Stock_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (sender != null) { DataGridRow dgr = sender as DataGridRow; // get the obect and then Invoice ID opne the Id in readonly mode dhParty objTodisplay = new dhParty(); objTodisplay = ((dhParty)dgr.Item); if (objTodisplay != null) { objTodisplay.IUpdate = 1; AddPartyViewModel ObjSetToEdit = new AddPartyViewModel(objTodisplay); //objvm.SelectToEdit(new AddPartyViewModel(objTodisplay)); Globalized.LoadThisObject(ObjSetToEdit, "Edit Party '" + objTodisplay.VPartyName + "'", Globalized.AppModuleList.Where(xx => xx.VModuleName == "Party").FirstOrDefault().VShortDescription); } } }
private void vLandlineNumberTextBox_KeyDown_1(object sender, KeyEventArgs e) { try { if (Globalized.NumaricKey.Contains(e.Key)) { e.Handled = false; } else { e.Handled = true; } } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); } }
private void PaySalary() { dhSalary ObjSalaryInsert = new dhSalary(); ObjSalaryInsert = (dhSalary)this.SalleryBox.DataContext; ObjSalaryInsert.iEmpId = GlobalObjEmployee.IEmpid; ObjSalaryInsert.IUpdate = 1; ObjSalaryInsert.bIsPaid = true; DataSet ds = iFacede.InsertUpdateSalary(Globalized.ObjDbName, ObjSalaryInsert); if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { Globalized.setException("Select Salary is Marked As Paid.", lblSalarymsg, DataHolders.MsgType.Info); return; } } }
private void btnBrows_Click_1(object sender, RoutedEventArgs e) { try { FileDialog fldlg = new OpenFileDialog(); fldlg.InitialDirectory = Environment.SpecialFolder.MyPictures.ToString(); fldlg.Filter = "Image File (*.jpg;*.bmp)|*.jpg;*.bmp"; if ((fldlg.ShowDialog() == true) && (fldlg.FileName != "")) { FileInfo fileInfo = new FileInfo(fldlg.FileName); if (ValidFile(fldlg.FileName, 102400, 250, 100)) { // Image is valid and U can // Do something with image // For example set it to a picture box txtFileName.Text = fldlg.FileName; ImageSourceConverter isc = new ImageSourceConverter(); image1.Source = (ImageSource)isc.ConvertFromString(txtFileName.Text.ToString()); // image1.SetValue(Image.SourceProperty, isc.ConvertFromString(txtFileName.Text.ToString())); // pictureBox1.Image = new Bitmap(openFileDialog1.FileName); } else { throw new ApplicationException("Image Size must be 250 width and 100 height and less than 1 MB in size."); // MessageBox.Show("Image is invalid"); } } else { txtFileName.Text = ""; //image1.Source = null; } fldlg = null; } catch (Exception ex) { Globalized.setException(ex, lblErrorMsg, MsgType.Error); // MessageBox.Show(ex.Message.ToString()); } }
public AddItemView(dhItems Obj) { Globalized.ShowMsg(lblErrorMsg); // GlobalDhItem.VItemName = "asdasd"; //GlobalDhItem = Obj; //InitializeComponent(); //this.DataContext = GlobalDhItem; //btnCancel.Visibility = Visibility.Hidden; //if (Obj.IUpdate == 1) //{ // //lblHeading.Text = "Edit Item"; // ShowStock.Visibility = Visibility.Visible; // // lblInStock.Visibility = Visibility.Hidden; // // vItemBarcodeTextBox_Copy1.Visibility = Visibility.Hidden; //} //if (Globalized.ObjCurrentUser.BCanMakeEditAble != false) //{ // this.bIsEditable.Visibility = Visibility.Visible; //} }
private void DocList_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (sender != null) { DataGridRow dgr = sender as DataGridRow; // get the obect and then Invoice ID opne the Id in readonly mode dhDoctors objTodisplay = new dhDoctors(); // need to update to docview // first get view object then create new doctore obj dhDoctorView objtemp = ((dhDoctorView)dgr.Item); objTodisplay = this.MyViewModel.db.Doctors.Find(objtemp.IDocid); if (objTodisplay != null) { objTodisplay.IUpdate = 1; AddDoctorsViewModel ObjSetToEdit = new AddDoctorsViewModel(objTodisplay); //objvm.SelectToEdit(new AddPartyViewModel(objTodisplay)); Globalized.LoadThisObject(ObjSetToEdit, "Edit Doctor '" + objTodisplay.VfName + " " + objTodisplay.VlName + "'", Globalized.AppModuleList.Where(xx => xx.VModuleName == "Doctors").FirstOrDefault().VShortDescription); } } }
private void LoadData() { VMartialStatus.DataContext = GetTable(); cmbIEmpTypeId.DataContext = GetEmType(); VMartialStatus.DisplayMemberPath = "MartialStatus"; VMartialStatus.SelectedValuePath = "MartialStatus"; cmbIEmpTypeId.DisplayMemberPath = "vEmpType"; cmbIEmpTypeId.SelectedValuePath = "iEmpTypeId"; if ((GlobalObjEmployee != null) && (GlobalObjEmployee.IEmpid > 0)) { EmpInfo.DataContext = GlobalObjEmployee; VMartialStatus.SelectedValue = GlobalObjEmployee.VMartialStatus; cmbIEmpTypeId.SelectedValue = GlobalObjEmployee.IEmpTypeId; if (GlobalObjEmployee.Active != true) { SalleryBox.IsEnabled = false; } else { SalleryBox.IsEnabled = true; } //else //{ // SalleryBox.DataContext = new dhSalary(); //} BindSalary(); } else { GlobalObjEmployee = new dhEmployee(); EmpInfo.DataContext = GlobalObjEmployee; SalleryBox.IsEnabled = false; } MyViewModel.ObjAddEdit = GlobalObjEmployee; MyViewModel.EmployeeAccount = Globalized.GetAccountByMdule(MyViewModel.db, MyViewModel.ObjAddEdit.IEmpid, MyViewModel.MyModuel.IModuleID); this.AccountInfo.DataContext = MyViewModel.EmployeeAccount; Globalized.ShowMsg(lblErrorMsg); }