Example #1
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.salesOrderViewModel.PropertyChanged += salesOrderDetailDTO_PropertyChanged;

                CustomerAPIs customerAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());

                this.combexCustomerID.DataSource    = customerAPIs.GetCustomerBases(true, false);
                this.combexCustomerID.DisplayMember = CommonExpressions.PropertyName <CustomerBase>(p => p.Code);
                this.combexCustomerID.ValueMember   = CommonExpressions.PropertyName <CustomerBase>(p => p.CustomerID);
                this.bindingCustomerID = this.combexCustomerID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.CustomerID), true, DataSourceUpdateMode.OnPropertyChanged);

                CustomerAPIs receiverAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());
                this.combexReceiverID.DataSource    = receiverAPIs.GetCustomerBases(false, true);
                this.combexReceiverID.DisplayMember = CommonExpressions.PropertyName <CustomerBase>(p => p.Code);
                this.combexReceiverID.ValueMember   = CommonExpressions.PropertyName <CustomerBase>(p => p.CustomerID);
                this.bindingReceiverID = this.combexReceiverID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ReceiverID), true, DataSourceUpdateMode.OnPropertyChanged);

                EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

                this.combexSalespersonID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.salesOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Saleperson);
                this.combexSalespersonID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
                this.combexSalespersonID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
                this.bindingSalespersonID = this.combexSalespersonID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.SalespersonID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingVoucherCode     = this.textexVoucherCode.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingEntryDate       = this.dateTimexEntryDate.DataBindings.Add("Value", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingDeliveryDate    = this.dateTimexDeliveryDate.DataBindings.Add("Value", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.DeliveryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingCustomerName    = this.textexCustomerName.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.CustomerName), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingContactInfo     = this.textexContactInfo.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ContactInfo), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingReceiverName    = this.textexReceiverName.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ReceiverName), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingShippingAddress = this.textexShippingAddress.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ShippingAddress), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingRemarks         = this.textexRemarks.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingCustomerID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingReceiverID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingSalespersonID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingVoucherCode.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingEntryDate.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingDeliveryDate.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingCustomerName.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingContactInfo.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingReceiverName.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingShippingAddress.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingRemarks.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.errorProviderMaster.DataSource = this.salesOrderViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #2
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.forecastViewModel.PropertyChanged += forecastDetailDTO_PropertyChanged;

                LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());
                this.combexForecastLocationID.DataSource    = locationAPIs.GetLocationBases();
                this.combexForecastLocationID.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
                this.combexForecastLocationID.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
                this.bindingForecastLocationID = this.combexForecastLocationID.DataBindings.Add("SelectedValue", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.ForecastLocationID), true, DataSourceUpdateMode.OnPropertyChanged);


                this.bindingEntryDate   = this.dateTimexEntryDate.DataBindings.Add("Value", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingVoucherCode = this.textexVoucherCode.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingDescription = this.textexDescription.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingRemarks     = this.textexRemarks.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingForecastLocationID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingEntryDate.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingVoucherCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingDescription.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingRemarks.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.buttonOK.Enabled = this.forecastViewModel.IsValid;
                this.errorProviderMaster.DataSource = this.forecastViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #3
0
        //private CommonMetaList commonMetaList;


        private void PublicApplicationLogon_Load(object sender, EventArgs e)
        {
            #region TEST
            //// List of strings for your names
            //List<string> allUsers = new List<string>();

            //// create your domain context and define the OU container to search in
            //PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "DOMAINNAME",
            //                                            "OU=SomeOU,dc=YourCompany,dc=com");

            //// define a "query-by-example" principal - here, we search for a UserPrincipal (user)
            //UserPrincipal qbeUser = new UserPrincipal(ctx);

            //// create your principal searcher passing in the QBE principal
            //PrincipalSearcher srch = new PrincipalSearcher(qbeUser);

            //// find all matches
            //foreach (var found in srch.FindAll())
            //{
            //    // do whatever here - "found" is of type "Principal" - it could be user, group, computer.....
            //    allUsers.Add(found.DisplayName);
            //}



            //using (var context = new PrincipalContext(ContextType.Domain, "yourdomain.com"))
            //{
            //    using (var searcher = new PrincipalSearcher(new UserPrincipal(context)))
            //    {
            //        foreach (var result in searcher.FindAll())
            //        {
            //            DirectoryEntry de = result.GetUnderlyingObject() as DirectoryEntry;
            //            Console.WriteLine("First Name: " + de.Properties["givenName"].Value);
            //            Console.WriteLine("Last Name : " + de.Properties["sn"].Value);
            //            Console.WriteLine("SAM account name   : " + de.Properties["samAccountName"].Value);
            //            Console.WriteLine("User principal name: " + de.Properties["userPrincipalName"].Value);
            //            Console.WriteLine();
            //        }
            //    }
            //}
            //Console.ReadLine();



            ////////string plainText = "Lê Minh Hiệp";
            ////////// Convert the plain string pwd into bytes
            //////////byte[] plainTextBytes = UnicodeEncoding.Unicode.GetBytes(plainText);
            //////////System.Security.Cryptography.HashAlgorithm hashAlgo = new System.Security.Cryptography.SHA256Managed();
            //////////byte[] hash = hashAlgo.ComputeHash(plainTextBytes);

            ////////byte[] data = UnicodeEncoding.Unicode.GetBytes(plainText);
            ////////data = new System.Security.Cryptography.SHA256Managed().ComputeHash(data);
            ////////String hash = UnicodeEncoding.Unicode.GetString(data);
            //////////CustomMsgBox.Show(hash);

            #endregion TEST

            try
            {
                int.TryParse(CommonConfigs.ReadSetting("ConfigID"), out GlobalVariables.ConfigID);

                UserPrincipal currentUserPrincipal = UserPrincipal.Current;
                if (currentUserPrincipal == null || currentUserPrincipal.Sid == null)
                {
                    throw new Exception("Sorry, can not get current user principal!");
                }

                this.baseRepository = CommonNinject.Kernel.Get <IBaseRepository>();

                UserAPIs           userAPIs    = new UserAPIs(CommonNinject.Kernel.Get <IUserAPIRepository>());
                IList <ActiveUser> activeUsers = userAPIs.GetActiveUsers(GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Smallpack || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pail ? "S-1-5-21-705987929-4194781227-356911358-1001" : "S-1-5-21-2907738014-1953812902-1740135539-2132-NTF"); //currentUserPrincipal.Sid.Value

                //throw new Exception(currentUserPrincipal.Sid.Value);
                if (activeUsers.Count > 0)
                {
                    this.comboBoxEmployeeID.DataSource    = activeUsers;
                    this.comboBoxEmployeeID.DisplayMember = CommonExpressions.PropertyName <ActiveUser>(p => p.FullyQualifiedUserName);
                    this.comboBoxEmployeeID.ValueMember   = CommonExpressions.PropertyName <ActiveUser>(p => p.UserID);

                    FillingLineAPIs fillingLineAPIs = new FillingLineAPIs(CommonNinject.Kernel.Get <IFillingLineAPIRepository>());

                    this.comboFillingLineID.DataSource    = fillingLineAPIs.GetFillingLineBases();
                    this.comboFillingLineID.DisplayMember = CommonExpressions.PropertyName <FillingLineBase>(p => p.Name);
                    this.comboFillingLineID.ValueMember   = CommonExpressions.PropertyName <FillingLineBase>(p => p.FillingLineID);


                    if (GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Smallpack || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pail || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Drum)
                    {
                        this.comboFillingLineID.SelectedValue = GlobalVariables.ConfigID;
                    }

                    if (!(GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Smallpack || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pail || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Drum))
                    {
                        this.lbProductionLineID.Visible = false;
                        this.comboFillingLineID.Visible = false;

                        this.labelPassword.Top = this.lbEmployeeID.Top;
                        this.textPassword.Top  = this.comboBoxEmployeeID.Top;

                        this.lbEmployeeID.Top       = this.lbProductionLineID.Top;
                        this.comboBoxEmployeeID.Top = this.comboFillingLineID.Top;
                    }


                    this.comboBoxAutonicsPortName.DataSource = System.IO.Ports.SerialPort.GetPortNames();
                    if (this.comboBoxAutonicsPortName.Items.Count == 0)
                    {
                        this.comboBoxAutonicsPortName.DataSource = null;
                        this.comboBoxAutonicsPortName.Items.Add("COM0");
                    }

                    string comportName = CommonConfigs.ReadSetting("ComportName");
                    if (this.comboBoxAutonicsPortName.Items.IndexOf(comportName) >= 0)
                    {
                        this.comboBoxAutonicsPortName.SelectedIndex = this.comboBoxAutonicsPortName.Items.IndexOf(comportName);
                    }


                    this.buttonDownload.Visible     = true;
                    this.buttonLoginRestore.Visible = activeUsers[0].IsDatabaseAdmin;
                }
                else
                {
                    this.comboFillingLineID.Visible = false;
                    this.comboBoxEmployeeID.Visible = false;
                    this.lbEmployeeID.Visible       = false;
                    this.lbProductionLineID.Text    = "\r\n" + "Sorry, user: "******"\r\n" + "Don't have permission to run this program." + "\r\n" + "\r\n" + "Contact your admin for more information. Thank you!" + "\r\n" + "\r\n" + "\r\n" + "Xin lỗi, bạn chưa được cấp quyền sử dụng phần mềm này.";

                    this.buttonLogin.Visible = false;
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #4
0
 public override void Create()
 {
     base.Create();
     this.batchViewModel.EntryMonthID = CommonExpressions.GetEntryMonthID(this.batchViewModel.EntryDate);
 }
Example #5
0
        public UserAdd(UserAPIs userAPIs)
        {
            InitializeComponent();

            try
            {
                List <DomainUser> allUsers = new List <DomainUser>();
                PrincipalContext  ctx      = new PrincipalContext(ContextType.Domain, "chevronvn.com"); //, "OU=SomeOU,dc=YourCompany,dc=com"// create your domain context and define the OU container to search in
                UserPrincipal     qbeUser  = new UserPrincipal(ctx);                                    // define a "query-by-example" principal - here, we search for a UserPrincipal (user)
                PrincipalSearcher srch     = new PrincipalSearcher(qbeUser);                            // create your principal searcher passing in the QBE principal

                foreach (var found in srch.FindAll())                                                   // find all matches
                {                                                                                       // do whatever here - "found" is of type "Principal" - it could be user, group, computer.....
                    allUsers.Add(new DomainUser()
                    {
                        FirstName = found.DisplayName, LastName = found.Name, UserName = this.GetWindowsIdentityName(found.DistinguishedName), SecurityIdentifier = found.Sid.Value
                    });
                }

                this.combexUserID.DataSource    = allUsers;
                this.combexUserID.DisplayMember = CommonExpressions.PropertyName <DomainUser>(p => p.UserName);
                this.combexUserID.ValueMember   = CommonExpressions.PropertyName <DomainUser>(p => p.UserName);
                this.bindingUserName            = this.combexUserID.DataBindings.Add("SelectedValue", this, CommonExpressions.PropertyName <DomainUser>(p => p.UserName), true, DataSourceUpdateMode.OnPropertyChanged);

                this.userAPIs = userAPIs;
                this.combexOrganizationalUnitID.DataSource    = this.userAPIs.GetOrganizationalUnitIndexes();
                this.combexOrganizationalUnitID.DisplayMember = CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.LocationOrganizationalUnitName);
                this.combexOrganizationalUnitID.ValueMember   = CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.OrganizationalUnitID);
                this.bindingOrganizationalUnitID = this.combexOrganizationalUnitID.DataBindings.Add("SelectedValue", this, CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.OrganizationalUnitID), true, DataSourceUpdateMode.OnPropertyChanged);
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #6
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingCode         = this.textexCode.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Code), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingName         = this.textexName.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Name), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingOfficialName = this.textexOfficialName.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.OfficialName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingContactInfo   = this.textexContactInfo.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.ContactInfo), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVATCode       = this.textexVATCode.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.VATCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingTelephone     = this.textexTelephone.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Telephone), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingFacsimile     = this.textexFacsimile.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Facsimile), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingEmail         = this.textexEmail.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Email), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingAttentionName = this.textexAttentionName.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.AttentionName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingBillingAddress  = this.textexBillingAddress.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.BillingAddress), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingShippingAddress = this.textexShippingAddress.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.ShippingAddress), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks         = this.textexRemarks.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption         = this.labelCaption.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Caption));

            this.bindingIsCustomer = this.checkIsCustomer.DataBindings.Add("Checked", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.IsCustomer), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingIsReceiver = this.checkIsReceiver.DataBindings.Add("Checked", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.IsReceiver), true, DataSourceUpdateMode.OnPropertyChanged);

            this.IsCustomers = true;
            this.comboIsCustomers.ComboBox.DataSource = new List <OptionBool>()
            {
                new OptionBool()
                {
                    OptionValue = true, OptionDescription = "Show Customers"
                }, new OptionBool()
                {
                    OptionValue = false, OptionDescription = "Show Receivers"
                }
            };
            this.comboIsCustomers.ComboBox.DisplayMember = CommonExpressions.PropertyName <OptionBool>(p => p.OptionDescription);
            this.comboIsCustomers.ComboBox.ValueMember   = CommonExpressions.PropertyName <OptionBool>(p => p.OptionValue);
            this.bindingIsCustomers = this.comboIsCustomers.ComboBox.DataBindings.Add("SelectedValue", this, "IsCustomers", true, DataSourceUpdateMode.OnPropertyChanged);

            CustomerTypeAPIs customerTypeAPIs = new CustomerTypeAPIs(CommonNinject.Kernel.Get <ICustomerTypeAPIRepository>());

            this.combexCustomerTypeID.DataSource    = customerTypeAPIs.GetCustomerTypeBases();
            this.combexCustomerTypeID.DisplayMember = CommonExpressions.PropertyName <CustomerTypeBase>(p => p.Name);
            this.combexCustomerTypeID.ValueMember   = CommonExpressions.PropertyName <CustomerTypeBase>(p => p.CustomerTypeID);
            this.bindingCustomerTypeID = this.combexCustomerTypeID.DataBindings.Add("SelectedValue", this.customerViewModel, CommonExpressions.PropertyName <CustomerViewModel>(p => p.CustomerTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

            CustomerCategoryAPIs customerCategoryAPIs = new CustomerCategoryAPIs(CommonNinject.Kernel.Get <ICustomerCategoryAPIRepository>());

            this.combexCustomerCategoryID.DataSource    = customerCategoryAPIs.GetCustomerCategoryBases();
            this.combexCustomerCategoryID.DisplayMember = CommonExpressions.PropertyName <CustomerCategoryBase>(p => p.Name);
            this.combexCustomerCategoryID.ValueMember   = CommonExpressions.PropertyName <CustomerCategoryBase>(p => p.CustomerCategoryID);
            this.bindingCustomerCategoryID = this.combexCustomerCategoryID.DataBindings.Add("SelectedValue", this.customerViewModel, CommonExpressions.PropertyName <CustomerViewModel>(p => p.CustomerCategoryID), true, DataSourceUpdateMode.OnPropertyChanged);

            TerritoryAPIs territoryAPIs = new TerritoryAPIs(CommonNinject.Kernel.Get <ITerritoryAPIRepository>());

            this.combexTerritoryID.DataSource    = territoryAPIs.GetTerritoryBases();
            this.combexTerritoryID.DisplayMember = CommonExpressions.PropertyName <TerritoryBase>(p => p.Name);
            this.combexTerritoryID.ValueMember   = CommonExpressions.PropertyName <TerritoryBase>(p => p.TerritoryID);
            this.bindingTerritoryID = this.combexTerritoryID.DataBindings.Add("SelectedValue", this.customerViewModel, CommonExpressions.PropertyName <CustomerViewModel>(p => p.TerritoryID), true, DataSourceUpdateMode.OnPropertyChanged);

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexSalespersonID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.customerViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Saleperson);
            this.combexSalespersonID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexSalespersonID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingSalespersonID = this.combexSalespersonID.DataBindings.Add("SelectedValue", this.customerViewModel, CommonExpressions.PropertyName <CustomerViewModel>(p => p.SalespersonID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingCode.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingName.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingOfficialName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingContactInfo.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVATCode.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTelephone.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingFacsimile.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingEmail.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingAttentionName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingBillingAddress.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingShippingAddress.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingIsCustomer.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingIsReceiver.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingIsCustomers.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingCustomerTypeID.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCustomerCategoryID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTerritoryID.BindingComplete        += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingSalespersonID.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastCustomerIndex.AboutToCreateGroups     += fastCustomerIndex_AboutToCreateGroups;

            this.fastCustomerIndex.ShowGroups    = true;
            this.olvInActive.Renderer            = new MappedImageRenderer(new Object[] { false, Resources.Placeholder16 });
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
Example #7
0
        protected virtual void CalculateQuantityDetailDTO(IQuantityDetailDTO quantityDetailDTO, string propertyName, int?deliveryAdviceID, int?transferOrderID)
        {
            if (propertyName == CommonExpressions.PropertyName <IQuantityDetailDTO>(p => p.CommodityID))
            {
                CommodityAPIs           commodityAPIs     = new CommodityAPIs(CommonNinject.Kernel.Get <ICommodityAPIRepository>()); //WE MUST USE ContextAttributes.User.LocationID, INSTEAD OF quantityDetailDTO.LocationID, BECAUSE AT FIRST quantityDetailDTO.LocationID = 0. WHEN SAVE: GenericService.PreSaveRoutines WILL UPDATE DTO.LocationID = ContextAttributes.User.LocationID. SEE GenericService.PreSaveRoutines FOR MORE INFORMATION!!!
                IList <SearchCommodity> searchCommodities = commodityAPIs.SearchCommodities(quantityDetailDTO.CommodityID, ContextAttributes.User.LocationID, null, deliveryAdviceID, transferOrderID);
                if (searchCommodities.Count > 0)
                {
                    quantityDetailDTO.CommodityCode = searchCommodities[0].Code;
                    quantityDetailDTO.CommodityName = searchCommodities[0].Name;
                    quantityDetailDTO.Unit          = searchCommodities[0].Unit;
                    quantityDetailDTO.PackageSize   = searchCommodities[0].PackageSize;
                    quantityDetailDTO.Volume        = searchCommodities[0].Volume;
                    quantityDetailDTO.PackageVolume = searchCommodities[0].PackageVolume;

                    IAvailableQuantityDetailDTO availableQuantityDetailDTO = quantityDetailDTO as IAvailableQuantityDetailDTO;
                    if (availableQuantityDetailDTO != null)
                    {
                        availableQuantityDetailDTO.QuantityAvailable   = searchCommodities[0].QuantityAvailable;
                        availableQuantityDetailDTO.LineVolumeAvailable = searchCommodities[0].LineVolumeAvailable;
                    }

                    IBatchQuantityDetailDTO batchQuantityDetailDTO = quantityDetailDTO as IBatchQuantityDetailDTO;
                    if (batchQuantityDetailDTO != null)
                    {
                        batchQuantityDetailDTO.BatchID                  = null;
                        batchQuantityDetailDTO.BatchCode                = null;
                        batchQuantityDetailDTO.BatchEntryDate           = null;
                        batchQuantityDetailDTO.QuantityBatchAvailable   = 0;
                        batchQuantityDetailDTO.LineVolumeBatchAvailable = 0;
                    }
                }
            }
            if (propertyName == CommonExpressions.PropertyName <IQuantityDetailDTO>(p => p.PackageVolume) || propertyName == CommonExpressions.PropertyName <IQuantityDetailDTO>(p => p.Quantity))
            {
                quantityDetailDTO.LineVolume = quantityDetailDTO.Quantity * quantityDetailDTO.PackageVolume;
            }
        }
Example #8
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate     = this.dateTimexEntryDate.DataBindings.Add("Value", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingWarehouseName = this.textexWarehouseName.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.WarehouseName), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVoucherCode   = this.textexVoucherCode.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVehicle       = this.textexVehicle.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.Vehicle), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVehicleDriver = this.textexVehicleDriver.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.VehicleDriver), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingTransferJobs  = this.textexTransferJobs.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.TransferJobs), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDescription   = this.textexDescription.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks       = this.textexRemarks.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption       = this.labelCaption.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.Caption));

            WarehouseAPIs warehouseReceiptAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>());

            this.combexWarehouseReceiptID.DataSource    = warehouseReceiptAPIs.GetWarehouseBases();
            this.combexWarehouseReceiptID.DisplayMember = CommonExpressions.PropertyName <WarehouseBase>(p => p.Name);
            this.combexWarehouseReceiptID.ValueMember   = CommonExpressions.PropertyName <WarehouseBase>(p => p.WarehouseID);
            this.bindingWarehouseReceiptID = this.combexWarehouseReceiptID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.WarehouseReceiptID), true, DataSourceUpdateMode.OnPropertyChanged);

            TransferOrderTypeAPIs transferOrderTypeAPIs = new TransferOrderTypeAPIs(CommonNinject.Kernel.Get <ITransferOrderTypeAPIRepository>());

            this.combexTransferOrderTypeID.DataSource    = transferOrderTypeAPIs.GetTransferOrderTypeBases();
            this.combexTransferOrderTypeID.DisplayMember = CommonExpressions.PropertyName <TransferOrderTypeBase>(p => p.Name);
            this.combexTransferOrderTypeID.ValueMember   = CommonExpressions.PropertyName <TransferOrderTypeBase>(p => p.TransferOrderTypeID);
            this.bindingTransferOrderTypeID = this.combexTransferOrderTypeID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.TransferOrderTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.combexTransferPackageTypeID.DataSource    = transferOrderTypeAPIs.GetTransferPackageTypeBases();
            this.combexTransferPackageTypeID.DisplayMember = CommonExpressions.PropertyName <TransferPackageTypeBase>(p => p.Name);
            this.combexTransferPackageTypeID.ValueMember   = CommonExpressions.PropertyName <TransferPackageTypeBase>(p => p.TransferPackageTypeID);
            this.bindingTransferPackageTypeID = this.combexTransferPackageTypeID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.TransferPackageTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexForkliftDriverID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.transferOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexForkliftDriverID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.transferOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingEntryDate.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingWarehouseName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVoucherCode.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVehicle.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVehicleDriver.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTransferJobs.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingWarehouseReceiptID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingTransferOrderTypeID.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTransferPackageTypeID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingForkliftDriverID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingStorekeeperID.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastTransferOrderIndex.AboutToCreateGroups += fastTransferOrderIndex_AboutToCreateGroups;

            this.fastTransferOrderIndex.ShowGroups = true;
            this.olvApproved.Renderer            = new MappedImageRenderer(new Object[] { 1, Resources.Placeholder16, 2, Resources.Void_16 });
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
Example #9
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate = this.dateTimexEntryDate.DataBindings.Add("Value", this.batchMasterViewModel, "EntryDate", true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCode      = this.textexCode.DataBindings.Add("Text", this.batchMasterViewModel, "Code", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingPlannedQuantity = this.numericPlannedQuantity.DataBindings.Add("Value", this.batchMasterViewModel, CommonExpressions.PropertyName <BatchMasterViewModel>(p => p.PlannedQuantity), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.batchMasterViewModel, "Remarks", true, DataSourceUpdateMode.OnPropertyChanged);

            this.textexCommodityAPICode.DataBindings.Add("Text", this.batchMasterViewModel, CommonExpressions.PropertyName <BatchMasterViewModel>(p => p.CommodityAPICode), true);
            this.textexCommodityName.DataBindings.Add("Text", this.batchMasterViewModel, CommonExpressions.PropertyName <BatchMasterViewModel>(p => p.CommodityName), true);

            this.commodityAPIs = new CommodityAPIs(CommonNinject.Kernel.Get <ICommodityAPIRepository>());
            this.combexCommodityID.DataSource    = this.commodityAPIs.GetCommodityBases();
            this.combexCommodityID.DisplayMember = CommonExpressions.PropertyName <CommodityBase>(p => p.Code);
            this.combexCommodityID.ValueMember   = CommonExpressions.PropertyName <CommodityBase>(p => p.CommodityID);
            this.bindingCommodityID = this.combexCommodityID.DataBindings.Add("SelectedValue", this.batchMasterViewModel, CommonExpressions.PropertyName <BatchMasterViewModel>(p => p.CommodityID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.batchStatusAPIs = new BatchStatusAPIs(CommonNinject.Kernel.Get <IBatchStatusAPIRepository>());
            this.combexBatchStatusID.DataSource    = this.batchStatusAPIs.GetBatchStatusBases();
            this.combexBatchStatusID.DisplayMember = CommonExpressions.PropertyName <BatchStatusBase>(p => p.Code);
            this.combexBatchStatusID.ValueMember   = CommonExpressions.PropertyName <BatchStatusBase>(p => p.BatchStatusID);
            this.bindingBatchStatusID = this.combexBatchStatusID.DataBindings.Add("SelectedValue", this.batchMasterViewModel, CommonExpressions.PropertyName <BatchMasterViewModel>(p => p.BatchStatusID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingEntryDate.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCode.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingPlannedQuantity.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingCommodityID.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingBatchStatusID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastBatchMasterIndex.AboutToCreateGroups += fastBatchMasterIndex_AboutToCreateGroups;

            this.fastBatchMasterIndex.ShowGroups = true;

            this.buttonNewLOT.Visible    = GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Smallpack || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pail;
            this.buttonRemoveLOT.Visible = GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Smallpack || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pail; this.separatorRemoveLOT.Visible = this.buttonRemoveLOT.Visible;
            this.buttonBatches.Visible   = !this.buttonNewLOT.Visible;
        }
Example #10
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.pickupViewModel.PropertyChanged += pickupDetailDTO_PropertyChanged;

                WarehouseAPIs warehouseAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>());

                this.combexWarehouseID.DataSource    = warehouseAPIs.GetWarehouseBases();
                this.combexWarehouseID.DisplayMember = CommonExpressions.PropertyName <WarehouseBase>(p => p.Name);
                this.combexWarehouseID.ValueMember   = CommonExpressions.PropertyName <WarehouseBase>(p => p.WarehouseID);
                this.bindingWarehouseID = this.combexWarehouseID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.WarehouseID), true, DataSourceUpdateMode.OnPropertyChanged);

                FillingLineAPIs fillingLineAPIs = new FillingLineAPIs(CommonNinject.Kernel.Get <IFillingLineAPIRepository>());

                this.combexFillingLineID.DataSource    = fillingLineAPIs.GetFillingLineBases();
                this.combexFillingLineID.DisplayMember = CommonExpressions.PropertyName <FillingLineBase>(p => p.NickName);
                this.combexFillingLineID.ValueMember   = CommonExpressions.PropertyName <FillingLineBase>(p => p.FillingLineID);
                this.bindingFillingLineID = this.combexFillingLineID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.FillingLineID), true, DataSourceUpdateMode.OnPropertyChanged);

                EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

                this.combexForkliftDriverID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.pickupViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Production);
                this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
                this.combexForkliftDriverID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
                this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);


                this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.pickupViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
                this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
                this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
                this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.pickupViewModel, "Remarks", true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingWarehouseID.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingFillingLineID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingForkliftDriverID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingStorekeeperID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.errorProviderMaster.DataSource = this.pickupViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #11
