private List <RentedVehicles> ListCompanysRentedVehicles()
 {
     try
     {
         using (var companyBusiness = new CompanyBusiness())
         {
             List <RentedVehicles> allrentedvehicles = new List <RentedVehicles>();
             foreach (var responsedRentedVehicles in companyBusiness.GetByID(companyid).RentedVehicles)
             {
                 RentedVehicles castedRentedVehicles = new RentedVehicles()
                 {
                     RentalPrice       = responsedRentedVehicles.RentalPrice,
                     DriverCustomerId  = responsedRentedVehicles.DriverCustomerId,
                     DropOffDate       = responsedRentedVehicles.DropOffDate,
                     PickUpDate        = responsedRentedVehicles.PickUpDate,
                     VehiclesPickUpKm  = responsedRentedVehicles.VehiclesPickUpKm,
                     VehiclesDropOffKm = responsedRentedVehicles.VehiclesDropOffKm,
                     RentedVehicleId   = responsedRentedVehicles.RentedVehicleId,
                     SupplierCompanyId = responsedRentedVehicles.SupplierCompanyId
                 };
                 allrentedvehicles.Add(castedRentedVehicles);
             }
             return(allrentedvehicles);
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Customer doesn't exists.");
     }
 }
 private List <Vehicles> ListCompanysAllVehicles()
 {
     try
     {
         using (var companysBusiness = new CompanyBusiness())
         {
             List <Vehicles> allvehicles = new List <Vehicles>();
             foreach (var responsedVehicles in companysBusiness.GetByID(companyid).Vehicles)
             {
                 Vehicles castedVehicles = new Vehicles()
                 {
                     RequiredDrivingLicenseAge = responsedVehicles.RequiredDrivingLicenseAge,
                     DailyRentalPrice          = responsedVehicles.DailyRentalPrice,
                     AgeLimitForDrivingThisCar = responsedVehicles.AgeLimitForDrivingThisCar,
                     HasAirbag         = responsedVehicles.HasAirbag,
                     KmLimitPerDay     = responsedVehicles.KmLimitPerDay,
                     SeatingCapacity   = responsedVehicles.SeatingCapacity,
                     TrunkVolume       = responsedVehicles.TrunkVolume,
                     VehicleModel      = responsedVehicles.VehicleModel,
                     VehiclesInstantKm = responsedVehicles.VehiclesInstantKm,
                     VehiclesCompanyId = responsedVehicles.VehiclesCompanyId,
                     VehicleName       = responsedVehicles.VehicleName
                 };
                 allvehicles.Add(castedVehicles);
             }
             return(allvehicles);
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Customer doesn't exists.");
     }
 }
 private List <Employees> ListAllEmployeesOfCompany()
 {
     try
     {
         using (var companyBusiness = new CompanyBusiness())
         {
             List <Employees> employees = new List <Employees>();
             foreach (var responsedEmployees in companyBusiness.GetByID(companyid).Employees)
             {
                 Employees castedEmployee = new Employees()
                 {
                     EmployeesAddress     = responsedEmployees.EmployeesAddress,
                     EmployeesCompanyId   = responsedEmployees.EmployeesCompanyId,
                     EmployeesEmail       = responsedEmployees.EmployeesEmail,
                     EmployeesPhoneNumber = responsedEmployees.EmployeesPhoneNumber,
                     EmployessPassword    = responsedEmployees.EmployessPassword
                 };
                 employees.Add(castedEmployee);
             }
             return(employees);
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Customer doesn't exists.");
     }
 }
Beispiel #4
0
 private List <Companies> ListAllCompanies()
 {
     try
     {
         using (var companyBusiness = new CompanyBusiness())
         {
             List <Companies> companies = new List <Companies>();
             foreach (var responsedcompany in companyBusiness.GetAll())
             {
                 Companies tmpcompany = new Companies()
                 {
                     CompanyAdress = responsedcompany.CompanyAdress,
                     CompanyCity   = responsedcompany.CompanyCity,
                     CompanyId     = responsedcompany.CompanyId,
                     CompanyEmail  = responsedcompany.CompanyEmail,
                     CompanyName   = responsedcompany.CompanyName
                 };
                 companies.Add(tmpcompany);
             }
             return(companies);
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Customer doesn't exists.");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //项目下拉框
         DataTable dt = CompanyBusiness.GetCompanyProjects(CompanyCode.ToString());
         ControlHelper.BindListControl(ddlProject, dt, "PROJECTNAME", "PROJECTID");
         ddlProject.Items.Remove(ddlProject.Items.FindByValue(CommonMethod.GetConfigValue("SYSPROJECTID")));
         if (ProjectId > 0)
         {
             ControlHelper.SelectFlg(ddlProject, ProjectId.ToString());
         }
         if (Request.QueryString["pid"] != null)
         {
             ControlHelper.SelectFlg(ddlProject, Enc.Decrypt(Request.QueryString["pid"], UrlEncKey));
         }
         if (ddlProject.Items.Count > 1 && ProjectId == 0) //不是自动登录并且开通项目大于1个
         {
             ExecStartScript("$('#sProject').show();");
         }
         else
         {
             lblTip.Visible = true;
         }
     }
 }
        public HttpResponseMessage CompanyInfoGet(int id)
        {
            try
            {
                CompanyBusiness companyBusiness = new CompanyBusiness();

                var tempComp = companyBusiness.FindCompany(id);

                Companies tempData = new Companies()
                {
                    Name              = tempComp.Name,
                    Address           = tempComp.Address,
                    City              = tempComp.City,
                    DatetimeOfCreated = tempComp.DatetimeOfCreated,
                    Id          = tempComp.Id,
                    PhoneNumber = tempComp.PhoneNumber,
                    PhotoURL    = tempComp.PhotoURL,
                    Point       = tempComp.Point
                };


                return(Request.CreateResponse(HttpStatusCode.OK, tempData));
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File,
                              "CompanyInfoGet failed: " + id + "\n" + ExceptionHelper.ExceptionToString(ex));
                return(null);
            }
        }
        public HttpResponseMessage CompanyRentInfoGet(int id)
        {
            try
            {
                CompanyBusiness companyBusiness = new CompanyBusiness();

                var tempRents = companyBusiness.ListRentInfos(id).Select(i => new
                {
                    i.CompanyId,
                    i.VehicleId,
                    i.StaffThatConfirmsOrRejects,
                    i.EndingOfRenting,
                    i.DatetimeOfRequest,
                    i.BeginningOfRenting,
                    i.CustomerId,
                    i.Id,
                    i.IsRequestPending,
                    i.IsRented,
                    i.Price
                }).ToList();

                return(Request.CreateResponse(HttpStatusCode.OK, tempRents));
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File,
                              "CompanyRentInfoGet failed. id:  " + id + "\n" + ExceptionHelper.ExceptionToString(ex));
                return(null);
            }
        }
        public HttpResponseMessage CompanyVehicleGet(int id)
        {
            try
            {
                CompanyBusiness companyBusiness = new CompanyBusiness();

                var tempComps = companyBusiness.FindCompany(id).Vehicles.Select(
                    i => new
                {
                    i.AmoutOfSeat,
                    i.Brand,
                    i.CompanyId,
                    i.CurrentKm,
                    i.DailyPrice,
                    i.HaveAirBag,
                    i.MinimumAgeLimit,
                    i.ModelName,
                    PhotoURL = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxISERUSEhMWFRUVFxUVGBUXGRcWGBcXFRUWFxUVFhcaHSggGBolHRUWITEhJSkrMC4vFx82ODMtNygtLisBCgoKDg0OGhAQGy0lHyUtLS0tLS0xLi0tLS0tLS0tLS0tLS0rLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAJwBQwMBEQACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAAAgMEBQYBBwj/xABLEAABAwIDAwgGBAwFAwUBAAABAAIDBBEFITEGEkETQlFSYXGBkQciMqGxwRQjktEVFjNDU2JygrLT4fAXVIOiwpPD0kRjc6PjNP/EABoBAQADAQEBAAAAAAAAAAAAAAABAgMEBQb/xAA6EQACAQIBCQYGAQQABwAAAAAAAQIDEQQFEhQhMUFRkaETMkJSgdEiYXGx4fAVM0NTwSNiY4KS4vH/2gAMAwEAAhEDEQA/APcUAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAICE/EmNlMTzundDgToQSRroDcHJZ9rFTzHt2mnZScM9bNg8ayPrt8wVoZnPpjP1j3MefgEBz6a3oef9N/zagEOxADmP/2j4uCAZdi7RzHfahHxkTUTZifw2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OdDbkzGblt3MLb9187lAZnbva99fI1jbiCK+406kk5vd2nS3DPpQETZrar6G1wj1eQXO6bXsO4XPmoBpab0lScSgLqk9I5OpQGt2e2xEpAvqgN7BJvAFAOoAQEHEYN5tkB5btXsxI9xIBQGDr9jJuqUBSVGx845pQEGTZiccwoCHNgszdWHyQEYPczJwPigJMdeBx8CA74qQLdiI6QO5oHwCAYdVFx9UEnzUAUMLmdnulAKGCy9UoDowObqlAOM2fmPNKAkN2VnPNKA6dlZ+oUAk7Lz9QoBJ2Zn6hQCTs5P1CgEnZ6bqlAJOAzdUoBJwObqlAcOCy9UoBJweXqlAc/BMvVKAT+CpeqUBz8GSdUoBJw+TqlAIdSPHNKASxzmcPBASqfECw3a4tKAuodtqto3RUSAdj3/AHqbgrq7GpJTeSRzuOZJ8hwUArpKguyCAXDRvdoCgLCnwmTqlAW9FgkpPslAehbH7PytcCQUB7JhrCGAFAS0AIDhCAakpmnUICO/DIzzQgGnYJEeaEAy7Z2E80IBp+y1OdWN8kBGk2IpHawsPgEBEk9G+HnWnZ5IBoejHDgb/R2eSAkx7AUbfZiYO4BAPfiZT9QeSA6NjYOqEB0bHwdUIB5mysA5oQEluz8I5oQAdn4eqEBw7PQ9QIBJ2ch6gQCTszB1AgEHZaDqhAJOycHVHkgEHZCDqhAIOx0HUCAQdi4OqEAk7EwdUIBJ2Hg6oQCDsLB1QgEHYKDqhANP9HtOeYEBHl9GFI7WMICJJ6IqF35seGSAZPoboeofMoDjfQzQjmn7RQEuD0UUbNIwgJ8Po9p26NCAmR7FQjmhATabZiFvNCAs4cPY3QBAS2tsgFIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEB/9k=",
                    i.Plate,
                    i.RequiredOldForLicense,
                    i.DatetimeOfCreated,
                    i.Id,
                    i.VolumeOfLuggage
                }).ToList();

                return(Request.CreateResponse(HttpStatusCode.OK, tempComps));
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File,
                              "CompanyVehicleGet failed: " + id + "\n" + ExceptionHelper.ExceptionToString(ex));
                return(null);
            }
        }
        public HttpResponseMessage CompanyListGet()
        {
            try
            {
                CompanyBusiness companyBusiness = new CompanyBusiness();

                var tempComps = companyBusiness.ListCompanies().Select(
                    i => new
                {
                    i.Id,
                    i.Name,
                    i.City,
                    i.PhoneNumber,
                    PhotoURL = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQR_ycvcflPi26BeryzzAsP2IB9Or9G7Y9bDA&usqp=CAU",
                    i.Point,
                    VehicleAmount = i.Vehicles.Count,
                    i.Address
                }).ToList();

                return(Request.CreateResponse(HttpStatusCode.OK, tempComps));
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File,
                              "CompanyListGet failed. " + "\n" + ExceptionHelper.ExceptionToString(ex));
                return(null);
            }
        }
