Inheritance: System.Web.UI.Page
Example #1
0
        public DataTable RetrieveCustomersGrid(string strCompanyCode)
        {
            try
            {
                DataAccess dataAccess = new DataAccess(Global.AllVisions_Sys);
                DataTable  dt         = new DataTable();

                objCompanyInformation = RetrieveCompanyInformationByCode(strCompanyCode);
                string sqlstring = "";
                if (objCompanyInformation.CompanyCode == objCompanyInformation.ParentCompanyCode)
                {
                    sqlstring = "Select CompanyCode FROM CompanyInformation WITH (NOLOCK) where ParentCompanyCode = '" + strCompanyCode + "'";
                }
                else
                {
                    sqlstring = "Select CompanyCode FROM CompanyInformation WITH (NOLOCK) where CompanyCode = '" + strCompanyCode + "'";
                }

                //string sqlstring = "exec spCustomersList";
                dt = dataAccess.RetrieveDataTable(sqlstring);

                return(dt);
            }

            catch (Exception ex)
            {
                strError = ex.Message;
                return(new DataTable());
            }
        }
Example #2
0
        protected void btnSearch_OnClick(object sender, EventArgs e)
        {
            objReportBiz = new ReportBiz();
            ReportDocument     rd       = new ReportDocument();
            CompanyInformation objClass = new CompanyInformation();

            DataTable dt = new DataTable();

            dt = objReportBiz.InvoicewisePurchaseDetails(txtInvoiceNumber.Text.Trim());
            rd.Load(Server.MapPath("InvoicewisePurchaseDetail.rpt"));

            //Property for Header And Footer - Start

            TextObject txtCompanyName = rd.ReportDefinition.ReportObjects["txtCompanyName"] as TextObject;

            txtCompanyName.Text = objClass.txtCompanyName;

            TextObject txtTradeLicense = rd.ReportDefinition.ReportObjects["txtTradeLicence"] as TextObject;

            txtTradeLicense.Text = objClass.txtTradeLicense;

            TextObject txtCompanyAddress = rd.ReportDefinition.ReportObjects["txtCompanyAddress"] as TextObject;

            txtCompanyAddress.Text = objClass.txtCompanyAddress;

            //Property for Header And Footer - End

            rd.SetDataSource(dt);

            Session["CrystalReport"] = rd;
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "OpenWindow",
                                                "window.open('../ReportViewer.aspx');", true);
        }
Example #3
0
        public static EmailTemplateModel BuildForInvitation(UserInformation user, CompanyInformation company, string link, string reciver)
        {
            var emailTemplate = new EmailTemplateModel();

            try
            {
                var body = string.Format(
                    "<table><tbody>" +
                    "<tr><td>Title</td><td>{0}</td></tr>" +
                    "<tr><td>Description</td><td>{1}</td></tr>" +
                    "<tr><td>Registration Link</td><td>{2}</td></tr>" +
                    "</tbody></table>", user.Name + "  " + user.SurName + " invites you for working in " + company.Name, "If you have some questions please write your employer :" + user.Email,
                    "To accept invitation pls follow this link an register : " + link);
                emailTemplate.Reciver = reciver;
                emailTemplate.Body    = body;
                emailTemplate.Subject = "Invitation for WorkFlow time tracking system";
            }
            catch (Exception ex)
            {
                var a = ex.Message;
                throw;
            }

            return(emailTemplate);
        }
 /// <summary>
 /// Mapping User Activity Log DTO to Action
 /// </summary>
 /// <param name=></param>
 /// <param name=></param>
 /// <returns></returns>
 public CompanyInformation MappingCompanyInformationupdateDTOToCompanyInformation(CompanyInformation companyInformation, CompanyInformationUpdateDTO CompanyInformationUpdateDTO)
 {
     #region Declare Return Var with Intial Value
     CompanyInformation CompanyInformation = companyInformation;
     #endregion
     try
     {
         if (CompanyInformationUpdateDTO.CompanyInformationId > default(int))
         {
             CompanyInformation.CompanyInformationId = CompanyInformationUpdateDTO.CompanyInformationId;
             CompanyInformation.CompanyName          = CompanyInformationUpdateDTO.CompanyName;
             CompanyInformation.CompanyPhone         = CompanyInformationUpdateDTO.CompanyPhone;
             CompanyInformation.CompanyProfile       = CompanyInformationUpdateDTO.CompanyProfile;
             CompanyInformation.CompanySizeId        = CompanyInformationUpdateDTO.CompanySizeId;
             CompanyInformation.CompanyTypeId        = (byte)CompanyInformationUpdateDTO.CompanyTypeId;
             CompanyInformation.CompanyWebsite       = CompanyInformationUpdateDTO.CompanyWebsite;
             CompanyInformation.EmployerId           = CompanyInformationUpdateDTO.EmployerId;
             CompanyInformation.Fax              = CompanyInformationUpdateDTO.Fax;
             CompanyInformation.IsMultinational  = (bool)CompanyInformationUpdateDTO.IsMultinational;
             CompanyInformation.IsStartupCompany = (bool)CompanyInformationUpdateDTO.IsStartupCompany;
             CompanyInformation.Specialties      = CompanyInformationUpdateDTO.Specialties;
             CompanyInformation.YearFounded      = (int)CompanyInformationUpdateDTO.YearFounded;
             CompanyInformation.Logo             = CompanyInformationUpdateDTO.Logo;
         }
     }
     catch (Exception exception) { }
     return(CompanyInformation);
 }