0
        public UserRegister(UserAPIs userAPIs, OrganizationalUnitAPIs organizationalUnitAPIs)
        {
            InitializeComponent();

            try
            {
                List <DomainUser> allUsers = new List <DomainUser>();

                //userAPIs.UpdateUserName("S-1-5-21-3775195119-1044016383-3360809325-1001", "NMVN\vendor");

                if (true)
                {
                    PrincipalContext  ctx     = new PrincipalContext(ContextType.Domain, "chevronvn.com"); //, "OU=SomeOU,dc=YourCompany,dc=com"// create your domain context and define the OU container to search in
                    UserPrincipal     qbeUser = new UserPrincipal(ctx);                                    // define a "query-by-example" principal - here, we search for a UserPrincipal (user)
                    PrincipalSearcher srch    = new PrincipalSearcher(qbeUser);                            // create your principal searcher passing in the QBE principal

                    foreach (var found in srch.FindAll())                                                  // find all matches
                    {                                                                                      // do whatever here - "found" is of type "Principal" - it could be user, group, computer.....
                        if (found.Sid.Value != null && found.Sid.Value != "" && found.SamAccountName != null && found.SamAccountName != "")
                        {
                            userAPIs.UpdateUserName(found.Sid.Value, found.SamAccountName);
                        }

                        allUsers.Add(new DomainUser()
                        {
                            FirstName = "", LastName = "", UserName = found.SamAccountName, SecurityIdentifier = found.Sid.Value
                        });                                                                                                                                      //found.UserPrincipalName: the same as SamAccountName, but with @chevron.com
                    }
                }
                else
                {
                    for (int i = 1; i <= 5; i++)
                    {
                        allUsers.Add(new DomainUser()
                        {
                            FirstName = "FIST NAME" + i.ToString(), LastName = "FIST NAME" + i.ToString(), UserName = "******", SecurityIdentifier = "S-1-5-21-2907738014-1953812902-1740135539-2131"
                        });
                    }
                }

                this.combexUserID.DataSource          = allUsers;
                this.combexUserID.DisplayMember       = CommonExpressions.PropertyName <DomainUser>(p => p.UserName);
                this.combexUserID.ValueMember         = CommonExpressions.PropertyName <DomainUser>(p => p.UserName);
                this.bindingUserName                  = this.combexUserID.DataBindings.Add("SelectedValue", this, CommonExpressions.PropertyName <DomainUser>(p => p.UserName), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingUserName.BindingComplete += binding_BindingComplete;

                this.userAPIs = userAPIs;
                this.organizationalUnitAPIs = organizationalUnitAPIs;

                this.combexOrganizationalUnitID.DataSource    = this.organizationalUnitAPIs.GetOrganizationalUnitIndexes();
                this.combexOrganizationalUnitID.DisplayMember = CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.LocationOrganizationalUnitName);
                this.combexOrganizationalUnitID.ValueMember   = CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.OrganizationalUnitID);
                this.bindingOrganizationalUnitID = this.combexOrganizationalUnitID.DataBindings.Add("SelectedValue", this, CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.OrganizationalUnitID), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingOrganizationalUnitID.BindingComplete += binding_BindingComplete;

                this.SameOUAccessLevel = GlobalEnums.AccessLevel.NoAccess;
                this.combexSameOUAccessLevels.DataSource = new List <ACL>()
                {
                    new ACL()
                    {
                        AccessLevelID = GlobalEnums.AccessLevel.NoAccess
                    }, new ACL()
                    {
                        AccessLevelID = GlobalEnums.AccessLevel.Readable
                    }, new ACL()
                    {
                        AccessLevelID = GlobalEnums.AccessLevel.Editable
                    }
                };
                this.combexSameOUAccessLevels.DisplayMember = CommonExpressions.PropertyName <ACL>(p => p.AccessLevelName);
                this.combexSameOUAccessLevels.ValueMember   = CommonExpressions.PropertyName <ACL>(p => p.AccessLevelID);
                this.combexSameOUAccessLevels.DataBindings.Add("SelectedValue", this, "SameOUAccessLevel", true, DataSourceUpdateMode.OnPropertyChanged);

                this.SameLocationAccessLevel = GlobalEnums.AccessLevel.NoAccess;
                this.combexSameLocationAccessLevels.DataSource = new List <ACL>()
                {
                    new ACL()
                    {
                        AccessLevelID = GlobalEnums.AccessLevel.NoAccess
                    }, new ACL()
                    {
                        AccessLevelID = GlobalEnums.AccessLevel.Readable
                    }, new ACL()
                    {
                        AccessLevelID = GlobalEnums.AccessLevel.Editable
                    }
                };
                this.combexSameLocationAccessLevels.DisplayMember = CommonExpressions.PropertyName <ACL>(p => p.AccessLevelName);
                this.combexSameLocationAccessLevels.ValueMember   = CommonExpressions.PropertyName <ACL>(p => p.AccessLevelID);
                this.combexSameLocationAccessLevels.DataBindings.Add("SelectedValue", this, "SameLocationAccessLevel", true, DataSourceUpdateMode.OnPropertyChanged);

                this.OtherOUAccessLevel = GlobalEnums.AccessLevel.NoAccess;
                this.combexOtherOUAccessLevels.DataSource = new List <ACL>()
                {
                    new ACL()
                    {
                        AccessLevelID = GlobalEnums.AccessLevel.NoAccess
                    }, new ACL()
                    {
                        AccessLevelID = GlobalEnums.AccessLevel.Readable
                    }
                };
                this.combexOtherOUAccessLevels.DisplayMember = CommonExpressions.PropertyName <ACL>(p => p.AccessLevelName);
                this.combexOtherOUAccessLevels.ValueMember   = CommonExpressions.PropertyName <ACL>(p => p.AccessLevelID);
                this.combexOtherOUAccessLevels.DataBindings.Add("SelectedValue", this, "OtherOUAccessLevel", true, DataSourceUpdateMode.OnPropertyChanged);
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #12
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate   = this.dateTimexEntryDate.DataBindings.Add("Value", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingReference   = this.textexReference.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.Reference), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVoucherCode = this.textexVoucherCode.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDescription = this.textexDescription.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks     = this.textexRemarks.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption     = this.labelCaption.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.Caption));

            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            this.combexForecastLocationID.DataSource    = locationAPIs.GetLocationBases();
            this.combexForecastLocationID.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
            this.combexForecastLocationID.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
            this.bindingForecastLocationID = this.combexForecastLocationID.DataBindings.Add("SelectedValue", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.ForecastLocationID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.bindingEntryDate.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReference.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVoucherCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingForecastLocationID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastForecastIndex.AboutToCreateGroups += fastForecastIndex_AboutToCreateGroups;

            this.fastForecastIndex.ShowGroups    = true;
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
Example #13
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingCode = this.textexCode.DataBindings.Add("Text", this.binLocationViewModel, CommonExpressions.PropertyName <BinLocationDTO>(p => p.Code), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingName = this.textexName.DataBindings.Add("Text", this.binLocationViewModel, CommonExpressions.PropertyName <BinLocationDTO>(p => p.Name), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingContactInfo   = this.textexContactInfo.DataBindings.Add("Text", this.binLocationViewModel, CommonExpressions.PropertyName <BinLocationDTO>(p => p.ContactInfo), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVATCode       = this.textexVATCode.DataBindings.Add("Text", this.binLocationViewModel, CommonExpressions.PropertyName <BinLocationDTO>(p => p.VATCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingAttentionName = this.textexAttentionName.DataBindings.Add("Text", this.binLocationViewModel, CommonExpressions.PropertyName <BinLocationDTO>(p => p.AttentionName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.binLocationViewModel, CommonExpressions.PropertyName <BinLocationDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

            WarehouseAPIs warehouseAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>());

            this.combexWarehouseID.DataSource    = warehouseAPIs.GetWarehouseBases();
            this.combexWarehouseID.DisplayMember = CommonExpressions.PropertyName <WarehouseBase>(p => p.Name);
            this.combexWarehouseID.ValueMember   = CommonExpressions.PropertyName <WarehouseBase>(p => p.WarehouseID);
            this.bindingWarehouseID = this.combexWarehouseID.DataBindings.Add("SelectedValue", this.binLocationViewModel, CommonExpressions.PropertyName <BinLocationViewModel>(p => p.WarehouseID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingContactInfo.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVATCode.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingAttentionName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingWarehouseID.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastBinLocationIndex.AboutToCreateGroups += fastBinLocationIndex_AboutToCreateGroups;

            this.fastBinLocationIndex.ShowGroups = true;
            this.olvInActive.Renderer            = new MappedImageRenderer(new Object[] { true, Resources.Void_16 });
        }
Example #14
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate       = this.dateTimexEntryDate.DataBindings.Add("Value", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingReference       = this.textexReference.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.Reference), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVoucherCode     = this.textexVoucherCode.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDeliveryDate    = this.dateTimexDeliveryDate.DataBindings.Add("Value", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.DeliveryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingContactInfo     = this.textexContactInfo.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.ContactInfo), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDeliveryAddress = this.textexDeliveryAddress.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.ShippingAddress), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDescription     = this.textexDescription.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks         = this.textexRemarks.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption         = this.labelCaption.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.Caption));

            CustomerAPIs customerAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());

            this.combexCustomerID.DataSource    = customerAPIs.GetCustomerBases();
            this.combexCustomerID.DisplayMember = CommonExpressions.PropertyName <CustomerBase>(p => p.Name);
            this.combexCustomerID.ValueMember   = CommonExpressions.PropertyName <CustomerBase>(p => p.CustomerID);
            this.bindingCustomerID = this.combexCustomerID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.CustomerID), true, DataSourceUpdateMode.OnPropertyChanged);

            CustomerAPIs receiverAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());

            this.combexReceiverID.DataSource    = receiverAPIs.GetCustomerBases();
            this.combexReceiverID.DisplayMember = CommonExpressions.PropertyName <CustomerBase>(p => p.Name);
            this.combexReceiverID.ValueMember   = CommonExpressions.PropertyName <CustomerBase>(p => p.CustomerID);
            this.bindingReceiverID = this.combexReceiverID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ReceiverID), true, DataSourceUpdateMode.OnPropertyChanged);

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexSalespersonID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.salesOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Saleperson);
            this.combexSalespersonID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexSalespersonID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingSalespersonID = this.combexSalespersonID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.SalespersonID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingEntryDate.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReference.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVoucherCode.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDeliveryDate.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingContactInfo.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDeliveryAddress.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingCustomerID.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReceiverID.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingSalespersonID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastSalesOrderIndex.AboutToCreateGroups += fastSalesOrderIndex_AboutToCreateGroups;

            this.fastSalesOrderIndex.ShowGroups  = true;
            this.olvApproved.Renderer            = new MappedImageRenderer(new Object[] { 1, Resources.Placeholder16, 2, Resources.Void_16 });
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate      = this.dateTimexEntryDate.DataBindings.Add("Value", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingReference      = this.textexReference.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.Reference), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingWarehouseName  = this.textexWarehouseName.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.WarehouseName), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingAdjustmentJobs = this.textexAdjustmentJobs.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.AdjustmentJobs), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDescription    = this.textexDescription.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks        = this.textexRemarks.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption        = this.labelCaption.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.Caption));

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.warehouseAdjustmentViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingEntryDate.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReference.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingWarehouseName.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingAdjustmentJobs.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete        += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete        += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingStorekeeperID.BindingComplete             += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastWarehouseAdjustmentIndex.AboutToCreateGroups += fastWarehouseAdjustmentIndex_AboutToCreateGroups;

            this.fastWarehouseAdjustmentIndex.ShowGroups = true;
            this.olvApproved.Renderer            = new MappedImageRenderer(new Object[] { false, Resources.Placeholder16 });
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
Example #16
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingCaption = this.labelCaption.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.Caption));

            this.bindingEntryDate     = this.dateTimexEntryDate.DataBindings.Add("Value", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVoucherCodes  = this.textexVoucherCodes.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.VoucherCodes), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVehicle       = this.textexVehicle.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.Vehicle), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVehicleDriver = this.textexVehicleDriver.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.VehicleDriver), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingDescription = this.textexDescription.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks     = this.textexRemarks.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);


            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexForkliftDriverID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.goodsIssueViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexForkliftDriverID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.goodsIssueViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.bindingEntryDate.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVoucherCodes.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVehicle.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVehicleDriver.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingForkliftDriverID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingStorekeeperID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastGoodsIssueIndex.AboutToCreateGroups += fastGoodsIssueIndex_AboutToCreateGroups;

            this.fastGoodsIssueIndex.ShowGroups = true;
            this.olvApproved.Renderer           = new MappedImageRenderer(new Object[] { false, Resources.Placeholder16 });

            this.tableLayoutMaster.ColumnStyles[this.tableLayoutMaster.ColumnCount - 1].SizeType = SizeType.Absolute; this.tableLayoutMaster.ColumnStyles[this.tableLayoutMaster.ColumnCount - 1].Width = 10;
        }
