Esempio n. 1
0
        private void Disconnect()
        {
            DialogResult dialogTruckDriver;
            string       MSG = "";

            MSG = Conversions.ToString(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject("Do you really want to disconnect the company ", dgvTruckDriverCompany.SelectedRows[0].Cells[2].Value), " to this driver truck "), lblNameDriver.Text), " ?"));
            dialogTruckDriver = My.MyProject.Forms.MessageBoxCeresYesNo.ShowDialog("Disconnect Driver Truck", MSG, My.Resources.Resources.caution, this);
            if (dialogTruckDriver == DialogResult.Yes)
            {
                string MSGLog = "";
                int    Id     = Conversions.ToInteger(dgvTruckDriverCompany.SelectedRows[0].Cells[0].Value);
                var    L      = TruckDriverCompanyService.GetById(Id);
                foreach (var item in L)
                {
                    MSGLog = "Items that have been deleted: CompanyId: #" + item.CompanyId.ToString() + " TruckDriverId: " + item.TruckDriverId.ToString();
                }
                if (TruckDriverCompanyService.Delete(Id))
                {
                    EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, Id.ToString(), "DELETE", "TRUCK DRIVER", MSGLog);
                    LoadDataGridView();
                    My.MyProject.Forms.FrmParentScreen.f.LoadForm();
                }
                else
                {
                    My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Error in disconnect the company our this truck driver", "", this);
                }
            }
        }
Esempio n. 2
0
        /* TODO ERROR: Skipped EndRegionDirectiveTrivia */
        /* TODO ERROR: Skipped RegionDirectiveTrivia */

        public string ReturnMessage(int TruckCompanyId, int TruckDriverCompanyId)
        {
            bool            chPortPass     = false;
            bool            chTruckNum     = false;
            bool            chTruckCom     = false;
            string          NameCompanyNew = ddlTruckCompany.Text;
            TruckDriverList td             = (TruckDriverList)dgvTruckDriverCompany.CurrentRow.DataBoundItem;
            string          MSG            = "Items that have been changed: ";
            var             L = TruckDriverCompanyService.GetById(TruckCompanyId);

            foreach (var item in L)
            {
                if (TruckCompanyId != item.CompanyId == true)
                {
                    MSG += "Company: " + td.CompanyName + " by Company: " + NameCompanyNew + " ? ";
                }
            }

            return(MSG.Remove(MSG.Length - 2, 2));
        }
Esempio n. 3
0
        public bool VerifyPortPassId(string PortPass, int TruckCompanyId)
        {
            bool   isPort      = false;
            string PortPassOld = "";
            var    L           = TruckDriverCompanyService.GetById(TruckCompanyId);

            foreach (var item in L)
            {
                var Li = TruckDriverService.GetByTruckId((int)item.TruckDriverId);
                foreach (var itemd in Li)
                {
                    PortPassOld = itemd.PortPassId;
                }
            }

            if ((PortPass ?? "") == (PortPassOld ?? ""))
            {
                isPort = true;
                return(isPort);
            }

            return(isPort);
        }