Example #5
0
        public Applicant GenerateApplicant(CompanyInformation info, String type)
        {
            Applicant applicant = new Applicant();

            applicant.GenerateRandom(type, 0, info);
            return(applicant);
        }
Example #6
0
        protected override void MapAddress(CompanyInformation companyInformation, string address)
        {
            var addressParts = address.Split(new[] { "\n" }, StringSplitOptions.None);

            companyInformation.Address = addressParts.Length > 0 ? addressParts[0] : null;
            companyInformation.City    = addressParts.Length > 1 ? addressParts[1] : null;
        }
        public IHttpActionResult PutCompanyInformation(int id, CompanyInformation companyInformation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != companyInformation.CompanyId)
            {
                return(BadRequest());
            }

            db.Entry(companyInformation).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CompanyInformationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #8
0
        public static CompanyInformationModel ToModel(this CompanyInformation entity, int languageId)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("company");
            }
            var model = new CompanyInformationModel()
            {
                CompanyName        = entity.CompanyName,
                CompanyDescription = entity.CompanyDescription,
                AccountNumbers     = entity.AccountNumbers,
                BankAddress        = entity.BankAddress,
                BankName           = entity.BankName,
                LegalAddress       = entity.LegalAddress,
                SWIFT = entity.SWIFT,
                TaxRegistrationNumber = entity.TaxRegistrationNumber,
                TopExecutiveName      = entity.TopExecutiveName,
                SeName = entity.GetSeName(languageId, returnDefaultValue: true),
            };
            var customer = entity.Customers.FirstOrDefault();

            model.CustomerId = customer.Id;
            if (customer.IsSeller())
            {
                model.Seller = true;
            }

            return(model);
        }
Example #9
0
        public override void UpdateDatabaseAfterUpdateSchema()
        {
            base.UpdateDatabaseAfterUpdateSchema();

            CompanyInformation.GetInstance(ObjectSpace);
            LoadDefaultUsersAndRolesData();
        }
        public Applicant GenerateApplicant(CompanyInformation info, JobLibrary.JobType type)
        {
            Applicant applicant = new Applicant();

            applicant.GenerateRandom(JobLibrary.Classes[type], 0, info);
            return(applicant);
        }
