public ClassInstance( DateTime dtDate, DateTime dtStartTime, DateTime dtEndTime, int nHallNo, bool fFree, bool fPeak, bool fReservation, int nMaxNo, bool fAllowUOBBooking, DateTime dtReplacementIssueDate, DateTime dtReplacementVerifyDate, DateTime dtInstructorLogin, decimal mStandinInstructorFees, bool fCancelled, string strRemarks, decimal mInstructorFees, bool fTraineeClass, decimal mInstructorDeduction, Employee employeenReplacementIssueID, Employee employeenReplacementVerifyID, Employee employeenActualInstructorID, Employee employeenStandinInstructorID, Employee employeenVerifyID, InstructorTypeCommission instructorTypeCommission, Branch branch, Class classd, Employee employeenPermanentInstructorID, Employee employeenReplacementInstructorID,int nClassSchedule) { this._dtDate = dtDate; this._dtStartTime = dtStartTime; this._dtEndTime = dtEndTime; this._nHallNo = nHallNo; this._fFree = fFree; this._fPeak = fPeak; this._fReservation = fReservation; this._nMaxNo = nMaxNo; this._fAllowUOBBooking = fAllowUOBBooking; this._dtReplacementIssueDate = dtReplacementIssueDate; this._dtReplacementVerifyDate = dtReplacementVerifyDate; this._dtInstructorLogin = dtInstructorLogin; this._mStandinInstructorFees = mStandinInstructorFees; this._fCancelled = fCancelled; this._strRemarks = strRemarks; this._mInstructorFees = mInstructorFees; this._fTraineeClass = fTraineeClass; this._mInstructorDeduction = mInstructorDeduction; this._employeenReplacementIssueID = employeenReplacementIssueID; this._employeenReplacementVerifyID = employeenReplacementVerifyID; this._employeenActualInstructorID = employeenActualInstructorID; this._employeenStandinInstructorID = employeenStandinInstructorID; this._employeenVerifyID = employeenVerifyID; this._instructorTypeCommission = instructorTypeCommission; this._branch = branch; this._class = classd; this._employeenPermanentInstructorID = employeenPermanentInstructorID; this._employeenReplacementInstructorID = employeenReplacementInstructorID; this._nClassSchedule=nClassSchedule; }
public Acms.Core.Domain.Employee GetEmployee(int nEmployeeId) { SqlParameter param1 = new SqlParameter("nEmployeeId", nEmployeeId); try { DataSet ds = SqlHelper.ExecuteDataset(SqlHelperUtils.connectionString, "SP_GetEmployee", param1); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { Acms.Core.Domain.Employee emp = new Acms.Core.Domain.Employee(); foreach (DataRow dr in ds.Tables[0].Rows) { emp.Id = Convert.ToInt32(dr["nEmployeeId"].ToString()); emp.StrEmployeeName = dr["strEmployeeName"].ToString(); } return(emp); } } return(null); } catch (Exception err) { UI.ShowErrorMessage(null, err.Message, "Error"); return(null); } }
public TimeCard( DateTime dtDate, DateTime dtTime, Branch branch, Employee employee ) { this._dtDate = dtDate; this._dtTime = dtTime; this._branch = branch; this._employee = employee; }
public GIROBatch( DateTime dtSendDate, DateTime dtReceiveDate, string strRemarks, Employee employee ) { this._dtSendDate = dtSendDate; this._dtReceiveDate = dtReceiveDate; this._strRemarks = strRemarks; this._employee = employee; }
public Acms.Core.Domain.Employee GetEmployee(int nEmployeeId) { SqlParameter param1 = new SqlParameter("nEmployeeId", nEmployeeId); try { DataSet ds = SqlHelper.ExecuteDataset(SqlHelperUtils.connectionString, "SP_GetEmployee",param1); if(ds!=null) { if(ds.Tables[0].Rows.Count>0) { Acms.Core.Domain.Employee emp = new Acms.Core.Domain.Employee(); foreach(DataRow dr in ds.Tables[0].Rows) { emp.Id=Convert.ToInt32(dr["nEmployeeId"].ToString()); emp.StrEmployeeName = dr["strEmployeeName"].ToString(); } return emp; } } return null; } catch(Exception err) { UI.ShowErrorMessage(null, err.Message, "Error"); return null; } }
public CommissionScheme( string strDescription, DateTime dtLastEditDate, Employee employee, SalesCategory salesCategory ) { this._strDescription = strDescription; this._dtLastEditDate = dtLastEditDate; this._employee = employee; this._salesCategory = salesCategory; }
public MemoBulletin( DateTime dtDate, string strMessage, Employee employee, Memo memo ) { this._dtDate = dtDate; this._strMessage = strMessage; this._employee = employee; this._memo = memo; }
public CaseAction( DateTime dtDate, string strActionDetails, Case cases, CaseMode caseMode, Employee employeenActionByID ) { this._dtDate = dtDate; this._strActionDetails = strActionDetails; this._case = cases; this._caseMode = caseMode; this._employeenActionByID = employeenActionByID; }
public SalonUse( DateTime dtDate, int nQuantity, Branch branch, Product product, Employee employee ) { this._dtDate = dtDate; this._nQuantity = nQuantity; this._branch = branch; this._product = product; this._employee = employee; }
public CardRequest( DateTime dtLastEditDate, int nStatusID, Branch branch, Employee employee, Member member ) { this._dtLastEditDate = dtLastEditDate; this._nStatusID = nStatusID; this._branch = branch; this._employee = employee; this._member = member; }
public MemoGroup( string strMemoGroupCode, string strDescription, DateTime dtLastEditDate, bool fPublicAccess, Employee employee ) { this._strMemoGroupCode = strMemoGroupCode; this._strDescription = strDescription; this._dtLastEditDate = dtLastEditDate; this._fPublicAccess = fPublicAccess; this._employee = employee; }
public Memo( DateTime dtDate, string strTitle, string strMessage, DateTime dtLastEditDate, int nStatusID, Employee employee ) { this._dtDate = dtDate; this._strTitle = strTitle; this._strMessage = strMessage; this._dtLastEditDate = dtLastEditDate; this._nStatusID = nStatusID; this._employee = employee; }
public RewardsTransaction( DateTime dtDate, int nTypeID, double dRewardsPoints, RewardsCatalogue rewardsCataloguestrReferenceNo, Employee employee, Member member ) { this._dtDate = dtDate; this._nTypeID = nTypeID; this._dRewardsPoints = dRewardsPoints; this._rewardsCataloguestrReferenceNo = rewardsCataloguestrReferenceNo; this._employee = employee; this._member = member; }
public IBT( DateTime dtDate, int nStatusID, DateTime dtLastEditDate, string strRemarks, Branch branchFrom, Branch branchTo, Employee employee ) { this._dtDate = dtDate; this._nStatusID = nStatusID; this._dtLastEditDate = dtLastEditDate; this._strRemarks = strRemarks; this._branchFrom = branchFrom; this._branchTo = branchTo; this._employee = employee; }
public GIRO( string strBankBranchCode, string strAccountNo, string strRemarks, int nStatusID, Bank bank, Branch branch, Employee employee, Member member, Package package ) { this._strBankBranchCode = strBankBranchCode; this._strAccountNo = strAccountNo; this._strRemarks = strRemarks; this._nStatusID = nStatusID; this._bank = bank; this._branch = branch; this._employee = employee; this._member = member; this._package = package; }
public Promotion( string strDescription, int nPromotionTypeID, bool fItemDiscount, decimal mMinimumAmount, DateTime dtValidStart, DateTime dtValidEnd, double dDiscountPercent, double dDiscountValue, DiscountCategory discountCategory, Employee approvedStatus ) { this._strDescription = strDescription; this._nPromotionTypeID = nPromotionTypeID; this._fItemDiscount = fItemDiscount; this._mMinimumAmount = mMinimumAmount; this._dtValidStart = dtValidStart; this._dtValidEnd = dtValidEnd; this._dDiscountPercent = dDiscountPercent; this._dDiscountValue = dDiscountValue; this._discountCategory = discountCategory; this._approvedStatus = approvedStatus; }
public Shift(DateTime dtDate, int nTerminalID, int nShiftID, DateTime dtOpenTime, DateTime dtCloseTime, decimal mOpeningFloat, decimal mClosingFloat, string strRemarks, Branch branch, Employee employeenOpenShiftStaffID, Employee employeenCloseShiftStaffID, Employee employeenVerifyStaffID ) { this._dtDate = dtDate; this._nTerminalID = nTerminalID; this._nShiftID = nShiftID; this._dtOpenTime = dtOpenTime; this._dtCloseTime = dtCloseTime; this._mOpeningFloat = mOpeningFloat; this._mClosingFloat = mClosingFloat; this._strRemarks = strRemarks; this._branch = branch; this._employeenOpenShiftStaffID = employeenOpenShiftStaffID; this._employeenCloseShiftStaffID = employeenCloseShiftStaffID; this._employeenVerifyStaffID = employeenVerifyStaffID; }
public ServiceSession( DateTime dtDate, DateTime dtStartTime, DateTime dtEndTime, int nStatusID, DateTime dtLastEditDate, bool fUOBBooking, Branch branch, Employee employee, Employee employeenServiceEmployeeID, Member member, MemberPackage memberPackage, Service service ) { this._dtDate = dtDate; this._dtStartTime = dtStartTime; this._dtEndTime = dtEndTime; this._nStatusID = nStatusID; this._dtLastEditDate = dtLastEditDate; this._fUOBBooking = fUOBBooking; this._branch = branch; this._employee = employee; this._employeenServiceEmployeeID = employeenServiceEmployeeID; this._member = member; this._memberPackage = memberPackage; this._service = service; }
public Leave( DateTime dtDate, int nYearID, string strRemarks, int nTypeID, int nStatusID, DateTime dtLastEditDate, DateTime dtStartTime, DateTime dtEndTime, double nQuantity, Employee employee, Employee employeenEditID, LeaveType leaveType ) { this._dtDate = dtDate; this._nYearID = nYearID; this._strRemarks = strRemarks; this._nTypeID = nTypeID; this._nStatusID = nStatusID; this._dtLastEditDate = dtLastEditDate; this._dtStartTime = dtStartTime; this._dtEndTime = dtEndTime; this._nQuantity = nQuantity; this._employee = employee; this._employeenEditID = employeenEditID; this._leaveType = leaveType; }
public ClassAttendance( DateTime dtDate, DateTime dtStartTime, DateTime dtEndTime, int nTypeID, int nStatusID, DateTime dtLastEditDate, bool fUOBBooking, bool fRefunded, Branch branch, ClassInstance classInstance, Employee employee, Member member, MemberPackage memberPackage ) { this._dtDate = dtDate; this._dtStartTime = dtStartTime; this._dtEndTime = dtEndTime; this._nTypeID = nTypeID; this._nStatusID = nStatusID; this._dtLastEditDate = dtLastEditDate; this._fUOBBooking = fUOBBooking; this._fRefunded = fRefunded; this._branch = branch; this._classInstance = classInstance; this._employee = employee; this._member = member; this._memberPackage = memberPackage; }
public Case( DateTime dtDate, DateTime dtLastEditDate, int nStatusID, string strSubject, string strDetails, Branch branch, CaseCategory caseCategory, CaseType caseType, Department department, Department departmentnDepartmentAssignedID, Employee employeenSubmittedByID, Employee employee, Member member ) { this._dtDate = dtDate; this._dtLastEditDate = dtLastEditDate; this._nStatusID = nStatusID; this._strSubject = strSubject; this._strDetails = strDetails; this._branch = branch; this._caseCategory = caseCategory; this._caseType = caseType; this._department = department; this._departmentnDepartmentAssignedID = departmentnDepartmentAssignedID; this._employeenSubmittedByID = employeenSubmittedByID; this._employee = employee; this._member = member; }
public frmOvertime(Do.Employee employee, ACMSLogic.Staff.Timesheet timesheet, DataRow aEmployeeInfo) { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // ACMS.XtraUtils.XtraEditors.SetDateEditFormat(this.Controls); this.employee = employee; this.timesheet = timesheet; this.rEmployeeInfo = aEmployeeInfo; dateedtDate.DateTime = DateTime.Now; //new XtraUtils.LookupEditBuilder.EmployeeIDLookupEditBuilder(luedtApprovingManager.Properties, true); }
// public ClassSchedule( ClassScheduleId Id,DateTime dtEndTime, bool fFree, bool fPeak, bool fReservation, int nMaxNo, bool fAllowUOBBooking, Branch branch, Class classd, Employee employeenInstructorID, InstructorTypeCommission instructorTypeCommission ) public ClassSchedule( int nClassSchedule,int nHallNo,int nDay, DateTime dtStartTime, DateTime dtEndTime, bool fFree, bool fPeak, bool fReservation, int nMaxNo, bool fAllowUOBBooking, Branch branch, Class classd, Employee employeenInstructorID, InstructorTypeCommission instructorTypeCommission ) { this._nClassScheduleID=nClassSchedule; this._nHallNo = nHallNo; this._nDay = nDay; this._dtStartTime = dtStartTime; this._dtEndTime = dtEndTime; this._fFree = fFree; this._fPeak = fPeak; this._fReservation = fReservation; this._nMaxNo = nMaxNo; this._fAllowUOBBooking = fAllowUOBBooking; this._branch = branch; this._class = classd; this._employeenInstructorID = employeenInstructorID; this._instructorTypeCommission = instructorTypeCommission; }
public Member( int nMembershipNo, string strMemberName, string strCardName, string strNRICFIN, bool fSingaporean, bool fMember, bool fAirCrew, DateTime dtDOB, string strAddress1, string strAddress2, string strPostalCode, string strHomeNo, string strOfficeNo, string strMobileNo, string strPagerNo, bool fSMS, bool fEmail, bool fPostalMail, string strEmail, string strAltEmail, int nMediaSourceID, string strMediaSource, string strCompany, string strOccupation, string strRemarks, DateTime dtSignupDate, string strCreditCardNo, string strIntroducerMembershipID, int nCardStatusID, bool fLockerDeposit, int nStatus, bool fGiroFailed, bool fBounceCheck, Branch branchstrCardBranchCode, Employee employeenSignupID, LoyaltyStatus loyaltyStatus ) { //this._strBranchCode = strBranchCode; this._nMembershipNo = nMembershipNo; this._strMemberName = strMemberName; this._strCardName = strCardName; this._strNRICFIN = strNRICFIN; this._fSingaporean = fSingaporean; this._fMember = fMember; this._fAirCrew = fAirCrew; this._dtDOB = dtDOB; this._strAddress1 = strAddress1; this._strAddress2 = strAddress2; this._strPostalCode = strPostalCode; this._strHomeNo = strHomeNo; this._strOfficeNo = strOfficeNo; this._strMobileNo = strMobileNo; this._strPagerNo = strPagerNo; this._fSMS = fSMS; this._fEmail = fEmail; this._fPostalMail = fPostalMail; this._strEmail = strEmail; this._strAltEmail = strAltEmail; this._nMediaSourceID = nMediaSourceID; this._strMediaSource = strMediaSource; this._strCompany = strCompany; this._strOccupation = strOccupation; this._strRemarks = strRemarks; this._dtSignupDate = dtSignupDate; this._strCreditCardNo = strCreditCardNo; this._strIntroducerMembershipID = strIntroducerMembershipID; this._nCardStatusID = nCardStatusID; this._fLockerDeposit = fLockerDeposit; this._nStatus = nStatus; this._fGiroFailed = fGiroFailed; this._fBounceCheck = fBounceCheck; this._branchstrCardBranchCode = branchstrCardBranchCode; this._employeenSignupID = employeenSignupID; this._loyaltyStatus = loyaltyStatus; }
public MemberPackage( DateTime dtPurchaseDate, DateTime dtStartDate, DateTime dtExpiryDate, DateTime dtWarrantyDate, bool fFree, string strReceiptNo, int nStatusID, string strRemarks, int nTempPackageID, string strTempPackageCategory, DateTime dtLastEdit, int nVoucherTypeID, string strVoucherNumber, int nBalance,int nAdjust, Employee employee, GIRO gIRO, Member member, MemberCreditPackage memberCreditPackage, Package package ) { this._dtPurchaseDate = dtPurchaseDate; this._dtStartDate = dtStartDate; this._dtExpiryDate = dtExpiryDate; this._dtWarrantyDate = dtWarrantyDate; this._fFree = fFree; this._strReceiptNo = strReceiptNo; this._nStatusID = nStatusID; this._strRemarks = strRemarks; this._nTempPackageID = nTempPackageID; this._strTempPackageCategory = strTempPackageCategory; this._dtLastEdit = dtLastEdit; this._nVoucherTypeID = nVoucherTypeID; this._strVoucherNumber = strVoucherNumber; this._nBalance = nBalance; this._nAdjust=nAdjust; this._employee = employee; this._gIRO = gIRO; this._member = member; this._memberCreditPackage = memberCreditPackage; this._package = package; }
public Receipt( DateTime dtDate, int nShiftID, int nTerminalID, decimal mNettAmount, decimal mGSTAmount, decimal mTotalAmount, decimal mVoucherAmount, bool fVoid, string strReferenceNo, string strParentReceiptNo, string strChildReceiptNo, Branch branch, Category category, Employee employeenSalespersonID, Employee employeenCashierID, Employee employeenTherapistID, Member member, Promotion promotionstrDiscountCode, Promotion promotionstrFreebieCode, Reward reward, Tax tax ) { this._dtDate = dtDate; this._nShiftID = nShiftID; this._nTerminalID = nTerminalID; this._mNettAmount = mNettAmount; this._mGSTAmount = mGSTAmount; this._mTotalAmount = mTotalAmount; this._mVoucherAmount = mVoucherAmount; this._fVoid = fVoid; this._strReferenceNo = strReferenceNo; this._strParentReceiptNo = strParentReceiptNo; this._strChildReceiptNo = strChildReceiptNo; this._branch = branch; this._category = category; this._employeenSalespersonID = employeenSalespersonID; this._employeenCashierID = employeenCashierID; this._employeenTherapistID = employeenTherapistID; this._member = member; this._promotionstrDiscountCode = promotionstrDiscountCode; this._promotionstrFreebieCode = promotionstrFreebieCode; this._reward = reward; this._tax = tax; }
public void AddEmployee(Employee employee) { employee.Department = this; _employees.Add(employee); }
// protected IList _employees2 = new ArrayList(); public void AddEmployee2(Employee employee) { employee.Branch = this; _employees2.Add(employee); }
public void SetEmployeeRecord(Do.Employee emp) { employee = emp; }
public void SetEmployeeRecord(Do.Employee employee) { this.employee = employee; }
private void btnLogin_Click(System.Object sender, System.EventArgs e) { /* * MethodInvoker myProcessStarter = new MethodInvoker(InitialDigSignature); * * myProcessStarter.BeginInvoke(null, null); */ if (this.txtUsername.Text == "" | this.txtPassword.Text == "") { ACMS.Utils.UI.ShowErrorMessage(this, "Empty Username & Password!", "Error"); progressBar1.Value = 0; } else { try { ProgressBar(); ACMSLogic.Login.Login login = new ACMSLogic.Login.Login(); //Do.Employee emplogin = login.GetEmployeeByIdAndPassword(this.txtUsername.Text, this.txtPassword.Text); //MessageBox.Show(this, emplogin.Id.ToString()+" "+emplogin.Department.Id+" "+emplogin.RightsLevel.RightsLevelEntrys.Count.ToString()); //Rp.EmployeeRepository er = new Rp.EmployeeRepository(); Do.Employee emp = login.GetEmployeeByIdAndPassword(this.txtUsername.Text, this.txtPassword.Text);//er.GetEmployeeByIdAndPassword(this.txtUsername.Text, this.txtPassword.Text); System.Security.Principal.WindowsIdentity userLogin = System.Security.Principal.WindowsIdentity.GetCurrent(); //System.Security.Principal.WindowsIdentity userLogin = "******"; if (login.Check_Concurrent() == false) { ACMS.Utils.UI.ShowErrorMessage(this, "Number of Login Exceed Users Limit!", "Authorisation"); } else { //Rp.TerminalUserRepository tup = new Rp.TerminalUserRepository(); if (emp != null) { //userLogin.Name="AFPL\EdithGan"; //Rev 6.8.0.0 Determine whether is RoadShow or Terminal. Add in 2 config - RoadShow & RoadShowTerminal Acms.Core.Domain.TerminalUser tu = new Acms.Core.Domain.TerminalUser(); if (ConfigurationSettings.AppSettings["RoadShow"].ToString() == "1") { tu = login.GetTerminalUserByUserId(ConfigurationSettings.AppSettings["RoadShowTerminal"].ToString()) as Acms.Core.Domain.TerminalUser; ACMSLogic.User.RoadShow = "RS";//jackie 13032012 } else { tu = login.GetTerminalUserByUserId(userLogin.Name) as Acms.Core.Domain.TerminalUser; ACMSLogic.User.RoadShow = tu.Branch.Id; } //Acms.Core.Domain.TerminalUser tu = login.GetTerminalUserByUserId("AFPL\\TO-Terminal1") as Acms.Core.Domain.TerminalUser; //Acms.Core.Domain.TerminalUser tu = login.GetTerminalUserByUserId("AFPL\\TO-Terminal2") as Acms.Core.Domain.TerminalUser; //Show AMCS Branch bool Valid = numberUser(); //bool Valid = true; if (emp.CanAccess("AB_LOGIN", tu.Branch.Id) && Valid) { //smell tandas code ACMSDAL.TblTerminalUser UserLog = new TblTerminalUser(); UserLog.StrTerminalUserCode = userLogin.Name; UserLog.UpdateSession(true, DateTime.Now); modInitForms.fLogin.Hide(); ACMSLogic.User.BranchCode = tu.Branch.Id; ACMSLogic.User.EmployeeID = emp.Id; /* * //cbRoadShow.Checked = true; * if (cbRoadShow.Checked) * { * ACMSLogic.User.RoadShow = "RS";//jackie 13032012 * } * else * ACMSLogic.User.RoadShow = tu.Branch.Id;*/ if (emp.Department != null) { ACMSLogic.User.DepartmentID = emp.Department.Id; } if (emp.StrEmployeeName != null) { ACMSLogic.User.EmployeeName = emp.StrEmployeeName; } if (emp.JobPosition.Id != null) { ACMSLogic.User.JobPositionCode = emp.JobPosition.Id; } if (emp.RightsLevel != null) { ACMSLogic.User.RightsLevelID = emp.RightsLevel.Id; } try { //ClassAttendance.CreateClassInstance(); //PackageCode.CreateUnLinkPackage(); } catch (Exception ex) { return; } ACMSLogic.User oUser = new User(); if (modInitForms.fBranch != null) { modInitForms.fBranch.IsLogin = true; modInitForms.fBranch.Close(); modInitForms.fBranch.Dispose(); if (modInitForms.fStaff != null) { modInitForms.fStaff.Close(); modInitForms.fStaff.Dispose(); } if (modInitForms.fManager != null) { modInitForms.fManager.Close(); modInitForms.fManager.Dispose(); } } Thread.Sleep(1000); modInitForms.fBranch = new frmBranch(cmbLanguage.EditValue.ToString()); modInitForms.fBranch.SetEmployeeRecord(emp); modInitForms.fBranch.SetTerminalUser(tu); modInitForms.fBranch.OpenDayShift(); // if (UnclosedShift == true) // MessageBox.Show("There is unclosed shift. Please close the shift."); modInitForms.fBranch.initData(oUser); modInitForms.fBranch.Show(); //DateTime end = DateTime.Now; //TimeSpan diff = end.Subtract(start); //MessageBox.Show(diff.TotalSeconds.ToString(),"Time"); } else if (emp.CanAccess("AB_TIMECARD_LOGIN", tu.Branch.Id)) { modInitForms.fLogin.Hide(); //Show AMCS Time Card if (modInitForms.fTimeCard == null) { modInitForms.fTimeCard = new frmTimeCard(tu.Branch.Id); modInitForms.fTimeCard.Show(); } } else { MessageBox.Show(this, "Invalid username and password or you don't have access to this Branch, please try again"); } } else { MessageBox.Show(this, "Invalid username and password, Please try again"); } } } catch (Exception ex) { return; } } }
public RightsLevel( string strDescription, DateTime dtLastEditDate, Employee employee ) { this._strDescription = strDescription; this._dtLastEditDate = dtLastEditDate; this._employee = employee; }
private void btnLogin_Click(System.Object sender, System.EventArgs e) { #region Disable Code //Check login information from database // ACMSLogic.User oUser = new User(); // bool chkUserLogin = false; // // chkUserLogin = System.Convert.ToBoolean(oUser.Login(txtUsername.Text, txtPassword.Text)); // // if (chkUserLogin) // { // if (cmbModule.Text == "ACMS Branch") // { // //Show AMCS Branch // if (modInitForms.fBranch == null) // { // modInitForms.fBranch = new frmBranch(); // modInitForms.fBranch.initData(oUser); // modInitForms.fBranch.Show(); // } // // modInitForms.fLogin.Hide(); // } // // if (cmbModule.Text == "ACMS POS") // { // //Show AMCS POS // if (modInitForms.fPOS == null) // { // modInitForms.fPOS = new frmPOS(); // modInitForms.fPOS.Show(); // } // // modInitForms.fLogin.Hide(); // } // // if (cmbModule.Text == "ACMS Staff") // { // //Show AMCS POS // if (modInitForms.fStaff == null) // { // modInitForms.fStaff = new frmStaff(); // modInitForms.fStaff.Show(); // } // // modInitForms.fLogin.Hide(); // } // } // else // { // MessageBox.Show(this, "Incorrect username and password, please try again"); // } #endregion //DateTime start = DateTime.Now; if (this.txtUsername.Text == "" | this.txtPassword.Text == "") { ACMS.Utils.UI.ShowErrorMessage(this, "Empty Username & Password!", "Error"); } else { try { ACMSLogic.Login.Login login = new ACMSLogic.Login.Login(); //Do.Employee emplogin = login.GetEmployeeByIdAndPassword(this.txtUsername.Text, this.txtPassword.Text); //MessageBox.Show(this, emplogin.Id.ToString()+" "+emplogin.Department.Id+" "+emplogin.RightsLevel.RightsLevelEntrys.Count.ToString()); //Rp.EmployeeRepository er = new Rp.EmployeeRepository(); Do.Employee emp = login.GetEmployeeByIdAndPassword(this.txtUsername.Text, this.txtPassword.Text); //er.GetEmployeeByIdAndPassword(this.txtUsername.Text, this.txtPassword.Text); System.Security.Principal.WindowsIdentity userLogin = System.Security.Principal.WindowsIdentity.GetCurrent(); if (login.Check_Concurrent() == false) { ACMS.Utils.UI.ShowErrorMessage(this, "Number of Login Exceed Users Limit!", "Authorisation"); } else { //Rp.TerminalUserRepository tup = new Rp.TerminalUserRepository(); if (emp != null) { Acms.Core.Domain.TerminalUser tu = login.GetTerminalUserByUserId(userLogin.Name) as Acms.Core.Domain.TerminalUser; //tup.GetTerminalUserByUserId(userLogin.Name) as Acms.Core.Domain.TerminalUser; //Show AMCS Branch bool Valid = numberUser(); //bool Valid = true; if (emp.CanAccess("AB_LOGIN", tu.Branch.Id) && Valid) { //smell tandas code ACMSDAL.TblTerminalUser UserLog = new TblTerminalUser(); UserLog.StrTerminalUserCode = userLogin.Name; UserLog.UpdateSession(true, DateTime.Now); modInitForms.fLogin.Hide(); ACMSLogic.User.BranchCode = tu.Branch.Id; ACMSLogic.User.EmployeeID = emp.Id; if (emp.Department != null) { ACMSLogic.User.DepartmentID = emp.Department.Id; } if (emp.StrEmployeeName != null) { ACMSLogic.User.EmployeeName = emp.StrEmployeeName; } if (emp.JobPosition.Id != null) { ACMSLogic.User.JobPositionCode = emp.JobPosition.Id; } if (emp.RightsLevel != null) { ACMSLogic.User.RightsLevelID = emp.RightsLevel.Id; } try { ClassAttendance.CreateClassInstance(); PackageCode.CreateUnLinkPackage(); } catch (Exception ex) { return; } ACMSLogic.User oUser = new User(); if (modInitForms.fBranch != null) { modInitForms.fBranch.IsLogin = true; modInitForms.fBranch.Close(); modInitForms.fBranch.Dispose(); if (modInitForms.fStaff != null) { modInitForms.fStaff.Close(); modInitForms.fStaff.Dispose(); } if (modInitForms.fManager != null) { modInitForms.fManager.Close(); modInitForms.fManager.Dispose(); } } modInitForms.fBranch = new frmBranch(cmbLanguage.EditValue.ToString()); modInitForms.fBranch.SetEmployeeRecord(emp); modInitForms.fBranch.SetTerminalUser(tu); modInitForms.fBranch.OpenDayShift(); // if (UnclosedShift == true) // MessageBox.Show("There is unclosed shift. Please close the shift."); modInitForms.fBranch.initData(oUser); modInitForms.fBranch.Show(); //DateTime end = DateTime.Now; //TimeSpan diff = end.Subtract(start); //MessageBox.Show(diff.TotalSeconds.ToString(),"Time"); } else if (emp.CanAccess("AB_TIMECARD_LOGIN", tu.Branch.Id)) { modInitForms.fLogin.Hide(); //Show AMCS Time Card if (modInitForms.fTimeCard == null) { modInitForms.fTimeCard = new frmTimeCard(tu.Branch.Id); modInitForms.fTimeCard.Show(); } } else { MessageBox.Show(this, "Invalid username and password or you don't have access to this Branch, please try again"); } } else { MessageBox.Show(this, "Invalid username and password, Please try again"); } } } catch (Exception ex) { return; } } }