Example #17
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingLavieID     = this.textLavieID.TextBox.DataBindings.Add("Text", this, "resetLineIndex", true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingItemNumber  = this.textexItemNumber.DataBindings.Add("Text", this.lavieViewModel, CommonExpressions.PropertyName <LavieDTO>(p => p.ItemNumber), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingProductName = this.textexProductName.DataBindings.Add("Text", this.lavieViewModel, CommonExpressions.PropertyName <LavieDTO>(p => p.ProductName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingLavieID.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingItemNumber.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingProductName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastLavieIndex.AboutToCreateGroups += fastLavieIndex_AboutToCreateGroups;

            this.fastLavieIndex.ShowGroups = true;
            //this.olvInActive.Renderer = new MappedImageRenderer(new Object[] { true, Resources.Void_16 });

            this.dgvRepacks.AutoGenerateColumns = false;
            this.dgvRepacks.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            this.dgvRepacks.DataSource          = this.LavieIndexes;
        }
Example #18
0
        public UserOUs(OrganizationalUnitAPIs organizationalUnitAPIs, bool addOU)
        {
            InitializeComponent();

            try
            {
                this.organizationalUnitRepository = CommonNinject.Kernel.Get <IOrganizationalUnitRepository>();

                LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());
                this.combexNewLocationID.DataSource    = locationAPIs.GetLocationBases();
                this.combexNewLocationID.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
                this.combexNewLocationID.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
                this.bindingNewLocationID = this.combexNewLocationID.DataBindings.Add("SelectedValue", this, "NewLocationID", true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingNewLocationID.BindingComplete += binding_BindingComplete;

                this.organizationalUnitAPIs = organizationalUnitAPIs;
                this.combexOrganizationalUnitID.DataSource    = this.organizationalUnitAPIs.GetOrganizationalUnitIndexes();
                this.combexOrganizationalUnitID.DisplayMember = CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.LocationOrganizationalUnitName);
                this.combexOrganizationalUnitID.ValueMember   = CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.OrganizationalUnitID);
                this.bindingOrganizationalUnitID = this.combexOrganizationalUnitID.DataBindings.Add("SelectedValue", this, CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.OrganizationalUnitID), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingOrganizationalUnitID.BindingComplete += binding_BindingComplete;
                this.textexNewOrganizationalUnitID.TextChanged   += textexNewOrganizationalUnitID_TextChanged;

                this.addOU = addOU;
                this.labelOrganizationalUnitID.Visible    = !this.addOU; this.combexOrganizationalUnitID.Visible = !this.addOU;
                this.labelNewOrganizationalUnitID.Visible = this.addOU; this.textexNewOrganizationalUnitID.Visible = this.addOU;
                this.labelNewLocationID.Visible           = this.addOU; this.combexNewLocationID.Visible = this.addOU;
                this.Text          = this.addOU ? "Add new organizational unit" : "Remove OU";
                this.buttonOK.Text = this.addOU ? "Add" : "Remove";
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #19
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.transferOrderViewModel.PropertyChanged += transferOrderDetailDTO_PropertyChanged;

                WarehouseAPIs warehouseAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get<IWarehouseAPIRepository>());

                this.combexWarehouseID.DataSource = warehouseAPIs.GetWarehouseBases();
                this.combexWarehouseID.DisplayMember = CommonExpressions.PropertyName<WarehouseBase>(p => p.Name);
                this.combexWarehouseID.ValueMember = CommonExpressions.PropertyName<WarehouseBase>(p => p.WarehouseID);
                this.bindingWarehouseID = this.combexWarehouseID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.WarehouseID), true, DataSourceUpdateMode.OnPropertyChanged);

                WarehouseAPIs warehouseReceiptAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get<IWarehouseAPIRepository>());
                this.combexWarehouseReceiptID.DataSource = warehouseReceiptAPIs.GetWarehouseBases();
                this.combexWarehouseReceiptID.DisplayMember = CommonExpressions.PropertyName<WarehouseBase>(p => p.Name);
                this.combexWarehouseReceiptID.ValueMember = CommonExpressions.PropertyName<WarehouseBase>(p => p.WarehouseID);
                this.bindingWarehouseReceiptID = this.combexWarehouseReceiptID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.WarehouseReceiptID), true, DataSourceUpdateMode.OnPropertyChanged);

                TransferOrderTypeAPIs transferOrderTypeAPIs = new TransferOrderTypeAPIs(CommonNinject.Kernel.Get<ITransferOrderTypeAPIRepository>());

                this.combexTransferOrderTypeID.DataSource = transferOrderTypeAPIs.GetTransferOrderTypeBases();
                this.combexTransferOrderTypeID.DisplayMember = CommonExpressions.PropertyName<TransferOrderTypeBase>(p => p.Name);
                this.combexTransferOrderTypeID.ValueMember = CommonExpressions.PropertyName<TransferOrderTypeBase>(p => p.TransferOrderTypeID);
                this.bindingTransferOrderTypeID = this.combexTransferOrderTypeID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.TransferOrderTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.combexTransferPackageTypeID.DataSource = transferOrderTypeAPIs.GetTransferPackageTypeBases();
                this.combexTransferPackageTypeID.DisplayMember = CommonExpressions.PropertyName<TransferPackageTypeBase>(p => p.Name);
                this.combexTransferPackageTypeID.ValueMember = CommonExpressions.PropertyName<TransferPackageTypeBase>(p => p.TransferPackageTypeID);
                this.bindingTransferPackageTypeID = this.combexTransferPackageTypeID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.TransferPackageTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

                EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get<IEmployeeAPIRepository>());

                this.combexForkliftDriverID.DataSource = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.transferOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
                this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName<EmployeeBase>(p => p.Name);
                this.combexForkliftDriverID.ValueMember = CommonExpressions.PropertyName<EmployeeBase>(p => p.EmployeeID);
                this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.combexStorekeeperID.DataSource = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.transferOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
                this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName<EmployeeBase>(p => p.Name);
                this.combexStorekeeperID.ValueMember = CommonExpressions.PropertyName<EmployeeBase>(p => p.EmployeeID);
                this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);
                
                this.bindingEntryDate = this.dateTimexEntryDate.DataBindings.Add("Value", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingVoucherCode = this.textexVoucherCode.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingVehicle = this.textexVehicle.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.Vehicle), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingVehicleDriver = this.textexVehicleDriver.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.VehicleDriver), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingTransferJobs = this.textexTransferJobs.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.TransferJobs), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingWarehouseID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingWarehouseReceiptID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingTransferOrderTypeID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingTransferPackageTypeID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            
                this.bindingForkliftDriverID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingStorekeeperID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingVoucherCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingVehicle.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingVehicleDriver.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingEntryDate.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingTransferJobs.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.errorProviderMaster.DataSource = this.transferOrderViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #20