Example #11
0
        /// <summary>
        /// Delete User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> DeleteCompanyInformation(int CompanyInformationId)
        {
            #region Declare a return type with initial value.
            bool isCompanyInformationDeleted = default(bool);
            #endregion
            try
            {
                if (CompanyInformationId > default(int))
                {
                    #region Vars
                    CompanyInformation CompanyInformation = null;
                    #endregion
                    #region Get CompanyInformation by id
                    CompanyInformation = await UnitOfWork.CompanyInformationRepository.GetById(CompanyInformationId);

                    #endregion
                    #region check if object is not null
                    if (CompanyInformation != null)
                    {
                        CompanyInformation.IsDeleted = (byte)DeleteStatusEnum.Deleted;
                        #region Apply the changes to the database
                        UnitOfWork.CompanyInformationRepository.Update(CompanyInformation);
                        isCompanyInformationDeleted = await UnitOfWork.Commit() > default(int);

                        #endregion
                    }
                    #endregion
                }
            }
            catch (Exception exception)
            {
            }
            return(isCompanyInformationDeleted);
        }
 public void AddCompanyInformation(CompanyInformation companyInformation)
 {
     using (MySqlConnection connection = new MySqlConnection(this.connectionString))
     {
         connection.Execute("INSERT INTO Company_information (Name, Phone, Email, Adress, Zipcode, City, Province, Country) VALUES(@Name, @Phone, @Email, @Adress, @Zipcode, @City, @Province, @Country)", companyInformation);
     }
 }
 /// <summary>
 /// Mapping user Action Actitvity Log
 /// </summary>
 /// <param name=></ param >
 /// <returns>Task<CompanyInformation></returns>
 public CompanyInformation MappingCompanyInformationAddDTOToCompanyInformation(CompanyInformationAddDTO CompanyInformationAddDTO)
 {
     #region Declare a return type with initial value.
     CompanyInformation CompanyInformation = null;
     #endregion
     try
     {
         CompanyInformation = new CompanyInformation
         {
             CompanyName      = CompanyInformationAddDTO.CompanyName,
             CompanyPhone     = CompanyInformationAddDTO.CompanyPhone,
             CompanyProfile   = CompanyInformationAddDTO.CompanyProfile,
             CompanySizeId    = CompanyInformationAddDTO.CompanySizeId,
             CompanyTypeId    = (byte)CompanyInformationAddDTO.CompanyTypeId,
             CompanyWebsite   = CompanyInformationAddDTO.CompanyWebsite,
             EmployerId       = CompanyInformationAddDTO.EmployerId,
             Fax              = CompanyInformationAddDTO.Fax,
             IsMultinational  = (bool)CompanyInformationAddDTO.IsMultinational,
             IsStartupCompany = (bool)CompanyInformationAddDTO.IsStartupCompany,
             Specialties      = CompanyInformationAddDTO.Specialties,
             YearFounded      = (int)CompanyInformationAddDTO.YearFounded,
             Logo             = CompanyInformationAddDTO.Logo,
             CreationDate     = DateTime.Now,
             IsDeleted        = (byte)DeleteStatusEnum.NotDeleted
         };
     }
     catch (Exception exception) { }
     return(CompanyInformation);
 }