Beispiel #10
0
 private List <Vehicles> GetAllAvaliableVehiclesOfCompany(DateTime date, int companyid)
 {
     try
     {
         using (var companybusiness = new CompanyBusiness())
         {
             using (var vehiclebusiness = new VehicleBusiness())
             {
                 List <Vehicles> vehicles                   = companybusiness.GetByID(companyid).Vehicles.ToList();
                 List <Vehicles> AllAvaliableVehicles       = GetAllAvaliableVehicles(date);
                 List <Vehicles> AvaliableVehiclesOfCompany = new List <Vehicles>();
                 foreach (var availablevehicle in AllAvaliableVehicles)
                 {
                     foreach (var vehicleofcompany in vehicles)
                     {
                         if (vehicleofcompany.VehiclesCompanyId == availablevehicle.VehiclesCompanyId)
                         {
                             AllAvaliableVehicles.Add(vehicleofcompany);
                         }
                     }
                 }
                 return(AllAvaliableVehicles);
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Request doesn't exists.");
     }
 }
        protected void lnkStopUse_Click(object sender, EventArgs e)
        {
            if (hidCId.Value.Trim().Length > 0 && hidStatus.Value.Trim().Length > 0)
            {
                #region 日志记录

                USER_SHARE_LOGMODEL log = new USER_SHARE_LOGMODEL();
                log.LOGID           = CommonBusiness.GetSeqID("S_USER_SHARE_LOG");
                log.OPERATECONTENT  = "更改公司关联表状态为:" + EnumPlus.GetEnumDescription(typeof(ShareEnum.CompanyRelateStatus), hidStatus.Value);
                log.OPERATECONTENT += ",公司关联表CId:" + hidCId.Value;
                log.OPERATEDATE     = DateTime.Now;
                log.OPERATETYPE     = int.Parse(ShareEnum.LogType.ChangeCompanyRelateStatus.ToString("d"));
                log.OPERATORID      = AccountId;
                log.PROJECTID       = ProjectId;

                #endregion

                #region 保存
                if (CompanyBusiness.UpdateCompanyRelateStatus(hidCId.Value, hidStatus.Value, log))
                {
                    Alert("操作成功!");
                    BindData(0);
                }
                else
                {
                    Alert("操作失败,请重试!");
                }
                #endregion
            }
        }
        public HttpResponseMessage CompanyStaffGet(int id)
        {
            try
            {
                CompanyBusiness companyBusiness = new CompanyBusiness();

                var tempComps = companyBusiness.FindCompany(id).Staffs.Select(
                    i => new
                {
                    i.DatetimeOfCreated,
                    i.Address,
                    i.BeginningDateOfDriverLicense,
                    i.CityOfBirth,
                    i.EndingDateOfDriverLicense,
                    i.Id,
                    i.IdentificationNumber,
                    i.Name,
                    PhotoURL = "",
                    i.Surname
                }).ToList();

                return(Request.CreateResponse(HttpStatusCode.OK, tempComps));
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File,
                              "CompanyStaffGet failed. " + id + ExceptionHelper.ExceptionToString(ex));
                return(null);
            }
        }
Beispiel #13
0
 private List <RentalRequests> ListAllRentalRequestOfEmployeesCompany(int companyid)
 {
     try
     {
         using (var companyBusiness = new CompanyBusiness())
         {
             List <RentalRequests> rentalRequests = new List <RentalRequests>();
             foreach (var responsedRequests in companyBusiness.GetByID(companyid).RentalRequests)
             {
                 RentalRequests castedRequests = new RentalRequests()
                 {
                     RentalRequestId            = responsedRequests.RentalRequestId,
                     RentalRequestCustomerId    = responsedRequests.RentalRequestCustomerId,
                     RequestedSupplierCompanyId = responsedRequests.RequestedSupplierCompanyId,
                     RequestedVehicleId         = responsedRequests.RequestedVehicleId,
                     RequestedPickUpDate        = responsedRequests.RequestedPickUpDate,
                     RequestedDropOffDate       = responsedRequests.RequestedDropOffDate
                 };
                 rentalRequests.Add(castedRequests);
             }
             return(rentalRequests);
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("There isn't any request to show.");
     }
 }
 private bool CompanySignUp(Companies companies)
 {
     try
     {
         using (var companyBusiness = new CompanyBusiness())
         {
             return(companyBusiness.Insert(companies));
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("CompanyController::InsertCoompany::Error occured.", ex);
     }
 }
 public Company[] GetAll()
 {
     try
     {
         using (var c = new CompanyBusiness())
         {
             return(c.GetAll().ToArray());
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(null);
     }
 }
 public string Post(Companies entity)
 {
     try
     {
         CompanyBusiness companyBusiness = new CompanyBusiness();
         bool            result          = companyBusiness.InsertCompany(entity);
         return(result == true ? "Added succesfuly!" : "Adding Failed!");
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File,
                       "Manager Post failed. " + entity.Name + "\n" + ExceptionHelper.ExceptionToString(ex));
         return("Adding failed! Exception : " + ex.Message);
     }
 }
 private bool LoginCompany(string username, string password)
 {
     try
     {
         using (var companyBusiness = new CompanyBusiness())
         {
             return(companyBusiness.LogIn(username, password));
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("CompanyController::LogInCompany::Error occured.", ex);
     }
 }
 public string CompanyUpdate(Companies entity)
 {
     try
     {
         int             compId          = Convert.ToInt32(entity.Id);
         CompanyBusiness companyBusiness = new CompanyBusiness();
         bool            result          = companyBusiness.UpdateCompany(entity);
         return(result == true ? "Updated succesfuly!" : "Updating Failed!");
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File,
                       "Company Update failed. " + entity.Id + "\n" + ExceptionHelper.ExceptionToString(ex));
         return("Updating failed! Exception : " + ex.Message);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //项目下拉框
                DataTable dt = CompanyBusiness.GetCompanyProjects(CompanyCode.ToString());
                ControlHelper.BindListControl(ddlProject, dt, "PROJECTNAME", "PROJECTID");
                if (ProjectId > 0)
                {
                    ControlHelper.SelectFlg(ddlProject, ProjectId.ToString());
                }

                lblProject.Visible = ddlProject.Visible = (dt != null && dt.Rows.Count > 0 && ProjectId == 0);
                BindData(0);
            }
        }
 public string CompanyVehicleAdd(Vehicles entity)
 {
     try
     {
         int             compId          = Convert.ToInt32(entity.CompanyId);
         CompanyBusiness companyBusiness = new CompanyBusiness();
         entity.DatetimeOfCreated = DateTime.Now;
         bool result = companyBusiness.AddCar(compId, entity);
         return(result == true ? "Added succesfuly!" : "Adding Failed!");
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File,
                       "CompanyVehicleAdd failed. " + entity.Id + "\n" + ExceptionHelper.ExceptionToString(ex));
         return("Adding Failed! Exception:" + ex.Message);
     }
 }
 public string CompanyRentInfoAdd(RentInfos entity)
 {
     try
     {
         int             compId          = Convert.ToInt32(entity.CompanyId);
         CompanyBusiness companyBusiness = new CompanyBusiness();
         entity.DatetimeOfRequest = DateTime.Now;
         bool result = companyBusiness.AddRentnfo(compId, entity);
         return(result == true ? "Rent request created succesfuly!" : " Failed!");
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File,
                       "CompanyRentInfoAdd failed. " + entity.Customers.Name + "\n" + ExceptionHelper.ExceptionToString(ex));
         return("Rent Request failed! Exception : " + ex.Message);
     }
 }
Beispiel #22
0
 public IHttpActionResult Get(int id)
 {
     try
     {
         using (var c = new CompanyBusiness())
         {
             var temp = c.GetAll().Where(s => s.Id == id).FirstOrDefault();
             if (temp == null)
             {
                 return(NotFound());
             }
             return(Ok(temp));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest($"{ex}"));
     }
 }
Beispiel #23
0
 public IHttpActionResult Get()
 {
     try
     {
         using (var c = new CompanyBusiness())
         {
             var templist = c.GetAll().ToList();
             if (templist == null)
             {
                 return(NotFound());
             }
             return(Ok(templist));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest($"{ex}"));
     }
 }
 private void LoadOriInfo(string strCid)
 {
     if (strCid.Length > 0)
     {
         USER_SHARE_COMPANYRELATEMODEL uscrModel = CompanyBusiness.GetModelByCid(ValidatorHelper.ToInt(strCid, 0));
         if (uscrModel != null)
         {
             txtCompanyName.Text = uscrModel.COMPANYNAME;
             ControlHelper.SelectFlg(ddlCompanyType, uscrModel.COMPANYTYPE.ToString());
             hidCompanyId.Value = uscrModel.COMPANYID > 0 ? uscrModel.COMPANYID.ToString() : uscrModel.SHARECOMPANYID.ToString();
             hidGroupId.Value   = CommonMethod.FinalString(uscrModel.GROUPID);
             hidGroupIdn.Value  = CommonMethod.FinalString(uscrModel.GROUPIDN);
             hidProjects.Value  = CommonMethod.FinalString(uscrModel.PROJECTIDS);
             hidProducts.Value  = CommonMethod.FinalString(uscrModel.PRODUCTIDS);
         }
         else
         {
             Response.Write("不存在此公司信息!");
             Response.End();
         }
     }
 }
        private void BindData(int nPageIndex)
        {
            string strWhere = string.Empty;
            int    nCount   = 0;

            if (txtCompanyName.Text.Trim().Length > 0)
            {
                strWhere += string.Format(" AND COMPANYNAME LIKE '%{0}%' ", ValidatorHelper.SafeSql(txtCompanyName.Text));
            }
            if (ddlCompanyType.SelectedValue.Trim().Length > 0)
            {
                strWhere += string.Format(" AND COMPANYTYPE={0} ", ddlCompanyType.SelectedValue);
            }

            DataTable dt = CompanyBusiness.GetCompanyRelateList(nPageIndex, GlobalConsts.PageSize_Default, strWhere, out nCount);

            rptCompanyRelateInfo.DataSource = dt;
            rptCompanyRelateInfo.DataBind();
            PageBar1.PageIndex   = nPageIndex;
            PageBar1.PageSize    = GlobalConsts.PageSize_Default;
            PageBar1.RecordCount = nCount;
            PageBar1.Draw();
        }
Beispiel #26
0
        public PensionFundContract CreateCompleteEntry(Fund fund, Company company, Employee employee)
        {
            Validate(fund, company, employee);
            var assetDictionary     = GetAssetAllocationDictionary(fund);
            var pensionFund         = PensionFundBusiness.Create(fund.Name);
            var pensionFundWallet   = WalletBusiness.Create();
            var pensionFundOption   = PensionFundOptionBusiness.Create(pensionFundWallet.Address, fund.Fee, fund.LatePaymentFee, pensionFund.Id);
            var companyWallet       = WalletBusiness.Create();
            var domainCompany       = CompanyBusiness.Create(companyWallet.Address, company.Name, company.BonusFee, company.MaxBonusFee, pensionFundOption.Address, company.VestingRules);
            var employeeWallet      = WalletBusiness.Create();
            var domainEmployee      = EmployeeBusiness.Create(employeeWallet.Address, employee.Name, employee.Salary, employee.ContributionPercentage, domainCompany.Address);
            var pensionFundContract = PensionFundContractBusiness.Create(pensionFundOption.Address, domainCompany.Address, domainEmployee.Address,
                                                                         pensionFundOption.Fee, pensionFundOption.LatePenalty, domainCompany.MaxSalaryBonusRate, domainEmployee.Contribution,
                                                                         domainCompany.BonusRate, domainEmployee.Salary,
                                                                         assetDictionary,
                                                                         company.VestingRules.ToDictionary(bonus => bonus.Period, bonus => bonus.Percentage));

            foreach (var asset in assetDictionary)
            {
                PensionFundReferenceContractBusiness.Create(pensionFundContract.TransactionHash, asset.Key, asset.Value);
            }

            return(pensionFundContract);
        }
 private int GetIDByUsername(string username)
 {
     try
     {
         using (var companyBusiness = new CompanyBusiness())
         {
             int responseID = -1;
             foreach (var item in companyBusiness.GetAll())
             {
                 if (item.CompanyEmail == username)
                 {
                     responseID = item.CompanyId;
                     break;
                 }
             }
             return(responseID);
         }
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("Customer doesn't exists.");
     }
 }
Beispiel #28
0
 public CompanyUC()
 {
     InitializeComponent();
     objCompanyBusiness  = new CompanyBusiness();
     objCategoryBusiness = new CategoryBusiness();
 }
Beispiel #29
0
 public CompanyController(CompanyBusiness business)
 {
     _business = business;
 }
        private void InitPage()
        {
            //账号状态
            ControlHelper.ListContolDataBindFromEnum(rbtAccountStatus, typeof(ShareEnum.AccountStatus), "", "", ShareEnum.AccountStatus.Normal.ToString("d"));
            rbtAccountStatus.Items.Remove(rbtAccountStatus.Items.FindByValue(ShareEnum.AccountStatus.Del.ToString("d")));

            //账号Id
            hidAccountId.Value = PageAccountId.ToString();

            string strRoleIds = string.Empty;

            hidCompanyCode.Value = CompanyCode.ToString();

            if (PageAccountId > 0)//修改页面
            {
                USER_SHARE_ACCOUNTMODEL accountModel = AccountBusiness.GetAccountModel(PageAccountId);
                if (accountModel != null)
                {
                    txtAccountName.Text         = accountModel.ACCOUNTNAME;
                    txtRealName.Text            = accountModel.REALNAME;
                    txtPwd.Attributes["value"]  = accountModel.ORIGNALPWD;
                    txtPwd2.Attributes["value"] = accountModel.ORIGNALPWD;
                    txtLinkPhone.Text           = CommonMethod.FinalString(accountModel.LINKPHONE);
                    hidEmail.Value       = CommonMethod.FinalString(accountModel.EMAIL);
                    hidCompanyCode.Value = accountModel.COMPANYID.ToString();
                    ControlHelper.SelectFlg(rbtAccountStatus, accountModel.STATUS.ToString());
                    strRoleIds = CommonMethod.FinalString(accountModel.ROLEIDS);
                }

                else
                {
                    Response.Write("不存在的账号信息!");
                    Response.End();
                }
            }


            #region 角色

            if (!IsInit)
            {
                DataTable dtProjects = CompanyBusiness.GetCompanyProjects(CompanyCode.ToString());
                DataTable dtRoles    = RoleBusiness.GetAccountRoleList(" AND R.COMPANYID=" + CompanyId);
                if (dtProjects != null && dtProjects.Rows.Count > 0 && dtRoles != null)
                {
                    StringBuilder sbContent = new StringBuilder("");
                    foreach (DataRow dr in dtProjects.Rows)
                    {
                        sbContent.Append("<table class=\"table\" style=\"float:left; width:33%; margin-left:3px;\">");
                        sbContent.AppendFormat("<tr><td class='rhead' style=\"text-align:left;background-image: url('../../Resource/images/searchthead.gif');\" >{0}</td></tr>", dr["ProjectName"]);

                        DataRow[] drRoles = dtRoles.Select("PROJECTID=" + dr["PROJECTID"], " ROLEID ASC ");
                        foreach (DataRow drRole in drRoles)
                        {
                            sbContent.AppendFormat("<tr><td><input type='checkbox'   name='role' id='{0}' value='{0}' {2} />{1}</td></tr>",
                                                   drRole["ROLEID"], drRole["ROLENAME"], strRoleIds.IndexOf("," + drRole["ROLEID"] + ",") >= 0 ? "checked='checked'" : "");
                        }

                        sbContent.Append("</table>");
                    }

                    tdRoles.InnerHtml = sbContent.ToString();
                }
            }
            else
            {
                trRoles.Visible      = false;
                hidCompanyCode.Value = Enc.Decrypt(CommonMethod.FinalString(Request.QueryString["code"]), UrlEncKey);
            }

            #endregion
        }