0
        private void PublicApplicationLogon_Load(object sender, EventArgs e)
        {
            #region TEST
            //// List of strings for your names
            //List<string> allUsers = new List<string>();

            //// create your domain context and define the OU container to search in
            //PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "DOMAINNAME",
            //                                            "OU=SomeOU,dc=YourCompany,dc=com");

            //// define a "query-by-example" principal - here, we search for a UserPrincipal (user)
            //UserPrincipal qbeUser = new UserPrincipal(ctx);

            //// create your principal searcher passing in the QBE principal
            //PrincipalSearcher srch = new PrincipalSearcher(qbeUser);

            //// find all matches
            //foreach (var found in srch.FindAll())
            //{
            //    // do whatever here - "found" is of type "Principal" - it could be user, group, computer.....
            //    allUsers.Add(found.DisplayName);
            //}



            //using (var context = new PrincipalContext(ContextType.Domain, "yourdomain.com"))
            //{
            //    using (var searcher = new PrincipalSearcher(new UserPrincipal(context)))
            //    {
            //        foreach (var result in searcher.FindAll())
            //        {
            //            DirectoryEntry de = result.GetUnderlyingObject() as DirectoryEntry;
            //            Console.WriteLine("First Name: " + de.Properties["givenName"].Value);
            //            Console.WriteLine("Last Name : " + de.Properties["sn"].Value);
            //            Console.WriteLine("SAM account name   : " + de.Properties["samAccountName"].Value);
            //            Console.WriteLine("User principal name: " + de.Properties["userPrincipalName"].Value);
            //            Console.WriteLine();
            //        }
            //    }
            //}
            //Console.ReadLine();



            ////string plainText = "Lê Minh Hiệp";
            ////// Convert the plain string pwd into bytes
            //////byte[] plainTextBytes = UnicodeEncoding.Unicode.GetBytes(plainText);
            //////System.Security.Cryptography.HashAlgorithm hashAlgo = new System.Security.Cryptography.SHA256Managed();
            //////byte[] hash = hashAlgo.ComputeHash(plainTextBytes);

            ////byte[] data = UnicodeEncoding.Unicode.GetBytes(plainText);
            ////data = new System.Security.Cryptography.SHA256Managed().ComputeHash(data);
            ////String hash = UnicodeEncoding.Unicode.GetString(data);
            //////CustomMsgBox.Show(hash);

            #endregion TEST

            ////JUST FOR 4L FillingLine ONLY. SHOULD REMOVE NEXT TIME
            //CommonConfigs.AddUpdateAppSetting("ConfigID", ((int)GlobalVariables.FillingLine.Import).ToString());

            try
            {
                if (!(int.TryParse(CommonConfigs.ReadSetting("ConfigID"), out GlobalVariables.ConfigID)))
                {
                    throw new Exception("Please check ConfigID value in config file.");
                }

                UserPrincipal currentUserPrincipal = UserPrincipal.Current;
                if (currentUserPrincipal == null || currentUserPrincipal.Sid == null)
                {
                    throw new Exception("Sorry, can not get current user principal!");
                }

                this.baseRepository = CommonNinject.Kernel.Get <IBaseRepository>();

                UserAPIs           userAPIs    = new UserAPIs(CommonNinject.Kernel.Get <IUserAPIRepository>());
                IList <ActiveUser> activeUsers = userAPIs.GetActiveUsers(GlobalEnums.CBPP ? "S-1-5-21-2058209122-1687518253-2045704780-1001" : currentUserPrincipal.Sid.Value);

                if (activeUsers.Count > 0)
                {
                    if (GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Smallpack || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pail || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Medium4L || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Import || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Drum)
                    {
                        int?accessLevel = this.baseRepository.TotalSmartCodingEntities.GetAccessLevel(activeUsers[0].UserID, (int)TotalBase.Enums.GlobalEnums.NmvnTaskID.SmartCoding + (int)GlobalVariables.ConfigID, 0).Single();
                        if (accessLevel != (int)TotalBase.Enums.GlobalEnums.AccessLevel.Editable)
                        {
                            activeUsers = new List <ActiveUser>();
                        }

                        this.comboUserID.Enabled = false;
                    }
                    else
                    {
                        this.Height = this.Height - 80;
                    }
                }

                if (activeUsers.Count > 0)
                {
                    this.comboSecurityIdentifier.Items.Add(activeUsers[0].UserName);
                    this.comboSecurityIdentifier.SelectedIndex = 0;

                    this.comboUserID.DataSource    = activeUsers;
                    this.comboUserID.DisplayMember = CommonExpressions.PropertyName <ActiveUser>(p => p.FullyQualifiedOrganizationalUnitName);
                    this.comboUserID.ValueMember   = CommonExpressions.PropertyName <ActiveUser>(p => p.UserID);

                    FillingLineAPIs fillingLineAPIs = new FillingLineAPIs(CommonNinject.Kernel.Get <IFillingLineAPIRepository>());

                    this.comboFillingLineID.DataSource    = fillingLineAPIs.GetFillingLineBases();
                    this.comboFillingLineID.DisplayMember = CommonExpressions.PropertyName <FillingLineBase>(p => p.Name);
                    this.comboFillingLineID.ValueMember   = CommonExpressions.PropertyName <FillingLineBase>(p => p.FillingLineID);


                    if (GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Smallpack || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pail || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Medium4L || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Import || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Drum)
                    {
                        this.comboFillingLineID.SelectedValue = GlobalVariables.ConfigID;
                    }

                    if (!(GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Smallpack || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Pail || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Medium4L || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Import || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Drum))
                    {
                        this.labelFillingLineID.Visible = false;
                        this.comboFillingLineID.Visible = false;
                    }

                    if (GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Drum)
                    {
                        this.checkGlobalDrumWithDigit.Visible = true;
                    }

                    this.comboComportName.DataSource = System.IO.Ports.SerialPort.GetPortNames();
                    if (this.comboComportName.Items.Count == 0)
                    {
                        this.comboComportName.DataSource = null;
                        this.comboComportName.Items.Add("COM0");
                    }

                    string comportName = CommonConfigs.ReadSetting("ComportName");
                    if (this.comboComportName.Items.IndexOf(comportName) >= 0)
                    {
                        this.comboComportName.SelectedIndex = this.comboComportName.Items.IndexOf(comportName);
                    }


                    this.buttonDownload.Visible                = true;
                    this.buttonLoginRestore.Visible            = activeUsers[0].IsDatabaseAdmin;
                    this.buttonConnectServer.Visible           = activeUsers[0].IsDatabaseAdmin;
                    this.buttonWebapi.Visible                  = activeUsers[0].IsDatabaseAdmin;
                    this.buttonApplicationRoleIgnored.Visible  = activeUsers[0].IsDatabaseAdmin;
                    this.separatorResetApplicationRole.Visible = activeUsers[0].IsDatabaseAdmin;
                }
                else
                {
                    this.comboSecurityIdentifier.Visible = false;
                    this.comboUserID.Visible             = false;
                    this.comboFillingLineID.Visible      = false;

                    this.labelUserID.Visible          = false;
                    this.labelFillingLineID.Visible   = false;
                    this.labelSecurityIdentifier.Text = "\r\n" + "Sorry, user: "******"\r\n" + "Don't have permission to run this program." + "\r\n" + "\r\n" + "Contact your admin for more information. Thank you!" + "\r\n" + "\r\n" + "\r\n" + "Xin lỗi, bạn chưa được cấp quyền sử dụng phần mềm này.";

                    this.buttonLogin.Visible = false;
                }

                if (ApplicationRoles.ExceptionMessage != null && ApplicationRoles.ExceptionMessage != "")
                {
                    CustomMsgBox.Show(this, ApplicationRoles.ExceptionMessage, "Warning", MessageBoxButtons.OK);
                }
                this.buttonApplicationRoleRequired.Visible = !ApplicationRoles.Required;
                this.buttonApplicationRoleIgnored.Visible  = ApplicationRoles.Required;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #21
0
        public UserReferences()
        {
            InitializeComponent();
            try
            {
                this.UserID = ContextAttributes.User.UserID;

                ModuleAPIs moduleAPIs = new ModuleAPIs(CommonNinject.Kernel.Get <IModuleAPIRepository>());

                this.fastNMVNTasks.ShowGroups           = true;
                this.fastNMVNTasks.AboutToCreateGroups += fastNMVNTasks_AboutToCreateGroups;
                this.fastNMVNTasks.SetObjects(moduleAPIs.GetModuleDetailIndexes());
                this.fastNMVNTasks.Sort(this.olvModuleName, SortOrder.Ascending);

                this.userAPIs = new UserAPIs(CommonNinject.Kernel.Get <IUserAPIRepository>());
                this.comboUserID.ComboBox.DataSource    = this.userAPIs.GetUserIndexes();
                this.comboUserID.ComboBox.DisplayMember = CommonExpressions.PropertyName <UserIndex>(p => p.FullyQualifiedUserName);
                this.comboUserID.ComboBox.ValueMember   = CommonExpressions.PropertyName <UserIndex>(p => p.UserID);
                this.bindingUserID = this.comboUserID.ComboBox.DataBindings.Add("SelectedValue", this, CommonExpressions.PropertyName <UserIndex>(p => p.UserID), true, DataSourceUpdateMode.OnPropertyChanged);


                this.gridexUserAccessControl.AutoGenerateColumns = false;
                this.gridexUserAccessControl.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

                this.bindingListUserAccessControls              = new BindingList <UserAccessControlDTO>();
                this.gridexUserAccessControl.DataSource         = this.bindingListUserAccessControls;
                this.bindingListUserAccessControls.ListChanged += bindingListUserAccessControls_ListChanged;

                StackedHeaderDecorator stackedHeaderDecorator = new StackedHeaderDecorator(this.gridexUserAccessControl);
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #22
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate = this.dateTimexEntryDate.DataBindings.Add("Value", this.batchViewModel, "EntryDate", true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCode      = this.textexCode.DataBindings.Add("Text", this.batchViewModel, "Code", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingNextPackNo   = this.textexNextPackNo.DataBindings.Add("Text", this.batchViewModel, "NextPackNo", true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingNextCartonNo = this.textexNextCartonNo.DataBindings.Add("Text", this.batchViewModel, "NextCartonNo", true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingNextPalletNo = this.textexNextPalletNo.DataBindings.Add("Text", this.batchViewModel, "NextPalletNo", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingBatchPackNo   = this.textexBatchPackNo.DataBindings.Add("Text", this.batchViewModel, "BatchPackNo", true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingBatchCartonNo = this.textexBatchCartonNo.DataBindings.Add("Text", this.batchViewModel, "BatchCartonNo", true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingBatchPalletNo = this.textexBatchPalletNo.DataBindings.Add("Text", this.batchViewModel, "BatchPalletNo", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingFinalCartonNo = this.textexFinalCartonNo.DataBindings.Add("Text", this.batchViewModel, "FinalCartonNo", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingAutoCarton  = this.checkAutoCarton.DataBindings.Add("Checked", this.batchViewModel, "AutoCarton", true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingAutoBarcode = this.checkAutoBarcode.DataBindings.Add("Checked", this.batchViewModel, "AutoBarcode", true, DataSourceUpdateMode.OnPropertyChanged);
            this.labelFinalCartonNo.DataBindings.Add("Visible", this.batchViewModel, "AutoBarcode", true, DataSourceUpdateMode.OnPropertyChanged);
            this.textexFinalCartonNo.DataBindings.Add("Visible", this.batchViewModel, "AutoBarcode", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.batchViewModel, "Remarks", true, DataSourceUpdateMode.OnPropertyChanged);

            this.textexCommodityName.DataBindings.Add("Text", this.batchViewModel, CommonExpressions.PropertyName <BatchViewModel>(p => p.CommodityName), true);
            this.textexCommodityAPICode.DataBindings.Add("Text", this.batchViewModel, CommonExpressions.PropertyName <BatchViewModel>(p => p.CommodityAPICode), true);

            CommodityAPIs commodityAPIs = new CommodityAPIs(CommonNinject.Kernel.Get <ICommodityAPIRepository>());

            commodityAPIs.ImportCommodities(); //IMPORT Commodities FROM EXISTING SYSTEM

            this.combexCommodityID.DataSource    = commodityAPIs.GetCommodityBases().Where(p => p.FillingLineIDs.Contains(((int)GlobalVariables.FillingLineID).ToString()) || GlobalVariables.ConfigID == (int)GlobalVariables.FillingLine.Import).ToList();
            this.combexCommodityID.DisplayMember = CommonExpressions.PropertyName <CommodityBase>(p => p.DisplayCode);
            this.combexCommodityID.ValueMember   = CommonExpressions.PropertyName <CommodityBase>(p => p.CommodityID);
            this.bindingCommodityID = this.combexCommodityID.DataBindings.Add("SelectedValue", this.batchViewModel, CommonExpressions.PropertyName <BatchViewModel>(p => p.CommodityID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingEntryDate.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCode.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingNextPackNo.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingNextCartonNo.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingNextPalletNo.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingBatchPackNo.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingBatchCartonNo.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingBatchPalletNo.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingFinalCartonNo.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingAutoBarcode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingAutoCarton.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingCommodityID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
        }
Example #23
0
        public MasterMDI(GlobalEnums.NmvnTaskID nmvnTaskID, Form loadedView, bool isMainView)
        {
            InitializeComponent();

            try
            {
                this.nmvnTaskID = nmvnTaskID;
                IModuleAPIRepository moduleAPIRepository = CommonNinject.Kernel.Get <IModuleAPIRepository>();
                this.moduleAPIs = new ModuleAPIs(moduleAPIRepository);

                if (GlobalEnums.NMVNOnly)
                {
                    this.panelTopRight.Visible = false;
                }

                switch (this.nmvnTaskID)
                {
                case GlobalEnums.NmvnTaskID.SmartCoding:
                    this.buttonEscape.Visible              = false;
                    this.buttonLoading.Visible             = false;
                    this.buttonNew.Visible                 = false;
                    this.buttonEdit.Visible                = false;
                    this.buttonSave.Visible                = false;
                    this.buttonDelete.Visible              = false;
                    this.buttonImport.Visible              = false;
                    this.buttonExport.Visible              = false;
                    this.toolStripSeparatorImport.Visible  = false;
                    this.buttonApprove.Visible             = false;
                    this.buttonVoid.Visible                = false;
                    this.toolStripSeparatorApprove.Visible = false;
                    this.toolStripSeparatorVoid.Visible    = false;
                    this.buttonPrint.Visible               = false;
                    this.buttonPrintPreview.Visible        = false;
                    this.toolStripSeparatorPrint.Visible   = false;
                    this.separatorInputData.Visible        = false;
                    this.labelSearchBarcode.Visible        = false;
                    this.toolStripTopHead.Visible          = false;
                    break;

                case GlobalEnums.NmvnTaskID.Batch:
                    this.Size            = new Size(1180, 732);
                    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
                    this.MinimizeBox     = false; this.MaximizeBox = false; this.WindowState = FormWindowState.Normal;

                    this.panelTopRight.Visible = false;
                    this.panelTopLeft.Dock     = DockStyle.Fill;
                    break;

                case GlobalEnums.NmvnTaskID.FillingLine:
                    this.Size            = new Size(620, 360);
                    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
                    this.MinimizeBox     = false; this.MaximizeBox = false; this.WindowState = FormWindowState.Normal;

                    this.toolStripTopHead.Visible = false;
                    this.panelTopRight.Visible    = false;
                    this.panelTopLeft.Dock        = DockStyle.Fill;
                    this.statusStrip.Visible      = false;
                    break;

                default:
                    break;
                }

                this.beginingDateBinding = this.dateTimexLowerFillterDate.DataBindings.Add("Value", GlobalEnums.GlobalOptionSetting, CommonExpressions.PropertyName <OptionSetting>(p => p.LowerFillterDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.endingDateBinding   = this.dateTimexUpperFillterDate.DataBindings.Add("Value", GlobalEnums.GlobalOptionSetting, CommonExpressions.PropertyName <OptionSetting>(p => p.UpperFillterDate), true, DataSourceUpdateMode.OnPropertyChanged);

                this.beginingDateBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.endingDateBinding.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.buttonNaviBarHeaderVisibleBinding         = this.buttonNaviBarHeader.DataBindings.Add("Visible", this.naviBarModuleMaster, "Collapsed", true, DataSourceUpdateMode.OnPropertyChanged);
                this.buttonNaviBarHeaderVisibleBinding.Parse  += new ConvertEventHandler(buttonNaviBarHeaderVisibleBinding_Parse);
                this.buttonNaviBarHeaderVisibleBinding.Format += new ConvertEventHandler(buttonNaviBarHeaderVisibleBinding_Format);

                #region fastNMVNTask
                this.fastNMVNTask.AboutToCreateGroups += fastNMVNTask_AboutToCreateGroups;
                this.fastNMVNTask.ShowGroups           = true;

                //this.fastNMVNTask.UseTranslucentHotItem = true; //DEFAULT HotItem
                fastNMVNTask.UseTranslucentHotItem = false;
                fastNMVNTask.UseHotItem            = true;
                fastNMVNTask.UseExplorerTheme      = false;

                RowBorderDecoration rbd = new RowBorderDecoration();
                rbd.BorderPen      = new Pen(Color.SeaGreen, 2);
                rbd.FillBrush      = null;
                rbd.CornerRounding = 4.0f;
                HotItemStyle hotItemStyle2 = new HotItemStyle();
                hotItemStyle2.Decoration  = rbd;
                fastNMVNTask.HotItemStyle = hotItemStyle2;
                #endregion fastNMVNTask


                if (loadedView != null)
                {
                    this.naviBarModuleMaster.Visible = false;
                    this.OpenView(loadedView);
                }
                else
                {
                    this.InitializeModuleMaster();
                    //this.buttonNaviBarHeader_Click(this.buttonNaviBarHeader, new EventArgs());
                }

                DateTime buildDate = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
                this.statusVersion.Text        = "Version 1.0." + GlobalVariables.ConfigVersionID(GlobalVariables.ConfigID).ToString() + ", Date: " + buildDate.ToString("dd/MM/yyyy HH:mm:ss");
                this.labelDataSource.Text      = this.moduleAPIs.DataSource;
                this.labelApplicationRole.Text = ApplicationRoles.Required && ApplicationRoles.Name != "" && ApplicationRoles.ExceptionMessage == "" ? "[Application Role]" : "[Windows Authentication]";

                this.comboSearchBarcode.Text       = this.searchPlaceHolder;
                this.toolUserReferences.Visible    = ContextAttributes.User.IsDatabaseAdmin && false; //HIDE AT CHEVRON
                this.toolUserGroupControls.Visible = ContextAttributes.User.IsDatabaseAdmin;
                this.statusUserDescription.Text    = ContextAttributes.User.FullyQualifiedUserName;

                this.panelTopRight.Width = (this.nmvnTaskID == GlobalEnums.NmvnTaskID.SmartCoding ? 10 : this.labelSearchBarcode.Width) + this.comboSearchBarcode.Width + this.buttonSearchBarcode.Width + 10;
                this.panelTop.Height     = this.nmvnTaskID == GlobalEnums.NmvnTaskID.SmartCoding ? 61 : 39;

                #region JUST DISABLE FOR CHEVRON
                int?accessLevel = moduleAPIRepository.TotalSmartCodingEntities.GetAccessLevel(ContextAttributes.User.UserID, (int)TotalBase.Enums.GlobalEnums.NmvnTaskID.MonthEnd, 0).Single();
                if (accessLevel < (int)TotalBase.Enums.GlobalEnums.AccessLevel.Readable)
                {
                    this.buttonLockedDate.Enabled = false;
                }

                this.txtLockedDate.Visible = false;
                //this.buttonLockedDate.Visible = false;
                #endregion

                this.isMainView = isMainView;
                if (this.isMainView)
                {
                    this.AddEventLogs("Log on application");
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #24
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            CommodityAPIs commodityAPIs = new CommodityAPIs(CommonNinject.Kernel.Get <ICommodityAPIRepository>());

            this.combexCommodityID.DataSource    = commodityAPIs.GetCommodityBases();
            this.combexCommodityID.DisplayMember = CommonExpressions.PropertyName <CommodityBase>(p => p.Code);
            this.combexCommodityID.ValueMember   = CommonExpressions.PropertyName <CommodityBase>(p => p.CommodityID);
            this.bindingCommodityID = this.combexCommodityID.DataBindings.Add("SelectedValue", this.commoditySettingViewModel, CommonExpressions.PropertyName <CommoditySettingDTO>(p => p.CommodityID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingCommodityName         = this.textexCommodityName.DataBindings.Add("Text", this.commoditySettingViewModel, CommonExpressions.PropertyName <CommoditySettingDTO>(p => p.CommodityName), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCommodityCategoryName = this.textexCommodityCategoryName.DataBindings.Add("Text", this.commoditySettingViewModel, CommonExpressions.PropertyName <CommoditySettingDTO>(p => p.CommodityCategoryName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingPackageSize   = this.textexPackageSize.DataBindings.Add("Text", this.commoditySettingViewModel, CommonExpressions.PropertyName <CommoditySettingDTO>(p => p.PackageSize), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingPackageVolume = this.numericPackageVolume.DataBindings.Add("Value", this.commoditySettingViewModel, CommonExpressions.PropertyName <CommoditySettingDTO>(p => p.PackageVolume), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.commoditySettingViewModel, CommonExpressions.PropertyName <CommoditySettingDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingCommodityID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingCommodityName.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCommodityCategoryName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingPackageSize.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingPackageVolume.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastCommoditySettingIndex.AboutToCreateGroups += fastCommoditySettingIndex_AboutToCreateGroups;

            this.fastCommoditySettingIndex.ShowGroups = true;
        }
Example #25
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingName    = this.textexName.DataBindings.Add("Text", this.commodityCategoryViewModel, CommonExpressions.PropertyName <CommodityCategoryDTO>(p => p.Name), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.commodityCategoryViewModel, CommonExpressions.PropertyName <CommodityCategoryDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingName.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastCommodityCategoryIndex.AboutToCreateGroups += fastCommodityCategoryIndex_AboutToCreateGroups;
            this.fastCommodityCategoryIndex.ShowGroups           = true;
        }
Example #26
0
        protected override void InitializeDataGridBinding()
        {
            base.InitializeDataGridBinding();
            this.InitializeDataGridReadonlyColumns(this.gridexViewDetails);

            this.gridexViewDetails.AutoGenerateColumns = false;
            this.gridexViewDetails.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            this.bindingSourceViewDetails.DataSource = this.commoditySettingViewModel.ViewDetails;
            this.gridexViewDetails.DataSource        = this.bindingSourceViewDetails;

            this.bindingSourceViewDetails.AddingNew      += bindingSourceViewDetails_AddingNew;
            this.gridexViewDetails.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(this.dataGridViewDetails_EditingControlShowing);
            this.gridexViewDetails.ReadOnlyChanged       += new System.EventHandler(this.dataGrid_ReadOnlyChanged);

            DataGridViewComboBoxColumn comboBoxColumn;
            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            comboBoxColumn               = (DataGridViewComboBoxColumn)this.gridexViewDetails.Columns[CommonExpressions.PropertyName <CommoditySettingDetailDTO>(p => p.SettingLocationID)];
            comboBoxColumn.DataSource    = locationAPIs.GetLocationBases(true);
            comboBoxColumn.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Code);
            comboBoxColumn.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);

            StackedHeaderDecorator stackedHeaderDecorator = new StackedHeaderDecorator(this.gridexViewDetails);
        }
Example #27
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingCode = this.textexCode.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Code), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingName = this.textexName.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Name), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingTitle    = this.textexTitle.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Title), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingBirthday = this.dateTimexBirthday.DataBindings.Add("Value", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Birthday), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingTelephone = this.textexTelephone.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Telephone), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingAddress   = this.textexAddress.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Address), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingCheckLocation1 = this.CheckLocation1.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckLocation1), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCheckLocation2 = this.CheckLocation2.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckLocation2), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCheckLocation3 = this.CheckLocation3.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckLocation3), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCheckLocation4 = this.CheckLocation4.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckLocation4), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingCheckRole1 = this.CheckRole1.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckRole1), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCheckRole2 = this.CheckRole2.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckRole2), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCheckRole3 = this.CheckRole3.DataBindings.Add("Checked", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeDTO>(p => p.CheckRole3), true, DataSourceUpdateMode.OnPropertyChanged);

            TeamAPIs teamAPIs = new TeamAPIs(CommonNinject.Kernel.Get <ITeamAPIRepository>());

            this.combexTeamID.DataSource    = teamAPIs.GetTeamBases();
            this.combexTeamID.DisplayMember = CommonExpressions.PropertyName <TeamBase>(p => p.Name);
            this.combexTeamID.ValueMember   = CommonExpressions.PropertyName <TeamBase>(p => p.TeamID);
            this.bindingTeamID = this.combexTeamID.DataBindings.Add("SelectedValue", this.employeeViewModel, CommonExpressions.PropertyName <EmployeeViewModel>(p => p.TeamID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingTitle.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingBirthday.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingTelephone.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingAddress.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingCheckLocation1.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCheckLocation2.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCheckLocation3.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCheckLocation4.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingCheckRole1.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCheckRole2.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCheckRole3.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingTeamID.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastEmployeeIndex.AboutToCreateGroups += fastEmployeeIndex_AboutToCreateGroups;

            this.fastEmployeeIndex.ShowGroups = true;
            this.olvInActive.Renderer         = new MappedImageRenderer(new Object[] { 1, Resources.Void_16 });
        }
Example #28
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingName      = this.textexName.DataBindings.Add("Text", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.Name), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks   = this.textexRemarks.DataBindings.Add("Text", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingBookable  = this.checkBookable.DataBindings.Add("Checked", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.Bookable), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingIssuable  = this.checkIssuable.DataBindings.Add("Checked", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.Issuable), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingIsDefault = this.checkIsDefault.DataBindings.Add("Checked", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.IsDefault), true, DataSourceUpdateMode.OnPropertyChanged);

            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            this.combexLocationID.DataSource    = locationAPIs.GetLocationBases(true);
            this.combexLocationID.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
            this.combexLocationID.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
            this.bindingLocationID = this.combexLocationID.DataBindings.Add("SelectedValue", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.LocationID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingName.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingBookable.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingIssuable.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingIsDefault.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingLocationID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastWarehouseIndex.AboutToCreateGroups += fastWarehouseIndex_AboutToCreateGroups;
            this.fastWarehouseIndex.ShowGroups           = true;
        }
Example #29
0
        private void OptionBatches_Load(object sender, EventArgs e)
        {
            try
            {
                this.combexBatchID.DataSource    = this.deliveryAdviceAPIs.GetBatchAvailables(this.deliveryAdviceDetailDTO.LocationID, this.deliveryAdviceDetailDTO.DeliveryAdviceID, this.deliveryAdviceDetailDTO.CommodityID, true);
                this.combexBatchID.DisplayMember = CommonExpressions.PropertyName <BatchAvailable>(p => p.Code);
                this.combexBatchID.ValueMember   = CommonExpressions.PropertyName <BatchAvailable>(p => p.BatchID);
                this.bindingBatchID = this.combexBatchID.DataBindings.Add("SelectedValue", this.deliveryAdviceDetailDTO, CommonExpressions.PropertyName <DeliveryAdviceDetailDTO>(p => p.BatchID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingBatchEntryDate           = this.textexBatchEntryDate.DataBindings.Add("Text", this.deliveryAdviceDetailDTO, CommonExpressions.PropertyName <DeliveryAdviceDetailDTO>(p => p.BatchEntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingQuantityBatchAvailable   = this.textexQuantityBatchAvailable.DataBindings.Add("Text", this.deliveryAdviceDetailDTO, CommonExpressions.PropertyName <DeliveryAdviceDetailDTO>(p => p.QuantityBatchAvailable), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingLineVolumeBatchAvailable = this.textexLineVolumeBatchAvailable.DataBindings.Add("Text", this.deliveryAdviceDetailDTO, CommonExpressions.PropertyName <DeliveryAdviceDetailDTO>(p => p.LineVolumeBatchAvailable), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingBatchID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingBatchEntryDate.BindingComplete           += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingQuantityBatchAvailable.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingLineVolumeBatchAvailable.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Example #30
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingFillingLineName = this.labelFillingLineName.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.Caption));

            this.bindingEntryDate     = this.dateTimexEntryDate.DataBindings.Add("Value", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingReference     = this.textexReference.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.Reference), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingWarehouseCode = this.textexWarehouseCode.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.WarehouseName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingDescription = this.textexDescription.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks     = this.textexRemarks.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingTotalPalletCounts = this.textexTotalPalletCounts.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.TotalPalletCounts), true, DataSourceUpdateMode.OnValidation, 0, GlobalEnums.formatQuantity);
            this.bindingTotalQuantity     = this.textexTotalQuantity.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.TotalQuantity), true, DataSourceUpdateMode.OnValidation, 0, GlobalEnums.formatQuantity);
            this.bindingTotalLineVolume   = this.textexTotalLineVolume.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.TotalLineVolume), true, DataSourceUpdateMode.OnValidation, 0, GlobalEnums.formatVolume);


            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexForkliftDriverID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.pickupViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Production);
            this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexForkliftDriverID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.pickupViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.bindingEntryDate.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReference.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingFillingLineName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingWarehouseCode.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingTotalPalletCounts.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTotalQuantity.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTotalLineVolume.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingForkliftDriverID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingStorekeeperID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastPickupIndex.AboutToCreateGroups     += fastPickupIndex_AboutToCreateGroups;

            this.fastPickupIndex.ShowGroups = true;
            this.olvApproved.Renderer       = new MappedImageRenderer(new Object[] { false, Resources.Placeholder16 });

            this.tableLayoutMaster.ColumnStyles[this.tableLayoutMaster.ColumnCount - 1].SizeType = SizeType.Absolute; this.tableLayoutMaster.ColumnStyles[this.tableLayoutMaster.ColumnCount - 1].Width = 10;
        }