Example #14
0
        public ActionResult DeleteConfirmed(int id)
        {
            CompanyInformation companyInformation = db.CompanyInformation.Find(id);

            db.CompanyInformation.Remove(companyInformation);
            db.SaveChanges();
            return(RedirectToAction("Details"));
        }
        /// <summary>
        /// Saves the fields bound to the UI related elements as text files
        /// </summary>
        /// <param name="fileHandler">File Handler object used to call the method that writes to text files</param>
        public void SaveFieldsAsTextFiles(IFileHandler fileHandler)
        {
            string pathToSaveFiles = fileHandler.GetFolderPathToHandleFiles();

            if (pathToSaveFiles != "")
            {
                if (CompanyInformation != string.Empty)
                {
                    fileHandler.WriteToFile(CompanyInformation.Split('\r', '\n'), $"{nameof(CompanyInformation)}Text", pathToSaveFiles);
                }

                if (BuyerInformation != string.Empty)
                {
                    fileHandler.WriteToFile(BuyerInformation.Split('\r', '\n'), $"{nameof(BuyerInformation)}Text", pathToSaveFiles);
                }

                if (ExporterStatementTitle != string.Empty)
                {
                    fileHandler.WriteToFile(new string[] { ExporterStatementTitle }, $"{nameof(ExporterStatementTitle)}Text", pathToSaveFiles);
                }

                if (AffidavitTitle != string.Empty)
                {
                    fileHandler.WriteToFile(new string[] { AffidavitTitle }, $"{nameof(AffidavitTitle)}Text", pathToSaveFiles);
                }

                if (ExporterStatementPart1 != string.Empty)
                {
                    fileHandler.WriteToFile(ExporterStatementPart1.Split('\r', '\n'), $"{nameof(ExporterStatementPart1)}Text", pathToSaveFiles);
                }

                if (ExporterStatementPart2 != string.Empty)
                {
                    fileHandler.WriteToFile(ExporterStatementPart2.Split('\r', '\n'), $"{nameof(ExporterStatementPart2)}Text", pathToSaveFiles);
                }

                if (ExporterStatementPart3 != string.Empty)
                {
                    fileHandler.WriteToFile(ExporterStatementPart3.Split('\r', '\n'), $"{nameof(ExporterStatementPart3)}Text", pathToSaveFiles);
                }

                if (AffidavitContent != string.Empty)
                {
                    fileHandler.WriteToFile(AffidavitContent.Split('\r', '\n'), $"{nameof(AffidavitContent)}Text", pathToSaveFiles);
                }

                if (SalesAgentName != string.Empty)
                {
                    fileHandler.WriteToFile(new string[] { SalesAgentName }, $"{nameof(SalesAgentName)}Text", pathToSaveFiles);
                }

                if (PathToStampAndSignature != string.Empty)
                {
                    fileHandler.WriteToFile(new string[] { PathToStampAndSignature }, $"{nameof(PathToStampAndSignature)}Text", pathToSaveFiles);
                }
            }
        }
        public async void Example()
        {
#pragma warning disable 0168
            using (Client client = GetClient())
            {
                Address billingAddress = new Address();
                billingAddress.AdditionalInfo = "Suite II";
                billingAddress.City           = "Monument Valley";
                billingAddress.CountryCode    = "US";
                billingAddress.HouseNumber    = "1";
                billingAddress.State          = "Utah";
                billingAddress.Street         = "Desertroad";
                billingAddress.Zip            = "84536";

                CompanyInformation companyInformation = new CompanyInformation();
                companyInformation.Name = "Acme Labs";

                PersonalNameToken name = new PersonalNameToken();
                name.FirstName     = "Wile";
                name.Surname       = "Coyote";
                name.SurnamePrefix = "E.";

                PersonalInformationToken personalInformation = new PersonalInformationToken();
                personalInformation.Name = name;

                CustomerToken customer = new CustomerToken();
                customer.BillingAddress      = billingAddress;
                customer.CompanyInformation  = companyInformation;
                customer.MerchantCustomerId  = "1234";
                customer.PersonalInformation = personalInformation;

                BankAccountBban bankAccountBban = new BankAccountBban();
                bankAccountBban.AccountNumber = "000000123456";
                bankAccountBban.BankCode      = "05428";
                bankAccountBban.BranchCode    = "11101";
                bankAccountBban.CheckDigit    = "X";
                bankAccountBban.CountryCode   = "IT";

                TokenNonSepaDirectDebitPaymentProduct705SpecificData paymentProduct705SpecificData = new TokenNonSepaDirectDebitPaymentProduct705SpecificData();
                paymentProduct705SpecificData.AuthorisationId = "123456";
                paymentProduct705SpecificData.BankAccountBban = bankAccountBban;

                MandateNonSepaDirectDebit mandate = new MandateNonSepaDirectDebit();
                mandate.PaymentProduct705SpecificData = paymentProduct705SpecificData;

                TokenNonSepaDirectDebit nonSepaDirectDebit = new TokenNonSepaDirectDebit();
                nonSepaDirectDebit.Customer = customer;
                nonSepaDirectDebit.Mandate  = mandate;

                CreateTokenRequest body = new CreateTokenRequest();
                body.NonSepaDirectDebit = nonSepaDirectDebit;
                body.PaymentProductId   = 705;

                CreateTokenResponse response = await client.Merchant("merchantId").Tokens().Create(body);
            }
#pragma warning restore 0168
        }
Example #17
0
        public JsonResult UploadCompanyLogo()
        {
            HttpPostedFileBase httpPostedFileBase = Request.Files["ImageFile"];
            string             companyId          = Request["companyId"].ToString();
            string             returnfilename     = "";
            bool result = false;

            if (httpPostedFileBase != null && httpPostedFileBase.ContentLength != 0)
            {
                string extention   = Path.GetExtension(httpPostedFileBase.FileName);
                string fileName    = companyId + "-{0}-" + DateTime.Now.Ticks + "{1}";
                string imagefolder = AppConfig.CompanyProfileImageFolder;

                string profileImageFolderPath = Server.MapPath("~/" + imagefolder + companyId);
                returnfilename = imagefolder + companyId + "/" + string.Format(fileName, "full", extention);
                if (FileHelper.CreateFolderIfNeeded(profileImageFolderPath))
                {
                    try
                    {
                        Image orgImg = Bitmap.FromStream(httpPostedFileBase.InputStream);
                        foreach (var prop in orgImg.PropertyItems)
                        {
                            if (prop.Id == 0x0112) //value of EXIF
                            {
                                int            orientationValue = orgImg.GetPropertyItem(prop.Id).Value[0];
                                RotateFlipType rotateFlipType   = ImageHelper.GetOrientationToFlipType(orientationValue);
                                orgImg.RotateFlip(rotateFlipType);

                                break;
                            }
                        }
                        if (orgImg.Height > 300 || orgImg.Width > 300)
                        {
                            orgImg = ImageHelper.GetImageResize(300, 300, orgImg);
                        }
                        var qualityEncoder = Encoder.Quality;
                        var quality        = (long)80;
                        var ratio          = new EncoderParameter(qualityEncoder, quality);
                        var codecParams    = new EncoderParameters(1);
                        codecParams.Param[0] = ratio;
                        var jpegCodecInfo = ImageCodecInfo.GetImageEncoders();
                        CompanyInformation _CompanyInformation = _Util.Facade.CompanyRegistrationFacade.GetCompanyInfoByCompanyId(companyId);
                        _CompanyInformation.CompanyLogo = "/" + returnfilename;
                        _Util.Facade.CompanyRegistrationFacade.UpdateCompany(_CompanyInformation, out _error);
                        orgImg.Save(Path.Combine(profileImageFolderPath, string.Format(fileName, "full", extention)), GetEncoder(ImageFormat.Jpeg), codecParams);
                        result = true;
                    }
                    catch (Exception ex)
                    {
                        result = false;
                    }
                }
            }

            return(Json(new { success = result, filename = returnfilename }));
        }
Example #18
0
 public ActionResult Edit([Bind(Include = "Id,Name,Address,Phone,Web,Email,ContactPerson")] CompanyInformation companyInformation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(companyInformation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Details"));
     }
     return(View(companyInformation));
 }
Example #19
0
        public ActionResult Create([Bind(Include = "Id,Name,Address,Phone,Web,Email,ContactPerson")] CompanyInformation companyInformation)
        {
            if (ModelState.IsValid)
            {
                db.CompanyInformation.Add(companyInformation);
                db.SaveChanges();
                return(RedirectToAction("Details"));
            }

            return(View(companyInformation));
        }
        public IActionResult AddCompanyInformation([FromBody] CompanyInformation companyInformation)
        {
            var result = this._companyInformationService.AddCompanyInformation(companyInformation);

            if (!result)
            {
                return(BadRequest());
            }

            return(Ok());
        }
        public IHttpActionResult GetCompanyInformation(int id)
        {
            CompanyInformation companyInformation = db.CompanyInformations.Find(id);

            if (companyInformation == null)
            {
                return(NotFound());
            }

            return(Ok(companyInformation));
        }
        public IActionResult EditCompanyInformation([FromBody] CompanyInformation companyInformation, string key)
        {
            var result = this._companyInformationService.EditCompanyInformation(companyInformation, key);

            if (!result)
            {
                return(BadRequest());
            }

            return(Ok());
        }
Example #23
0
        public void LoadDataFromDatabase()
        {
            using (var ctx = new AssistantContext())
                CompanyInformation = ctx.CompanyInformation.FirstOrDefault();

            // Create new it does not exist
            if (CompanyInformation == null)
            {
                CompanyInformation = new CompanyInformation();
            }
        }
Example #24
0
        /// <summary>
        /// Update company information
        /// </summary>
        /// <param name="company">company to update</param>
        public void UpdateCompany(CompanyInformation company)
        {
            if (company == null)
            {
                throw new ArgumentNullException("content");
            }

            _companyRepository.Update(company);

            //event notification
            _eventPublisher.EntityUpdated(company);
        }
Example #25
0
        public async void Example()
        {
#pragma warning disable 0168
            using (Client client = GetClient())
            {
                Address billingAddress = new Address();
                billingAddress.AdditionalInfo = "b";
                billingAddress.City           = "Monument Valley";
                billingAddress.CountryCode    = "US";
                billingAddress.HouseNumber    = "13";
                billingAddress.State          = "Utah";
                billingAddress.Street         = "Desertroad";
                billingAddress.Zip            = "84536";

                CompanyInformation companyInformation = new CompanyInformation();
                companyInformation.Name = "Acme Labs";

                PersonalNameToken name = new PersonalNameToken();
                name.FirstName     = "Wile";
                name.Surname       = "Coyote";
                name.SurnamePrefix = "E.";

                PersonalInformationToken personalInformation = new PersonalInformationToken();
                personalInformation.Name = name;

                CustomerToken customer = new CustomerToken();
                customer.BillingAddress      = billingAddress;
                customer.CompanyInformation  = companyInformation;
                customer.MerchantCustomerId  = "1234";
                customer.PersonalInformation = personalInformation;

                CardWithoutCvv cardWithoutCvv = new CardWithoutCvv();
                cardWithoutCvv.CardNumber     = "4567350000427977";
                cardWithoutCvv.CardholderName = "Wile E. Coyote";
                cardWithoutCvv.ExpiryDate     = "1299";
                cardWithoutCvv.IssueNumber    = "12";

                TokenCardData data = new TokenCardData();
                data.CardWithoutCvv = cardWithoutCvv;

                TokenCard card = new TokenCard();
                card.Customer = customer;
                card.Data     = data;

                UpdateTokenRequest body = new UpdateTokenRequest();
                body.Card             = card;
                body.PaymentProductId = 1;

                await client.Merchant("merchantId").Tokens().Update("tokenId", body);
            }
#pragma warning restore 0168
        }
        protected override void MapAddress(CompanyInformation companyInformation, string address)
        {
            var addressParts = address.Split(new[] { "\n" }, StringSplitOptions.None);

            companyInformation.Address = addressParts.Length > 0 ? addressParts[0] : null;

            if (addressParts.Length > 1)
            {
                companyInformation.City       = GetCity(addressParts[1]);
                companyInformation.PostalCode = GetPostalCode(addressParts[1]);
                companyInformation.Province   = GetProvince(addressParts[1]);
            }
        }
Example #27
0
        public ActionResult Create([Bind(Include = "Id,Name,Address,Phone,Web,Email,ContactPerson,IsAuth,OpBy,OpOn,AuthBy,AuthOn")] CompanyInformation companyInformation)
        {
            if (ModelState.IsValid)
            {
                companyInformation.OpBy = 1;
                companyInformation.OpOn = DateTime.Now;
                db.CompanyInformations.Add(companyInformation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(companyInformation));
        }
        public IHttpActionResult DeleteCompanyInformation(int id)
        {
            CompanyInformation companyInformation = db.CompanyInformations.Find(id);

            if (companyInformation == null)
            {
                return(NotFound());
            }

            db.CompanyInformations.Remove(companyInformation);
            db.SaveChanges();

            return(Ok(companyInformation));
        }
Example #29
0
        // GET: CompanyInformations/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CompanyInformation companyInformation = db.CompanyInformation.Find(id);

            if (companyInformation == null)
            {
                return(HttpNotFound());
            }
            return(View(companyInformation));
        }
        public async Task ShouldSearchForCompanyUsingCompanyHouseService()
        {
            //Arrange
            var reference = "12345678";
            var info      = new CompanyInformation();

            _verificationService.Setup(x => x.GetInformation(It.IsAny <string>())).ReturnsAsync(info);

            //Act
            await _searchService.Search(reference);

            //Assert
            _verificationService.Verify(x => x.GetInformation(reference), Times.Once);
        }
Example #31
0
        public ActionResult CreateCompanyInformation(CompanyInformation type)
        {
            type.LanguageId = Int16.Parse(this.Request.Form.Get("LanguageList"));

            if (ModelState.IsValid)
            {
                Company company =db.Companies.Find(type.CompanyId);
                company.Revision++;
                db.Entry(company).State = EntityState.Modified;
                db.CompanyInformation.Add(type);
                db.SaveChanges();
                return RedirectToAction("Details", new { id=type.CompanyId });
            }

            return View(type);
        }
 internal CompanyRepresentativeInformation mapFromDomain(Domain.Models.CompanyRepresentativeInformation poco)
 {
     //This mapping could be done by another object or third-party library.
      //Updating current state, could have treated immutably.
     Id = poco.Id;
     Name = poco.Name;
     Title = poco.Title;
     PhoneNumber = poco.PhoneNumber;
     Company = new CompanyInformation
     {
         City = poco.City, Id = poco.Id, Name = poco.Name,
         StreetName = poco.StreetName, StreetNumber = poco.StreetNumber
     };
     StreetName = poco.StreetName;
     StreetNumber = poco.StreetNumber;
     return this;
 }
Example #33
0
        public ActionResult CreateCompanyInformation(int companyid = 0)
        {
            Company company = db.Companies.Find(companyid);
            if (company == null)
                throw new HttpException(404, "Company not found");
            CompanyInformation compinfo = new CompanyInformation();
            compinfo.CompanyId = companyid;
            var langs = from c in db.Language
                                where !(from o in db.CompanyInformation
                                            where o.CompanyId == companyid
                                            select o.Language.LanguageId)
                                            .Contains(c.LanguageId)
                                select c;

            ViewBag.LanguageList = new SelectList(langs.ToList(), "LanguageId", "Title");
            return View(compinfo);
        }
Example #34
0
        public List<BillInformation> GetAssociatedBills(CompanyInformation company, ClientInformation client)
        {
            List<BillInformation> bills = new List<BillInformation>();
            DataTable results = database.Select("SELECT * FROM bill WHERE company=@company AND client=@client",
                new Dictionary<string, object>()
                {
                    {"company", company.ID},
                    {"client", client.ID}
                });

            foreach (DataRow result in results.Rows)
            {
                BillInformation bill = new BillInformation();
                bill.Fill(result);
                bills.Add(bill);
            }
            return bills;
        }
Example #35
0
        public List<CompanyInformation> GetCompanyInformations()
        {
            List<CompanyInformation> companies = new List<CompanyInformation>();
            database.Open();

            DataTable table = database.Select("select * from company");

            foreach (DataRow row in table.Rows)
            {
                CompanyInformation c = new CompanyInformation();
                c.Fill(row);

                companies.Add(c);
            }

            database.Close();
            return companies;
        }
Example #36
0
 public ActionResult EditCompanyInformation(CompanyInformation type)
 {
     if (ModelState.IsValid)
     {
         Company company = db.Companies.Find(type.CompanyId);
         company.Revision++;
         db.Entry(company).State = EntityState.Modified;
         db.Entry(type).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Details", new { id = company.CompanyId });
     }
     return View("CreateCompanyInformation", type);
 }