/// <summary>
 /// Function to fill the Dates
 /// </summary>
 public void FinancialYearDate()
 {
     try
     {
         dtpFromDate.MinDate = PublicVariables._dtFromDate;
         dtpFromDate.MaxDate = PublicVariables._dtToDate;
         CompanyInfo infoComapany = new CompanyInfo();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.CompanyView(1);
         DateTime dtFromDate = infoComapany.CurrentDate;
         dtpFromDate.Value = dtFromDate;
         txtFromDate.Text = dtFromDate.ToString("dd-MMM-yyyy");
         dtpFromDate.Value = Convert.ToDateTime(txtFromDate.Text);
         dtpToDate.MinDate = PublicVariables._dtFromDate;
         dtpToDate.MaxDate = PublicVariables._dtToDate;
         infoComapany = bllCompanyCreation.CompanyView(1);
         DateTime dtToDate = infoComapany.CurrentDate;
         dtpToDate.Value = dtToDate;
         dtpToDate.Text = dtToDate.ToString("dd-MMM-yyyy");
         dtpToDate.Value = Convert.ToDateTime(txtFromDate.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show("JREG4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 public CompanyInfo GetCompanyInfo(string recuiterId)
 {
     CompanyInfo companyInfo = new CompanyInfo();
     if (recuiterId != null)
     {
         companyInfo = this.CompanyInfoRepository.Get(s => s.RecruiterID == recuiterId).FirstOrDefault();
     }
     return companyInfo;
 }
예제 #3
0
 public static CompanyInfo Get(string OrgAlias, string InstAlias, Guid OrgGuid, Guid InstGuid)
 {
     lib.bwa.bigWebDesk.LinqBll.Context.MutiBaseDataContext dc = lib.bwa.bigWebDesk.LinqBll.Context.MutiBaseDataContext.Create(OrgAlias, InstAlias, OrgGuid, InstGuid);
     CompanyInfo ret = new CompanyInfo();
     if (dc == null || dc.OrganizationId==null || dc.OrganizationId==Guid.Empty) return ret;
     if (dc.InstaceId != null) ret.InstanceId = (Guid)dc.InstaceId;
     ret.OrganizationId = (Guid)dc.OrganizationId;
     if (dc.DepartmentId!=null) ret.DepartmentId = (int)dc.DepartmentId;
     return ret;
 }
예제 #4
0
        public ActionResult Contact()
        {
            var companyInfo = new CompanyInfo
                                  {
                                      CompanyName = "Your company name here",
                                      AddressLine1 = "Company address Line 1",
                                      AddressLine2 = "Company address Line 2",
                                      City = "City",
                                      State = "State",
                                      Zip = "00000",
                                      Email = "*****@*****.**"
                                  };

            return View(companyInfo);
        }
 /// <summary>
 /// Function to do after company creation
 /// </summary>
 public void AfterCompanyCreation()
 {
     try
     {
         PublicVariables._decCurrentUserId = 1;
         formMDI.MDIObj.CallFromLogin();
         formMDI.MDIObj.ShowQuickLaunchMenu();
         frmNewFinancialYear frmNewFinancialYearObj = new frmNewFinancialYear();
         frmNewFinancialYearObj.MdiParent = formMDI.MDIObj;
         frmNewFinancialYearObj.CallFromCompanyCreation(this);
         CompanyInfo infoCompany = new CompanyInfo();
         CompanyCreationBll BllCompanyCreation = new CompanyCreationBll();
         infoCompany = BllCompanyCreation.CompanyView(1);
         PublicVariables._decCurrencyId = infoCompany.CurrencyId;
     }
     catch (Exception ex)
     {
         MessageBox.Show("CR11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 public override void StoreTvNetworkMatch(CompanyInfo company)
 {
 }
예제 #7
0
 public bool ValidUpdateObject(CompanyInfo companyInfo, ICompanyInfoService _companyInfoService)
 {
     companyInfo.Errors.Clear();
     return(ValidCreateObject(companyInfo, _companyInfoService));
 }
예제 #8
0
        private void VerifyData(ApiResponse <HrbcCoreTmpCompanyInfoResponse> response, ValidTestCases inputType, CompanyInfo companyInfo)
        {
            var creds     = AuthenticationInfoProvider.GetAuthSpecForCurrentTest();
            var adminName = creds.Companies.First().Value.Users.First().Metadata["name"].ToString();

            creds.Dispose();

            if (inputType == ValidTestCases.Default || inputType == ValidTestCases.False)
            {
                PrAssert.That(response.Result.Name, PrIs.Null);
            }
            else
            {
                PrAssert.That(response.Result.Name, PrIs.EqualTo(companyInfo.Name));
            }

            PrAssert.That(response.Result.CompanyLoginId, PrIs.EqualTo(companyInfo.CompanyLoginId));
            PrAssert.That(response.Result.CatalogName, PrIs.EqualTo(companyInfo.CatalogName));
            PrAssert.That(response.Result.DbInfoHost, PrIs.EqualTo(companyInfo.DbInfoHost));
            PrAssert.That(response.Result.DbInfoPort, PrIs.EqualTo(companyInfo.DbInfoPort));
            PrAssert.That(response.Result.DbInfoUserName, PrIs.EqualTo(companyInfo.DbInfoUserName));
            PrAssert.That(response.Result.DbInfoPassword, PrIs.EqualTo(companyInfo.DbInfoPassword));
            PrAssert.That(response.Result.Id, PrIs.EqualTo(companyInfo.Id));
        }
        public override bool GetFanArt <T>(T infoObject, string language, string fanartMediaType, out ApiWrapperImageCollection <FanArtMovieThumb> images)
        {
            images = new ApiWrapperImageCollection <FanArtMovieThumb>();

            try
            {
                if (fanartMediaType == FanArtMediaTypes.Movie)
                {
                    FanArtMovieThumbs imgs  = null;
                    MovieInfo         movie = infoObject as MovieInfo;
                    if (movie != null && movie.MovieDbId > 0)
                    {
                        // Download all image information, filter later!
                        imgs = _fanArtTvHandler.GetMovieThumbs(movie.MovieDbId.ToString());
                    }

                    if (imgs != null)
                    {
                        images.Id = movie.MovieDbId.ToString();
                        if (imgs.MovieFanArt != null)
                        {
                            images.Backdrops.AddRange(imgs.MovieFanArt.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.MovieBanners != null)
                        {
                            images.Banners.AddRange(imgs.MovieBanners.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.MoviePosters != null)
                        {
                            images.Posters.AddRange(imgs.MoviePosters.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.MovieCDArt != null)
                        {
                            images.DiscArt.AddRange(imgs.MovieCDArt.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.HDMovieClearArt != null)
                        {
                            images.ClearArt.AddRange(imgs.HDMovieClearArt.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.HDMovieLogos != null)
                        {
                            images.Logos.AddRange(imgs.HDMovieLogos.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.MovieThumbnails != null)
                        {
                            images.Thumbnails.AddRange(imgs.MovieThumbnails.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        return(true);
                    }
                }
                else if (fanartMediaType == FanArtMediaTypes.Series)
                {
                    FanArtTVThumbs imgs    = null;
                    EpisodeInfo    episode = infoObject as EpisodeInfo;
                    SeasonInfo     season  = infoObject as SeasonInfo;
                    SeriesInfo     series  = infoObject as SeriesInfo;
                    if (series == null && season != null)
                    {
                        series = season.CloneBasicInstance <SeriesInfo>();
                    }
                    if (series == null && episode != null)
                    {
                        series = episode.CloneBasicInstance <SeriesInfo>();
                    }
                    if (series != null && series.TvdbId > 0)
                    {
                        // Download all image information, filter later!
                        imgs = _fanArtTvHandler.GetSeriesThumbs(series.TvdbId.ToString());
                    }

                    if (imgs != null)
                    {
                        images.Id = series.TvdbId.ToString();
                        if (imgs.SeriesFanArt != null)
                        {
                            images.Backdrops.AddRange(imgs.SeriesFanArt.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.SeriesBanners != null)
                        {
                            images.Banners.AddRange(imgs.SeriesBanners.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.SeriesPosters != null)
                        {
                            images.Posters.AddRange(imgs.SeriesPosters.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.HDSeriesClearArt != null)
                        {
                            images.ClearArt.AddRange(imgs.HDSeriesClearArt.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.HDSeriesLogos != null)
                        {
                            images.Logos.AddRange(imgs.HDSeriesLogos.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.SeriesThumbnails != null)
                        {
                            images.Thumbnails.AddRange(imgs.SeriesThumbnails.OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        return(true);
                    }
                }
                else if (fanartMediaType == FanArtMediaTypes.SeriesSeason)
                {
                    FanArtTVThumbs imgs     = null;
                    int            seasonNo = 0;
                    EpisodeInfo    episode  = infoObject as EpisodeInfo;
                    SeasonInfo     season   = infoObject as SeasonInfo;
                    if (season == null && episode != null)
                    {
                        season = episode.CloneBasicInstance <SeasonInfo>();
                    }
                    if (season != null && season.SeriesTvdbId > 0 && season.SeasonNumber.HasValue)
                    {
                        // Download all image information, filter later!
                        imgs     = _fanArtTvHandler.GetSeriesThumbs(season.SeriesTvdbId.ToString());
                        seasonNo = season.SeasonNumber.Value;
                    }

                    if (imgs != null)
                    {
                        images.Id = season.SeriesTvdbId.ToString();
                        if (imgs.SeasonBanners != null)
                        {
                            images.Banners.AddRange(imgs.SeasonBanners.FindAll(b => !b.Season.HasValue || b.Season == seasonNo).
                                                    OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.SeasonPosters != null)
                        {
                            images.Posters.AddRange(imgs.SeasonPosters.FindAll(b => !b.Season.HasValue || b.Season == seasonNo).
                                                    OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        if (imgs.SeasonThumbnails != null)
                        {
                            images.Thumbnails.AddRange(imgs.SeasonThumbnails.FindAll(b => !b.Season.HasValue || b.Season == seasonNo).
                                                       OrderBy(b => string.IsNullOrEmpty(b.Language)).ThenByDescending(b => b.Likes).ToList());
                        }
                        return(true);
                    }
                }
                else if (fanartMediaType == FanArtMediaTypes.Artist)
                {
                    FanArtArtistThumbs imgs   = null;
                    PersonInfo         person = infoObject as PersonInfo;
                    if (person != null && !string.IsNullOrEmpty(person.MusicBrainzId))
                    {
                        // Download all image information, filter later!
                        imgs = _fanArtTvHandler.GetArtistThumbs(person.MusicBrainzId);
                    }

                    if (imgs != null)
                    {
                        images.Id = person.MusicBrainzId;
                        if (imgs.ArtistFanart != null)
                        {
                            images.Backdrops.AddRange(imgs.ArtistFanart.OrderByDescending(b => b.Likes).Select(b => new FanArtMovieThumb(b)).ToList());
                        }
                        if (imgs.ArtistBanners != null)
                        {
                            images.Banners.AddRange(imgs.ArtistBanners.OrderByDescending(b => b.Likes).Select(b => new FanArtMovieThumb(b)).ToList());
                        }
                        if (imgs.HDArtistLogos != null)
                        {
                            images.Logos.AddRange(imgs.HDArtistLogos.OrderByDescending(b => b.Likes).Select(b => new FanArtMovieThumb(b)).ToList());
                        }
                        if (imgs.ArtistThumbnails != null)
                        {
                            images.Thumbnails.AddRange(imgs.ArtistThumbnails.OrderByDescending(b => b.Likes).Select(b => new FanArtMovieThumb(b)).ToList());
                        }
                        return(true);
                    }
                }
                else if (fanartMediaType == FanArtMediaTypes.MusicLabel)
                {
                    FanArtLabelThumbs imgs    = null;
                    CompanyInfo       company = infoObject as CompanyInfo;
                    if (company != null && !string.IsNullOrEmpty(company.MusicBrainzId))
                    {
                        // Download all image information, filter later!
                        imgs = _fanArtTvHandler.GetLabelThumbs(company.MusicBrainzId);
                    }

                    if (imgs != null)
                    {
                        images.Id = company.MusicBrainzId;
                        if (imgs.LabelLogos != null)
                        {
                            images.Logos.AddRange(imgs.LabelLogos.OrderByDescending(b => b.Likes).Select(b => new FanArtMovieThumb(b)).ToList());
                        }
                        return(true);
                    }
                }
                else if (fanartMediaType == FanArtMediaTypes.Album)
                {
                    FanArtAlbumDetails imgs    = null;
                    string             albumId = null;
                    TrackInfo          track   = infoObject as TrackInfo;
                    AlbumInfo          album   = infoObject as AlbumInfo;
                    if (album == null && track != null)
                    {
                        album = track.CloneBasicInstance <AlbumInfo>();
                    }
                    if (album != null && !string.IsNullOrEmpty(album.MusicBrainzGroupId))
                    {
                        // Download all image information, filter later!
                        imgs    = _fanArtTvHandler.GetAlbumThumbs(album.MusicBrainzGroupId);
                        albumId = album.MusicBrainzGroupId;
                    }

                    if (imgs != null)
                    {
                        images.Id = albumId;
                        if (imgs.Albums != null && imgs.Albums.ContainsKey(albumId) && imgs.Albums[albumId].AlbumCovers != null)
                        {
                            images.Covers.AddRange(imgs.Albums[albumId].AlbumCovers.OrderByDescending(b => b.Likes).Select(b => new FanArtMovieThumb(b)).ToList());
                        }
                        if (imgs.Albums != null && imgs.Albums.ContainsKey(albumId) && imgs.Albums[albumId].CDArts != null)
                        {
                            images.DiscArt.AddRange(imgs.Albums[albumId].CDArts.OrderByDescending(b => b.Likes).Select(b => new FanArtMovieThumb(b)).ToList());
                        }
                        return(true);
                    }
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception ex)
            {
                ServiceRegistration.Get <ILogger>().Debug(GetType().Name + ": Exception downloading images", ex);
            }
            return(false);
        }
 /// <summary>
 /// Function to fill controls for Update
 /// </summary>
 public void CompanyViewForEdit()
 {
     try
     {
         isEditMode = true;
         this.Text = "Edit Company";
         btnSave.Text = "Update";
         btnDelete.Enabled = true;
         gbxDetails.Visible = false;
         txtAdminUserName.ReadOnly = true;
         txtAdminUserName.BackColor = Color.White;
         cmbCurrency.Enabled = false;
         CompanyCreationBll BllCompanyCreation = new CompanyCreationBll();
         CompanyInfo infoCompany = new CompanyInfo();
         decimal decCompanyId = 1;
         infoCompany = BllCompanyCreation.CompanyView(PublicVariables._decCurrentCompanyId);
         txtCompanyName.Text = infoCompany.CompanyName;
         txtMailingName.Text = infoCompany.MailingName;
         txtAddress.Text = infoCompany.Address;
         txtPhoneNo.Text = infoCompany.Phone;
         txtMobile.Text = infoCompany.Mobile;
         txtEmail.Text = infoCompany.EmailId;
         txtWeb.Text = infoCompany.Web;
         txtCountry.Text = infoCompany.Country;
         txtState.Text = infoCompany.State;
         txtPincode.Text = infoCompany.Pin;
         cmbCurrency.SelectedValue = infoCompany.CurrencyId;
         txtFinancialYearFrom.Text = infoCompany.FinancialYearFrom.ToString("dd-MMM-yyyy");
         dtpFinancialYearFrom.Text = infoCompany.FinancialYearFrom.ToString();
         txtBooksBegining.Text = infoCompany.BooksBeginingFrom.ToString("dd-MMM-yyyy");
         dtpBooksBegining.Text = infoCompany.BooksBeginingFrom.ToString();
         txtTinNo.Text = infoCompany.Tin;
         txtCstNo.Text = infoCompany.Cst;
         txtPanNo.Text = infoCompany.Pan;
         logo = (byte[])infoCompany.Logo;
         MemoryStream ms = new MemoryStream(logo);
         Image newimage = Image.FromStream(ms);
         pbxLogo.Image = newimage;
         pbxLogo.SizeMode = PictureBoxSizeMode.StretchImage;
         CompanyPathInfo infoCompanyPath = new CompanyPathInfo();
         CompanyPathBll BllComapnyPath = new CompanyPathBll();
         infoCompanyPath = BllComapnyPath.CompanyPathView(1);
         if (infoCompanyPath.IsDefault == true)
         {
             cbxSetAsDefault.Checked = true;
         }
         else
         {
             cbxSetAsDefault.Checked = false;
         }
         UserBll bllUser = new UserBll();
         UserInfo infoUser = new UserInfo();
         decimal decuserId = PublicVariables._decCurrentUserId;
         infoUser = bllUser.UserView(decuserId);
         txtAdminUserName.Text = infoUser.UserName;
         txtPassword.Text = infoUser.Password;
         txtRetypePassword.Text = infoUser.Password;
     }
     catch (Exception ex)
     {
         MessageBox.Show("CR8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #11
0
            public static CompanyInfo GetAllCompanyByTradeId(int tradeId)
            {
                CompanyInfo currentData = new CompanyInfo();

                //CompanyHelper_Update company = new CompanyHelper_Update();
                //currentData.RecordCount = company.Select_Count_TradeCenter("", -1, tradeId, (int)FilterType.NoFilter);
                //currentData.PageIndex = 1;
                //currentData.PageCount = 1;

                //using (DataTable dtCompanies = company.GetTradeCenter(tradeId.ToString()))
                //{
                //    List<CompanyInfoItem> items = new List<CompanyInfoItem>();
                //    if (dtCompanies != null)
                //    {
                //        using (DataTable dtCompaniesIncludePrice = GetOnlineInfo(dtCompanies))
                //        {
                //            for (int i = 0; i < dtCompaniesIncludePrice.Rows.Count; i++)
                //            {
                //                if (Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["CurrentPrice"]) == 0)
                //                {
                //                    items.Add(new CompanyInfoItem(dtCompaniesIncludePrice.Rows[i]["StockSymbol"].ToString(),
                //                                                       dtCompaniesIncludePrice.Rows[i]["Fullname"].ToString(),
                //                                                       dtCompaniesIncludePrice.Rows[i]["Symbol"].ToString(),
                //                                                       Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["BasicPrice"]),
                //                                                       Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["PE"]),
                //                                                       Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["EPS"])
                //                                                       ));
                //                }
                //                else
                //                {
                //                    items.Add(new CompanyInfoItem(dtCompaniesIncludePrice.Rows[i]["StockSymbol"].ToString(),
                //                                                    dtCompaniesIncludePrice.Rows[i]["Fullname"].ToString(),
                //                                                    dtCompaniesIncludePrice.Rows[i]["Symbol"].ToString(),
                //                                                    Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["CurrentPrice"]),
                //                                                    Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["PE"]),
                //                                                    Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["EPS"])
                //                                                    )
                //                                                    );
                //                }
                //            }
                //        }
                //    }
                //    currentData.CompanyInfos = items.ToArray();
                //}
                var items = new List<CompanyInfoItem>();
                var key = tradeId > 0 ? string.Format(RedisKey.KeyStockListByCenter, tradeId): RedisKey.KeyStockList;
                
                var sds = BLFACTORY.RedisClient.Get<List<StockCompact>>(key);
                var ss = new List<string>();
                foreach (var sym in sds)
                {
                    ss.Add(sym.Symbol);
                }
                var infos = StockBL.GetStockCompactInfoMultiple(ss);
                var prices = StockBL.GetStockPriceMultiple(ss);
                foreach (var sym in sds)
                {
                    var item = new CompanyInfoItem();
                    item.Symbol = sym.Symbol;
                    item.TradeCenter = Utils.GetCenterName(sym.TradeCenterId.ToString());
                    if(prices.ContainsKey(sym.Symbol))
                    {
                        var price = prices[sym.Symbol];
                        if(price!=null)
                        {
                            item.Price = price.Price;
                        }
                    }
                    if(infos.ContainsKey(sym.Symbol))
                    {
                        var info = infos[sym.Symbol];
                        if(info!=null)
                        {
                            item.CompanyName = info.CompanyName;
                            item.EPS = Math.Round(info.EPS, 2);
                            item.PE = (info.EPS == 0) ? 0 : Math.Round(item.Price / info.EPS, 2);
                        }
                    }
                        items.Add(item);    
                    
                }
                currentData.RecordCount = items.Count;
                currentData.PageIndex = 1;
                currentData.PageCount = 1;
                currentData.CompanyInfos = items.ToArray();
                return currentData;
            }
        /// <summary>
        /// Changing company's  financial year
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSelect_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("Are you sure you want to change the financial year?", "OpenMiracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
                    FinancialYearBll bllFinancialYear = new FinancialYearBll();
                    decimal decFinacialId = Convert.ToDecimal(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtfinancialYearId"].Value);
                    DateTime dtmFromDate = Convert.ToDateTime(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtFromDate"].Value);
                    DateTime dtmToDate = Convert.ToDateTime(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtToDate"].Value);
                    PublicVariables._decCurrentFinancialYearId = decFinacialId;
                    PublicVariables._dtFromDate = dtmFromDate;
                    PublicVariables._dtToDate = dtmToDate;
                    DateTime dtGetCurrentdate = DateTime.Now;
                    //CompanySP spCompany = new CompanySP();
                    CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
                    bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
                    if (dtGetCurrentdate < dtmFromDate)
                    {
                        PublicVariables._dtCurrentDate = dtmFromDate;
                        bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
                        formMDI.MDIObj.ShowCurrentDate();
                    }
                    else
                    {

                        PublicVariables._dtCurrentDate = dtGetCurrentdate;
                        bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
                        formMDI.MDIObj.ShowCurrentDate();
                    }
                    CompanyInfo infoCompany = new CompanyInfo();
                    infoCompany = bllCompanyCreation.CompanyView(1);
                    formMDI.MDIObj.Text = "OpenMiracle " + infoCompany.CompanyName + " [ " + PublicVariables._dtFromDate.ToString("dd-MMM-yyyy") + " To " + PublicVariables._dtToDate.ToString("dd-MMM-yyyy") + " ]";
                    this.Close();
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("CHGFINYR:5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #13
0
 public int InsertByOutput(CompanyInfo model)
 {
     return(dal.InsertByOutput(model));
 }
예제 #14
0
        /// <summary>
        /// 获取企业信息列表
        /// </summary>
        /// <returns></returns>
        public string GetCompanyList()
        {
            if (Signature != GetParam("sig").ToString())
            {
                ErrorCode = (int)ErrorType.API_EC_SIGNATURE;
                return "";
            }

            //如果是桌面程序则需要验证用户身份
            if (this.App.ApplicationType == (int)ApplicationType.DESKTOP)
            {
                if (Uid < 1)
                {
                    ErrorCode = (int)ErrorType.API_EC_SESSIONKEY;
                    return "";
                }
            }

            if (CallId <= LastCallId)
            {
                ErrorCode = (int)ErrorType.API_EC_CALLID;
                return "";
            }

            if (!CheckRequiredParams("cnums,ordercol"))
            {
                ErrorCode = (int)ErrorType.API_EC_PARAM;
                return "";
            }

            int cnums = GetIntParam("cnums", 10);
            string orderby = GetParam("ordercol") == null ? "" : GetParam("ordercol").ToString();

            List<SAS.Entity.Companys> clist = new List<SAS.Entity.Companys>();

            switch (orderby)
            {
                case "credit":
                    clist = SAS.Data.DataProvider.Companies.GetCompanyListByOrder(cnums, "en_credits", true);
                    break;
                default:
                    clist = SAS.Data.DataProvider.Companies.GetCompanyListByOrder(cnums, "en_createdate", true);
                    break;
            }

            CompanyGetListResponse gglr = new CompanyGetListResponse();
            List<CompanyInfo> cilist = new List<CompanyInfo>();

            foreach (SAS.Entity.Companys cmodel in clist)
            {
                CompanyInfo cinfo = new CompanyInfo();
                cinfo.Enid = cmodel.En_id;
                cinfo.Ename = cmodel.En_name;
                cinfo.Enaccesses = cmodel.En_accesses;
                cinfo.Encredits = cmodel.En_credits;

                if (cmodel.En_cataloglist.Split(',').Length > 0)
                {
                    cinfo.Encatalogid = Utils.StrToInt(cmodel.En_cataloglist.Split(',')[0], 0);
                }

                SAS.Entity.CatalogInfo catainfo = Catalogs.GetCatalogCacheInfo(cinfo.Encatalogid);
                cinfo.Encatalogname = catainfo == null ? string.Empty:catainfo.name;
                cilist.Add(cinfo);
            }

            gglr.Cnums = cilist.Count;
            gglr.CompanyList = cilist.ToArray();

            if (Format == FormatType.JSON)
            {
                return JavaScriptConvert.SerializeObject(gglr);
            }
            return SerializationHelper.Serialize(gglr);
        }
예제 #15
0
 /// <summary>
 /// Start a login
 /// </summary>
 public void Login()
 {
     try
     {
         UserBll bllUser = new UserBll();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         CompanyInfo infoCompany = new CompanyInfo();
         string strUserName = txtUserName.Text.Trim();
         string strPassword = bllUser.LoginCheck(strUserName);
         if (strPassword == txtPassword.Text.Trim() && strPassword != string.Empty)
         {
             int inUserId = bllUser.GetUserIdAfterLogin(strUserName, strPassword);
             PublicVariables._decCurrentUserId = inUserId;
             infoCompany = bllCompanyCreation.CompanyView(1);
             PublicVariables._decCurrencyId = infoCompany.CurrencyId;
             formMDI.MDIObj.CallFromLogin();
             SettingsCheck();
             //for Quock Launch menu
             formMDI.MDIObj.ShowQuickLaunchMenu();
             formMDI.MDIObj.CurrentSettings();
             //Display ChangeCurrentDate form//
             frmChangeCurrentDate frmCurrentDateChangeObj = new frmChangeCurrentDate();
             frmCurrentDateChangeObj.MdiParent = formMDI.MDIObj;
             frmCurrentDateChangeObj.CallFromLogin(this);
             formMDI.MDIObj.Text = "OpenMiracle " + infoCompany.CompanyName + " [ " + PublicVariables._dtFromDate.ToString("dd-MMM-yyyy") + " To " + PublicVariables._dtToDate.ToString("dd-MMM-yyyy") + " ]";
             // For showing the OpenMiracle message from the website
             formMDI.MDIObj.logoutToolStripMenuItem.Enabled = true;
             if (PublicVariables.MessageToShow != string.Empty)
             {
                 frmMessage frmMsg = new frmMessage();
                 frmMsg.lblHeading.Text = PublicVariables.MessageHeadear;
                 frmMsg.lblMessage.Text = PublicVariables.MessageToShow;
                 frmMsg.MdiParent = formMDI.MDIObj;
                 frmMsg.Show();
                 frmMsg.Location = new Point(0, formMDI.MDIObj.Height - 270);
                 foreach (Form form in Application.OpenForms)
                 {
                     if (form.GetType() == typeof(frmChangeCurrentDate))
                     {
                         form.Focus();
                     }
                 }
             }
         }
         else
         {
             Messages.InformationMessage("Invalid username or password");
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("LOGIN02:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// To set current date
 /// </summary>
 public void CurrentDate()
 {
     try
     {
         dtpCompanyCurrentDate.MinDate = PublicVariables._dtFromDate;
         dtpCompanyCurrentDate.MaxDate = PublicVariables._dtToDate;
         CompanyInfo infoComapany = new CompanyInfo();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.CompanyView(1);
         DateTime dtCurrentDate = PublicVariables._dtFromDate;
         if (infoComapany.CurrentDate != null)
         {
             dtCurrentDate = infoComapany.CurrentDate;
         }
         if (dtCurrentDate > PublicVariables._dtToDate)
         {
             dtCurrentDate = PublicVariables._dtToDate;
         }
         if (dtCurrentDate < PublicVariables._dtFromDate)
         {
             dtCurrentDate = PublicVariables._dtFromDate;
         }
         dtpCompanyCurrentDate.Value = dtCurrentDate;
         PublicVariables._dtCurrentDate = dtCurrentDate;
         DateTime sysDate = System.DateTime.Today;
         if (sysDate >= PublicVariables._dtFromDate && sysDate <= PublicVariables._dtToDate)
         {
             txtCompanyCurrentdate.Text = sysDate.ToString("dd-MMM-yyyy");
         }
         else
         {
             txtCompanyCurrentdate.Text = dtCurrentDate.ToString("dd-MMM-yyyy");
         }
         dtpCompanyCurrentDate.Value = Convert.ToDateTime(txtCompanyCurrentdate.Text);
         txtCompanyCurrentdate.Focus();
         txtCompanyCurrentdate.SelectAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show("CCD 3 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #17
0
    void GenerateCompanyList(string strCommText)
    {
        lblNoResultsFound.Visible = false;
        dtCompanyInfo = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable(strCommText);
        List<CompanyInfo> ListCompanyRow = new List<CompanyInfo>();
        if (dtCompanyInfo.Rows.Count > 0)
        {
            int n = dtCompanyInfo.Rows.Count;
            string[] strIndustryS = new string[n];

            for (int j = 0; j < dtCompanyInfo.Rows.Count; j++)
            {
                string strCompanyid = dtCompanyInfo.Rows[j]["CompanyID"].ToString();
                DataTable dtIndustry = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable("select IndustryDescr" + CareerCruisingWeb.CCLib.Common.Strings.SuffixCode() + " from Con_CompanyIndustries AS ci INNER JOIN Con_IndustriesLookup AS il ON ci.CompanyID=" + strCompanyid + " and ci.IndustryID = il.IndustryID");
                strIndustryS.SetValue("", j);
                for (int i = 0; i < dtIndustry.Rows.Count; i++)
                {
                    if ((i > 0) && (i < dtIndustry.Rows.Count))
                    {
                        strIndustryS[j] = strIndustryS[j] + ", " + dtIndustry.Rows[i]["IndustryDescr" + CareerCruisingWeb.CCLib.Common.Strings.SuffixCode()].ToString();
                    }
                    else
                    { strIndustryS[j] = strIndustryS[j] + dtIndustry.Rows[i]["IndustryDescr" + CareerCruisingWeb.CCLib.Common.Strings.SuffixCode()].ToString(); }
                }
                CompanyInfo s = new CompanyInfo();
                s.CompanyID = strCompanyid;
                s.CompanyName = dtCompanyInfo.Rows[j]["CompanyName"].ToString();
                s.IndustryName = strIndustryS[j];
                ListCompanyRow.Add(s);
            }

            rptCompanyInfo.DataSource = ListCompanyRow;
            rptCompanyInfo.DataBind();
            rptCompanyInfo.Visible = true;

            if (dtCompanyInfo.Rows.Count < 7)
            {
                pgParent = (CareerCruisingWeb.PageBase.SuperBase)this.Page;
                pgParent.IsLongPage = false;
            }
        }
        else
        {
            lblNoResultsFound.Text = ((CareerCruisingWeb.PageBase.SuperBase)Page).TextCode(5692);
            lblNoResultsFound.Visible = true;
            if (PageT.ToUpper() == "KW")
            {
                // insert keyword into freetext keyword search log
                string strSQL = "INSERT INTO KeywordSearchLog (Keyword,Section,Country) VALUES ('" + KeywordS + "','Company search','" + strCountry + "')";
                int rowsUpdated = CareerCruisingWeb.CCLib.Common.DataAccess.ExecuteNonQuery(strSQL);
            }
            rptCompanyInfo.Visible = false;

            pgParent = (CareerCruisingWeb.PageBase.SuperBase)this.Page;
            pgParent.IsLongPage = false;
        }
    }
        /// <summary>
        /// Function to Get the Current Date
        /// </summary>
        public void CurrentDate()
        {
            try
            {
                CompanyInfo infoComapany = new CompanyInfo();
                //CompanySP spCompany = new CompanySP();
                CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
                FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
                FinancialYearBll bllFinancialYear = new FinancialYearBll();

                infoComapany = bllCompanyCreation.CompanyView(1);
                PublicVariables._dtCurrentDate = infoComapany.CurrentDate;
                infoFinancialYear = bllFinancialYear.FinancialYearView(1);
                PublicVariables._dtFromDate = infoFinancialYear.FromDate;
                PublicVariables._dtToDate = infoFinancialYear.ToDate;

            }
            catch (Exception ex)
            {
                MessageBox.Show("SELCMPNY :2 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #19
0
        public bool isValid(CompanyInfo obj)
        {
            bool isValid = !obj.Errors.Any();

            return(isValid);
        }
예제 #20
0
            public static CompanyInfo SearchCompany(int tradeId, int industryId, FilterType filterType, string keyword, int pageIndex, int pageSize)
            {
                CompanyInfo currentData = new CompanyInfo();

                //if (!string.IsNullOrEmpty(keyword))
                //{
                //    keyword = keyword.Replace("'", "");
                //}
                //else
                //{
                //    keyword = "";
                //}

                //CompanyHelper_Update company = new CompanyHelper_Update();
                //currentData.RecordCount = company.Select_Count_TradeCenter(keyword, industryId, tradeId, (int)filterType);
                //currentData.PageIndex = pageIndex;
                //if (currentData.RecordCount > 1)
                //{
                //    currentData.PageCount = ((int)(currentData.RecordCount - 1) / pageSize) + 1;
                //}
                //else
                //{
                //    currentData.PageCount = 1;
                //}

                //if (pageIndex <= 0)
                //{
                //    currentData.PageIndex = 1;
                //}
                //else
                //{
                //    if (pageIndex > currentData.PageCount)
                //    {
                //        currentData.PageIndex = currentData.PageCount;
                //    }
                //    else
                //    {
                //        currentData.PageIndex = pageIndex;
                //    }
                //}

                //using (DataTable dtCompanies = company.GetTradeCenter(tradeId, keyword, industryId, currentData.PageIndex, pageSize, (int)filterType))
                //{
                //    List<CompanyInfoItem> items = new List<CompanyInfoItem>();
                //    if (dtCompanies != null)
                //    {
                //        using (DataTable dtCompaniesIncludePrice = GetOnlineInfo(dtCompanies))
                //        {
                //            for (int i = 0; i < dtCompaniesIncludePrice.Rows.Count; i++)
                //            {
                //                items.Add(new CompanyInfoItem(dtCompaniesIncludePrice.Rows[i]["StockSymbol"].ToString(),
                //                                                dtCompaniesIncludePrice.Rows[i]["Fullname"].ToString(),
                //                                                dtCompaniesIncludePrice.Rows[i]["Symbol"].ToString(),
                //                                                Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["CurrentPrice"]),
                //                                                Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["PE"]),
                //                                                Lib.Object2Double(dtCompaniesIncludePrice.Rows[i]["EPS"])
                //                                                ));
                //            }
                //        }
                //    }
                //    currentData.CompanyInfos = items.ToArray();
                //}
                //return currentData;
                var items = new List<CompanyInfoItem>();
                var key = tradeId > 0 ? string.Format(RedisKey.KeyStockListByCenter, tradeId) : RedisKey.KeyStockList;

                var sds = BLFACTORY.RedisClient.Get<List<StockCompact>>(key);
                sds = sds.FindAll(s => s.Symbol.Contains(keyword) && (industryId == -1||s.CategoryId==industryId));
                if(filterType==FilterType.StockSymbol)
                {
                    currentData.RecordCount = sds.Count;
                    //Neu loc theo chu cai
                    sds = sds.GetPaging(pageIndex, pageSize);
                    
                }
                var ss = new List<string>();
                Dictionary<string, StockCompactInfo> infos;
                if (filterType == FilterType.NoFilter && !string.IsNullOrEmpty(keyword))
                {
                    foreach (var sym in sds)
                    {
                        ss.Add(sym.Symbol);
                    }
                    infos = StockBL.GetStockCompactInfoMultiple(ss);
                    foreach (var info in infos)
                    {
                        if (info.Value == null) continue;
                        var sym = info.Value.Symbol;
                        //ss.Remove(info.Value.Symbol);
                        var index = sds.FindIndex(s=>s.Symbol==sym);
                        if(index >0) sds.RemoveAt(index);
                    }
                    currentData.RecordCount = sds.Count;
                    sds = sds.GetPaging(pageIndex, pageSize);
                    
                }
                if (sds.Count > pageSize)
                {
                    currentData.RecordCount = sds.Count;
                    sds = sds.GetPaging(pageIndex, pageSize);
                }
                ss = new List<string>();
                foreach (var sym in sds)
                {
                    ss.Add(sym.Symbol);
                }
                infos = StockBL.GetStockCompactInfoMultiple(ss);
                var prices = StockBL.GetStockPriceMultiple(ss);
                foreach (var sym in sds)
                {
                    var item = new CompanyInfoItem {Symbol = sym.Symbol, TradeCenter = Utils.GetCenterName(sym.TradeCenterId.ToString()), Price = 0, CompanyName = ""};
                    if (prices.ContainsKey(sym.Symbol))
                    {
                        var price = prices[sym.Symbol];
                        if (price != null)
                        {
                            item.Price = price.Price;
                        }
                    }
                    if (infos.ContainsKey(sym.Symbol))
                    {
                        var info = infos[sym.Symbol];
                        if (info != null)
                        {
                            item.CompanyName = info.CompanyName;
                            item.EPS = Math.Round(info.EPS,2);
                            item.PE = (info.EPS == 0) ? 0 : Math.Round(item.Price / info.EPS, 2);
                        }
                    }
                    if(string.IsNullOrEmpty(item.CompanyName)) continue;
                    items.Add(item);
                }
                
                currentData.PageIndex = pageIndex;
                currentData.PageCount = (int)Math.Ceiling((double)currentData.RecordCount / pageSize);
                currentData.CompanyInfos = items.ToArray();
                return currentData;
            }
예제 #21
0
        protected string GetNickName()
        {
            CompanyInfo comp = StaticCacheManager.GetConfig <CompanyInfo>();

            return(comp.NickName);
        }
예제 #22
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            base.NeedLogin = true;
            base.ReturnUrl = Request.RawUrl;
            if (base.IsPost && base.UserID != -1)
            {
                string text    = WebUtils.GetFormString("_action", "add").ToLower();
                int    formInt = WebUtils.GetFormInt("_idcom");

                CompanyInfo com = new CompanyInfo();
                if (text.Equals("modify"))
                {
                    com = Company.GetDataById(formInt);
                }
                com.Name    = WebUtils.GetFormString("name");
                com.Address = WebUtils.GetFormString("address");
                com.Phone   = WebUtils.GetFormString("phone");
                if (text == "del")
                {
                    if (Company.Delete(formInt))
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_DeleteFail"));
                    }
                }
                else if (string.IsNullOrEmpty(com.Name))
                {
                    base.WriteJsonTip(base.GetCaption("Comp_NameNotEmpty"));
                }
                else if (string.IsNullOrEmpty(com.Address))
                {
                    base.WriteJsonTip(base.GetCaption("Comp_AddressNotEmpty"));
                }
                else if (string.IsNullOrEmpty(com.Phone))
                {
                    base.WriteJsonTip(base.GetCaption("Comp_PhoneNotEmpty"));
                }
                else if (text == "modify")
                {
                    if (Company.Update(com))
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_UpdateFail"));
                    }
                }
                else
                {
                    com.AutoTimeStamp = System.DateTime.Now;
                    int num = Company.Add(com);
                    if (num > 0)
                    {
                        base.WriteJsonTip(true, base.GetCaption("Comp_Success"));
                    }
                    else
                    {
                        base.WriteJsonTip(base.GetCaption("Comp_AddFail"));
                    }
                }
            }


            else
            {
                int pageSize = 15;

                StringBuilder builderCondition = new StringBuilder(" 1=1 ");

                string strSort = " AutoID desc ";

                StringBuilder builderUrlPattern = new StringBuilder(base.ResolveUrl("~/List_Company.aspx"));
                builderUrlPattern.Append("?");
                builderUrlPattern.Append("&page=$page");

                CMSPager pager = contents.GetPager(BLL.Company.GetCount(builderCondition.ToString()), intCurrentPage, pageSize, builderUrlPattern.ToString());
                base.Put("pager", pager);
                IList <CompanyInfo> company = BLL.Company.GetPagerList(builderCondition.ToString(), strSort, pager.PageIndex, pager.PageSize, ref intTotalCount, ref intTotalPage);
                base.Put("com", company);
                base.UsingClient("temp/content_company.html");
            }
        }
예제 #23
0
        private void Estadisticas_BT_Click(object sender, EventArgs e)
        {
            if (EntityInfo.FechaEmision.Date > DateTime.Today.Date)
            {
                MessageBox.Show(Resources.Messages.EXAMEN_NO_EMITIDO);
                return;
            }

            if (!EntityInfo.Desarrollo)
            {
                EstadisticaExamenList estadisticas = EstadisticaExamenList.GetList(Entity);
                ShowChartAction(estadisticas);

                ExamenReportMng reportMng = new ExamenReportMng(AppContext.ActiveSchema);

                EstadisticaExamenRpt rpt = reportMng.GetEstadisticaReport(EntityInfo, estadisticas, CompanyInfo.Get(AppContext.ActiveSchema.Oid, false));

                ReportViewer.SetReport(rpt);
                ReportViewer.ShowDialog();
            }
        }
예제 #24
0
        protected void HtmlOut()
        {
            startDate            = Convert.ToDateTime(RequestHelper.GetQueryString <string>("SearchStartDate"));
            endDate              = Convert.ToDateTime(RequestHelper.GetQueryString <string>("SearchEndDate")).AddDays(1);
            SearchStartDate.Text = startDate.ToString("d");
            SearchEndDate.Text   = endDate.AddDays(-1).ToShortDateString();
            int           WeekNum = 0, ColNum = 14;
            int           PeoperNum = 0;
            StringBuilder TextOut   = new StringBuilder();
            CompanyInfo   company   = CompanyBLL.ReadCompany(companyID);

            companyName = company.CompanyName;
            //string CompanyBrandId = company.BrandId;
            bool isGroupCompany = base.IsGroupCompany(company.GroupId);

            if (isGroupCompany)
            {
                ColNum = 15;
            }

            string rowspan = string.Empty;

            TextOut.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
            TextOut.Append("<thead>");
            TextOut.Append("<tr class=\"listTableHead\">");

            //循环开始日期
            DateTime loopStartDate = startDate;

            if (SelectMonth == "Other")
            {
                //目前只要一周的数据
                loopStartDate = endDate.AddDays(-7);
                WeekNum       = (endDate - loopStartDate).Days / 7;
                if ((endDate - loopStartDate).Days % 7 > 0)
                {
                    WeekNum = WeekNum + 1;
                }
                TextOut.Append("<th colspan=\"" + (ColNum + WeekNum) + "\">" + company.CompanySimpleName);//+ " [" + loopStartDate.ToString("d") + "—" + EndDate.AddDays(-1).ToString("d") + "]"
                rowspan = " rowspan=\"2\"";
            }
            TextOut.Append("</th></tr>\r\n");
            TextOut.Append("<tr class=\"listTableHead\">\r\n");
            TextOut.Append("<th" + rowspan + ">序号</th>");
            if (isGroupCompany)
            {
                TextOut.Append("<td" + rowspan + ">公司名</th>");
            }
            TextOut.Append("<th" + rowspan + " data-sort=\"string\">姓名</th>");
            TextOut.Append("<th" + rowspan + " data-sort=\"string\">工作岗位</th>");
            TextOut.Append("<th" + rowspan + " data-sort=\"string\">学习岗位</th>");
            TextOut.Append("<th" + rowspan + " data-sort=\"string\">状态</th>");
            TextOut.Append("<th" + rowspan + ">初考时间</th>");
            TextOut.Append("<th" + rowspan + ">岗位课程数</th>");
            TextOut.Append("<th" + rowspan + " data-sort=\"int\">岗位课程<br>完成总数</th>");
            TextOut.Append("<th" + rowspan + " data-sort=\"int\">岗位剩余<br>课程总数</th>");
            TextOut.Append("<th" + rowspan + " data-sort=\"int\">学习完成率</th>");
            TextOut.Append("<th" + rowspan + ">所有已过岗位</th>");
            TextOut.Append("<th" + rowspan + " data-sort=\"int\">已过岗位数量<i class=\"icon_arrow\"></i></th>");
            TextOut.Append("<th" + rowspan + ">岗位已学习<br>考试未通过</th>");
            TextOut.Append("<th" + rowspan + ">已通过数量</th>");
            if (SelectMonth == "Other")
            {
                TextOut.Append("<th colspan=\"" + WeekNum.ToString() + "\">学习已通过</th></tr>\r\n");
                TextOut.Append("<tr class=\"listTableHead\">\r\n");
                for (int j = 1; j <= WeekNum; j++)
                {
                    TextOut.Append("<th>第" + j.ToString() + "周<br>" + loopStartDate.AddDays(7 * (j - 1)).ToString("M-d") + "—");
                    if (j == WeekNum)
                    {
                        TextOut.Append(endDate.AddDays(-1).ToString("M-d") + "</th>");
                    }
                    else
                    {
                        TextOut.Append(loopStartDate.AddDays((7 * j) - 1).ToString("M-d") + "</th>");
                    }
                }
                TextOut.Append("</tr>\r\n");
            }
            TextOut.Append("</thead>");
            TextOut.Append("<tbody>");

            UserSearchInfo user = new UserSearchInfo();

            user.InStatus        = state;
            user.InGroupID       = groupID;
            user.InWorkingPostID = postIdCondition;
            user.InStudyPostID   = studyPostIdCondition; //只显示该学习岗位下的人员
            if (isGroupCompany)
            {
                user.InCompanyID = CompanyBLL.ReadCompanyIdList(companyID.ToString());
                //user.StudyPostIdCondition = "45";//集团打开默认显示学习岗位
            }
            else
            {
                user.InCompanyID = companyID.ToString();
            }
            if (rzDate == 1)
            {
                if (rz == 0)
                {
                    user.Condition = "[id] not in (select [userid] from [_passpost] where [CreateDate]<='" + endDate + "' and [isrz]=1 and [_passpost].[postid] in (select [postid] from [_post]))";
                }
                else if (rz == 1)
                {
                    user.Condition = "[id] in (select [userid] from [_passpost] where [CreateDate]<='" + endDate + "' and [isrz]=1 and [_passpost].[postid] in (select [postid] from [_post]))";
                }
            }
            else if (rzDate == 0)
            {
                if (rz == 0)
                {
                    user.Condition = "[id] not in (select [userid] from [_passpost] where [CreateDate]>='" + startDate + "' And [CreateDate]<='" + endDate + "' and [isrz]=1 and [_passpost].[postid] in (select [postid] from [_post]))";
                }
                else if (rz == 1)
                {
                    user.Condition = "[id] in (select [userid] from [_passpost] where [CreateDate]>='" + startDate + "' And [CreateDate]<='" + endDate + "' and [isrz]=1 and [_passpost].[postid] in (select [postid] from [_post]))";
                }
            }
            //user.Condition = string.IsNullOrEmpty(user.Condition) ? "Order by [CompanyID] Desc" : user.Condition + " Order by [CompanyID] Desc";
            //user.PostIdCondition = PostIdStr;
            List <UserInfo> userList = UserBLL.SearchReportUserList(user);//UserBLL.SearchUserList(user);

            //把公司所有员工的第一次考试记录都一起调起
            List <TestPaperReportInfo> userFirstTestRecordList = TestPaperBLL.ReadTheFirstRecordList(user.InCompanyID);

            //把公司所有员工的考试记录都一起调起
            TestPaperInfo TestPaperModel = new TestPaperInfo();

            //if (!string.IsNullOrEmpty(company.PostStartDate.ToString()))
            //    TestPaperModel.TestMinDate = Convert.ToDateTime(company.PostStartDate);
            TestPaperModel.TestMaxDate        = endDate;
            TestPaperModel.CompanyIdCondition = user.InCompanyID;
            //TestPaperModel.Field = "UserID";
            TestPaperModel.Condition = "[UserID] in (select [ID] from [_User] where [CompanyID] in (" + user.InCompanyID + ")";
            if (!string.IsNullOrEmpty(groupID))
            {
                TestPaperModel.Condition += " and [GroupID] in (" + groupID + ")";
            }
            if (!string.IsNullOrEmpty(postIdCondition))
            {
                TestPaperModel.Condition += " and [WorkingPostID] in (" + postIdCondition + ")";
            }
            if (!string.IsNullOrEmpty(studyPostIdCondition))
            {
                TestPaperModel.Condition += " and [StudyPostId] in (" + studyPostIdCondition + ")";
            }
            if (!string.IsNullOrEmpty(state))
            {
                TestPaperModel.Condition += " and [Status] in (" + state + ")";
            }
            TestPaperModel.Condition += ")";
            List <TestPaperInfo> TestPaperList = TestPaperBLL.NewReadList(TestPaperModel);

            foreach (UserInfo Info in userList)
            {
                int PostId = int.MinValue;
                PostId = Info.StudyPostID;
                PostInfo PostModel = PostBLL.ReadPost(Info.StudyPostID);
                if (PostModel != null) //排除掉没有设置岗位的人
                {
                    //string PassCateId = TestPaperBLL.ReadListStr(Info.ID, endDate, 1);
                    //string NoPassCateId = TestPaperBLL.ReadListStr(Info.ID, endDate, 0);
                    //筛选出当前用户ID的成绩列表
                    List <TestPaperInfo> currentUserPaperList       = TestPaperList.FindAll(delegate(TestPaperInfo TempModel) { return(TempModel.UserId == Info.ID); });
                    List <TestPaperInfo> currentUserPassPaperList   = currentUserPaperList.FindAll(delegate(TestPaperInfo TempModel) { return(TempModel.IsPass == 1); });
                    List <TestPaperInfo> currentUserNoPassPaperList = currentUserPaperList.FindAll(delegate(TestPaperInfo TempModel) { return(TempModel.IsPass == 0); });
                    string PassCateId   = TestPaperBLL.ReadCourseIDStr(currentUserPassPaperList);
                    string NoPassCateId = TestPaperBLL.ReadCourseIDStr(currentUserNoPassPaperList);

                    //从未通过的记录中去除后期又补考通过的记录
                    NoPassCateId = StringHelper.SubString(NoPassCateId, PassCateId);
                    int PostCourseNum   = 0;
                    int PassCourseNum   = 0;
                    int NoPassCourseNum = 0;

                    //岗位下所有已过级别的岗位课程
                    //if (isGroupCompany)
                    //    CompanyBrandId = CompanyBLL.ReadCompany(Info.CompanyID).BrandId;
                    string AllPostPlan = PostBLL.ReadPostCourseID(Info.CompanyID, Info.StudyPostID);//PostBLL.ReadPostCourseID(Info.StudyPostID, CompanyBrandId);

                    if (string.IsNullOrEmpty(AllPostPlan))
                    {
                        PostCourseNum = 0;
                    }
                    else
                    {
                        PostCourseNum = AllPostPlan.Split(',').Length;
                    }
                    string PassPostCateId   = StringHelper.EqualString(PassCateId, AllPostPlan);
                    string NoPassPostCateId = StringHelper.EqualString(AllPostPlan, NoPassCateId);
                    if (string.IsNullOrEmpty(PassPostCateId))
                    {
                        PassCourseNum = 0;
                    }
                    else
                    {
                        PassCourseNum = PassPostCateId.Split(',').Length;
                    }

                    //选取时间段内
                    if (rzDate == 0)
                    {
                        //时间段内的学习中的岗位课程补丁,去掉即为到截止时间所有的学习中的岗位课程
                        if (SelectMonth == "Other")
                        {
                            NoPassPostCateId = StringHelper.EqualString(NoPassPostCateId, TestPaperBLL.ReadCourseIDStr(currentUserNoPassPaperList.FindAll(delegate(TestPaperInfo TempModel) { return(TempModel.TestDate >= startDate && TempModel.TestDate <= endDate); })));
                        }
                        //补丁结束
                    }

                    if (string.IsNullOrEmpty(NoPassPostCateId))
                    {
                        NoPassCourseNum = 0;
                    }
                    else
                    {
                        NoPassCourseNum = NoPassPostCateId.Split(',').Length;
                    }

                    //如果公司ID不同,再次获取公司信息,减少重复操作
                    if (Info.CompanyID != company.CompanyId)
                    {
                        company = CompanyBLL.ReadCompany(Info.CompanyID);
                    }
                    string PastPassCourse = string.Empty;
                    PeoperNum = PeoperNum + 1;
                    TextOut.Append("<tr class=\"listTableMain\">\r\n");
                    TextOut.Append("<td>" + PeoperNum + "</td>");
                    if (isGroupCompany)
                    {
                        TextOut.Append("<td>" + company.CompanySimpleName + "</td>");
                    }
                    TextOut.Append("<td>" + Info.RealName + "</td>");
                    if (!string.IsNullOrEmpty(Info.PostName))
                    {
                        TextOut.Append("<td>" + Info.PostName + "</td>");
                    }
                    else
                    {
                        TextOut.Append("<td>" + PostBLL.ReadPost(Info.WorkingPostID).PostName + "</td>");
                    }
                    TextOut.Append("<td>" + PostModel.PostName + "</td>");
                    TextOut.Append("<td>" + EnumHelper.ReadEnumChineseName <UserState>(Info.Status) + "</td>");
                    //DateTime firstTestDate = TestPaperBLL.ReadTheOldTestPaperInfo(Info.ID).TestDate;
                    TestPaperReportInfo currentUserFirstTestRecord = userFirstTestRecordList.Find(delegate(TestPaperReportInfo tempModel) { return(tempModel.UserID == Info.ID); });
                    if (currentUserFirstTestRecord != null)
                    {
                        TextOut.Append("<td>" + currentUserFirstTestRecord.TestDate.ToString("d") + "</td>");
                    }
                    else
                    {
                        TextOut.Append("<td>&nbsp;</td>");
                    }
                    TextOut.Append("<td>" + PostCourseNum.ToString() + "</td>");
                    TextOut.Append("<td>" + PassCourseNum.ToString() + "</td>");
                    TextOut.Append("<td>" + (PostCourseNum - PassCourseNum) + "</td>");
                    if (PostCourseNum > 0)
                    {
                        TextOut.Append("<td>" + (Math.Round((double)PassCourseNum / PostCourseNum, 4) * 100) + "%</td>");
                    }
                    else
                    {
                        TextOut.Append("<td>0</td>");
                    }
                    int passPostNum = 0;
                    if (rzDate == 1)
                    {
                        TextOut.Append("<td>" + PostPassBLL.ReadPassPostName(Info.ID, endDate, ref passPostNum) + "</td>");
                    }
                    else
                    {
                        TextOut.Append("<td>" + PostPassBLL.ReadPassPostName(Info.ID, startDate, endDate, ref passPostNum) + "</td>");
                    }
                    TextOut.Append("<td>" + passPostNum + "</td>");
                    TextOut.Append("<td>" + (NoPassCourseNum) + "</td>");
                    if (rzDate == 0)
                    {
                        List <TestPaperInfo> tempList = currentUserPassPaperList.FindAll(m => m.TestDate >= startDate && m.TestDate <= endDate);
                        if (tempList.Count > 0)
                        {
                            TextOut.Append("<td>" + TestPaperBLL.ReadCourseIDStr(tempList).Split(',').Length + "</td>");
                        }
                        else
                        {
                            TextOut.Append("<td>0</td>");
                        }
                    }
                    else
                    {
                        TextOut.Append("<td>" + (string.IsNullOrEmpty(PassCateId) ? 0 : PassCateId.Split(',').Length) + "</td>");
                    }
                    if (SelectMonth == "Other")
                    {
                        for (int j = 1; j <= WeekNum; j++)
                        {
                            if (j == WeekNum)
                            {
                                PastPassCourse = StringHelper.EqualString(AllPostPlan, TestPaperBLL.ReadCourseIDStr(currentUserPassPaperList.FindAll(delegate(TestPaperInfo TempModel) { return(TempModel.TestDate >= loopStartDate.AddDays(7 * (j - 1)) && TempModel.TestDate <= endDate); }))); //TestPaperBLL.ReadListStr(Info.ID, loopStartDate.AddDays(7 * (j - 1)), endDate, 1)
                            }
                            else
                            {
                                PastPassCourse = StringHelper.EqualString(AllPostPlan, TestPaperBLL.ReadCourseIDStr(currentUserPassPaperList.FindAll(delegate(TestPaperInfo TempModel) { return(TempModel.TestDate >= loopStartDate.AddDays(7 * (j - 1)) && TempModel.TestDate <= loopStartDate.AddDays(7 * j)); }))); //TestPaperBLL.ReadListStr(Info.ID, loopStartDate.AddDays(7 * (j - 1)), loopStartDate.AddDays(7 * j), 1)
                            }
                            int PastPassCourseNum = 0;
                            if (!string.IsNullOrEmpty(PastPassCourse))
                            {
                                PastPassCourseNum = PastPassCourse.Split(',').Length;
                            }
                            TextOut.Append("<td>" + (PastPassCourseNum) + "</td>");
                        }
                    }
                    else
                    {
                        //计算到上个时间学过的课程数
                        //算法(到现在所有通过的课程-到上个时间点所有完成的课程=时间段内新增课程)
                        //时间段内新增课程与岗位计划相同的部分=时间段内新增课程
                        PastPassCourse = StringHelper.EqualString(AllPostPlan, StringHelper.SubString(PassCateId, TestPaperBLL.ReadCourseIDStr(currentUserPassPaperList.FindAll(delegate(TestPaperInfo TempModel) { return(TempModel.TestDate <= startDate); })))); //TestPaperBLL.ReadListStr(Info.ID, startDate, 1)
                        int PastPassCourseNum = 0;
                        if (!string.IsNullOrEmpty(PastPassCourse))
                        {
                            PastPassCourseNum = PastPassCourse.Split(',').Length;
                        }
                        TextOut.Append("<td>" + (PastPassCourseNum) + "</td>");
                    }
                    TextOut.Append("</tr>\r\n");
                }
            }
            TextOut.Append("</tbody>");
            TextOut.Append("</table>");
            this.ReportList.InnerHtml = TextOut.ToString();
        }
 /// <summary>
 /// Function for Save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         CompanyInfo infoCompany = new CompanyInfo();
         CompanyCreationBll BllCompanyCreation = new CompanyCreationBll();
         CompanyPathInfo infoCompanyPath = new CompanyPathInfo();
         CompanyPathBll BllCompanyPath = new CompanyPathBll();
         UserInfo infoUser = new UserInfo();
         UserBll bllUser = new UserBll();
         ExchangeRateInfo infoExchangeRate = new ExchangeRateInfo();
         //ExchangeRateBll BllExchangeRate = new ExchangeRateBll();
         infoCompany.CompanyName = txtCompanyName.Text.Trim();
         infoCompany.MailingName = txtMailingName.Text.Trim();
         infoCompany.Address = txtAddress.Text.Trim();
         infoCompany.Phone = txtPhoneNo.Text.Trim();
         infoCompany.Mobile = txtMobile.Text.Trim();
         infoCompany.EmailId = txtEmail.Text.Trim();
         infoCompany.Web = txtWeb.Text.Trim();
         infoCompany.Country = txtCountry.Text.Trim();
         infoCompany.State = txtState.Text.Trim();
         infoCompany.Pin = txtPincode.Text.Trim();
         infoCompany.CurrencyId = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString());
         decCurrencyIdForStatus = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString());
         infoCompany.FinancialYearFrom = Convert.ToDateTime(txtFinancialYearFrom.Text.Trim().ToString());
         infoCompany.BooksBeginingFrom = Convert.ToDateTime(txtBooksBegining.Text.Trim().ToString());
         infoCompany.Tin = txtTinNo.Text.Trim();
         infoCompany.Cst = txtCstNo.Text.Trim();
         infoCompany.Pan = txtPanNo.Text.Trim();
         infoCompany.CurrentDate = DateTime.Now;
         infoCompany.Logo = logo;
         infoCompany.Extra1 = string.Empty;
         infoCompany.Extra2 = string.Empty;
         infoCompanyPath.CompanyName = txtCompanyName.Text.Trim();
         infoCompanyPath.IsDefault = cbxSetAsDefault.Checked;
         infoCompanyPath.Extra1 = string.Empty;
         infoCompanyPath.Extra2 = string.Empty;
         infoUser.UserName = txtAdminUserName.Text.Trim();
         infoUser.Password = txtPassword.Text.Trim();
         infoUser.Active = true;
         infoUser.Extra1 = string.Empty;
         infoUser.Extra2 = string.Empty;
         infoUser.Narration = string.Empty;
         infoUser.RoleId = 1;
         if (BllCompanyCreation.CompanyCheckExistence(txtCompanyName.Text.Trim().ToString(), 0) == false)
         {
             decimal decCompanyId = BllCompanyCreation.CompanyAddParticularFeilds(infoCompany);
             PublicVariables._decCurrentCompanyId = decCompanyId;
             infoCompanyPath.CompanyPath = Application.StartupPath + "\\Data\\" + PublicVariables._decCurrentCompanyId;
             BllCompanyPath.CompanyPathAdd(infoCompanyPath);
             if (formMDI.demoProject || CreateCompany())
             {
                 if (!formMDI.demoProject)
                 {
                     infoCompanyPath.CompanyPath = strPath;
                 }
                 else
                 {
                     infoCompanyPath.CompanyPath = Application.StartupPath + "\\Data";
                     PublicVariables._decCurrentCompanyId = 0;
                 }
                 CompanyInfo infoNewCompany = new CompanyInfo();
                 CompanyPathInfo infoNewCompanyPath = new CompanyPathInfo();
                 UserInfo infoNewUser = new UserInfo();
                 UserBll bllNewUser = new UserBll();
                 ExchangeRateInfo infoNewExchangeRate = new ExchangeRateInfo();
                 ExchangeRateBll BllExchangeRate = new ExchangeRateBll();
                 CompanyPathBll BllNewCompanyPath = new CompanyPathBll();
                 infoNewCompany = infoCompany;
                 infoNewCompanyPath = infoCompanyPath;
                 infoNewUser = infoUser;
                 decCompanyId = BllCompanyCreation.CompanyAddParticularFeilds(infoNewCompany);
                 bllNewUser.UserAdd(infoNewUser);
                 BllNewCompanyPath.CompanyPathAdd(infoNewCompanyPath);
                 Messages.SavedMessage();
                 formMDI.MDIObj.MenuStripEnabling();
                 //  To set default currencyId.............//
                 infoNewExchangeRate.CurrencyId = infoNewCompany.CurrencyId;
                 infoNewExchangeRate.Rate = 1;
                 infoNewExchangeRate.Narration = string.Empty;
                 infoNewExchangeRate.Extra1 = string.Empty;
                 infoNewExchangeRate.Extra2 = string.Empty;
                 infoNewExchangeRate.ExtraDate = System.DateTime.Now;
                 infoNewExchangeRate.Date = System.DateTime.Now;
                 BllExchangeRate.ExchangeRateAdd(infoNewExchangeRate);
                 CurrencyBll BllCurrency = new CurrencyBll();
                 BllCurrency.DefaultCurrencySet(decCurrencyIdForStatus);
                 AfterCompanyCreation();
                 Clear();
                 this.Close();
             }
             else
             {
                 Messages.InformationMessage("Company creation failed");
             }
         }
         else
         {
             Messages.InformationMessage("Companyname already exist");
             txtCompanyName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CR1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #26
0
        private async void TxtCVR_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
        {
            var s = sender as TextEditor;

            if (s != null && s.IsLoaded)
            {
                var cvr = s.Text;
                if (cvr == null || cvr.Length < 5)
                {
                    return;
                }

                var allIsLetter = cvr?.All(x => char.IsLetter(x));

                if (allIsLetter.HasValue && allIsLetter.Value == true)
                {
                    return;
                }

                CompanyInfo ci = null;
                try
                {
#if !SILVERLIGHT
                    ci = await CVR.CheckCountry(cvr, editrow.Country);
#else
                    var lookupApi = new Uniconta.API.System.UtilityAPI(api);
                    ci = await lookupApi.LookupCVR(cvr, editrow.Country);
#endif
                }
                catch (Exception ex)
                {
                    UnicontaMessageBox.Show(ex);
                    return;
                }

                if (!onlyRunOnce)
                {
                    if (ci == null)
                    {
                        return;
                    }

                    if (!string.IsNullOrWhiteSpace(ci?.life?.name))
                    {
                        var address = ci.address;
                        if (address != null)
                        {
                            onlyRunOnce = true;
                            if (editrow._Address1 == null)
                            {
                                editrow.Address1 = address.CompleteStreet;
                                editrow.Address2 = address.ZipCity;
                                editrow.Country  = address.Country;
                            }
                            else
                            {
                                var result = UnicontaMessageBox.Show(Uniconta.ClientTools.Localization.lookup("UpdateAddress"), Uniconta.ClientTools.Localization.lookup("Information"), UnicontaMessageBox.YesNo);
                                if (result != UnicontaMessageBox.Yes)
                                {
                                    return;
                                }
                                {
                                    editrow.Address1 = address.CompleteStreet;
                                    editrow.Address2 = address.ZipCity;
                                    editrow.Country  = address.Country;
                                }
                            }
                        }

                        if (string.IsNullOrWhiteSpace(editrow._Name))
                        {
                            editrow._Name = ci.life.name;
                        }
                        if (!string.IsNullOrEmpty(ci.contact?.phone))
                        {
                            editrow.Phone = ci.contact.phone;
                        }
                        if (!string.IsNullOrEmpty(ci.contact?.www))
                        {
                            editrow.Www = ci.contact.www;
                        }
                    }
                }
                else
                {
                    onlyRunOnce = false;
                }
            }
        }
 /// <summary>
 /// To Display the company name in text box
 /// </summary>
 public void txtcompanynamefill()
 {
     try
     {
         //CompanySP spcompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         CompanyInfo infoCompany = new CompanyInfo();
         infoCompany = bllCompanyCreation.CompanyView(1);
         string strCompanyName = infoCompany.CompanyName;
         txtShowCompanyName.Text = strCompanyName;
         txtShowCompanyName.ReadOnly = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show("BS3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #28
0
 protected virtual bool GetCompanyId(CompanyInfo company, out string id)
 {
     id = null;
     return(false);
 }
예제 #29
0
 public override bool UpdateFromOnlineMusicTrackAlbumCompany(AlbumInfo albumInfo, CompanyInfo company, string language, bool cacheOnly)
 {
     if (!string.IsNullOrEmpty(company.MusicBrainzId))
     {
         return(true);
     }
     return(false);
 }
예제 #30
0
 protected virtual bool SetCompanyId(CompanyInfo company, string id)
 {
     return(false);
 }
 public override void StoreCompanyMatch(CompanyInfo company)
 {
 }
예제 #32
0
        protected override bool TryGetFanArtInfo(BaseInfo info, out TLang language, out string fanArtMediaType, out bool includeThumbnails)
        {
            language          = default(TLang);
            fanArtMediaType   = null;
            includeThumbnails = true;

            MovieInfo movieInfo = info as MovieInfo;

            if (movieInfo != null)
            {
                language          = FindBestMatchingLanguage(movieInfo.Languages);
                fanArtMediaType   = FanArtMediaTypes.Movie;
                includeThumbnails = false;
                return(true);
            }

            MovieCollectionInfo movieCollectionInfo = info as MovieCollectionInfo;

            if (movieCollectionInfo != null)
            {
                language        = FindBestMatchingLanguage(movieCollectionInfo.Languages);
                fanArtMediaType = FanArtMediaTypes.MovieCollection;
                return(true);
            }

            if (OnlyBasicFanArt)
            {
                return(false);
            }

            CompanyInfo companyInfo = info as CompanyInfo;

            if (companyInfo != null)
            {
                language        = FindMatchingLanguage(string.Empty);
                fanArtMediaType = FanArtMediaTypes.Company;
                return(true);
            }

            CharacterInfo characterInfo = info as CharacterInfo;

            if (characterInfo != null)
            {
                language        = FindMatchingLanguage(string.Empty);
                fanArtMediaType = FanArtMediaTypes.Character;
                return(true);
            }

            PersonInfo personInfo = info as PersonInfo;

            if (personInfo != null)
            {
                if (personInfo.Occupation == PersonAspect.OCCUPATION_ACTOR)
                {
                    fanArtMediaType = FanArtMediaTypes.Actor;
                }
                else if (personInfo.Occupation == PersonAspect.OCCUPATION_DIRECTOR)
                {
                    fanArtMediaType = FanArtMediaTypes.Director;
                }
                else if (personInfo.Occupation == PersonAspect.OCCUPATION_WRITER)
                {
                    fanArtMediaType = FanArtMediaTypes.Writer;
                }
                else
                {
                    return(false);
                }
                language = FindMatchingLanguage(string.Empty);
                return(true);
            }
            return(false);
        }
예제 #33
0
 public override void StoreMusicLabelMatch(CompanyInfo company)
 {
 }
예제 #34
0
        //private void MoveAttachment(String TransactionGUID, String Attachmnent)
        //{
        //    string ServerPath = Application.StartupPath + @"\TransientStorage";

        //    if (!Directory.Exists(ServerPath))
        //    {
        //        Directory.CreateDirectory(ServerPath);
        //    }

        //    if (Company_Info.CompanyCountryID != 0)
        //    {
        //        if (!Directory.Exists(ServerPath + "/" + Company_Info.CompanyCountryID))
        //        {
        //            Directory.CreateDirectory(ServerPath + "/" + Company_Info.CompanyCountryID);
        //        }
        //    }

        //    if (Company_Info.CompanyVAT != null)
        //    {
        //        if (!Directory.Exists(ServerPath + "/" + Company_Info.CompanyCountryID + "/" + Company_Info.CompanyVAT))
        //        {
        //            Directory.CreateDirectory(ServerPath + "/" + Company_Info.CompanyCountryID + "/" + Company_Info.CompanyVAT);
        //        }
        //    }

        //    String fileName = TransactionGUID + Path.GetExtension(Attachmnent);
        //    File.Move(Attachmnent, ServerPath + "/" + Company_Info.CompanyCountryID + "/" + Company_Info.CompanyVAT + "/" + fileName);
        //}

        public void ImportHakladaMokup(String filename, CompanyInfo _companyinfo, DBLayer _dblayer, char delimiter)
        {
            Company_Info = _companyinfo;
            dblayer      = _dblayer;
            FiledHolder filedHolder = new FiledHolder();

            filedHolder.InitINI();
            filedHolder.Company_Info = Company_Info;
            filedHolder.Add("CountryID");
            filedHolder.Add("CompanyVAT");
            filedHolder.Add("CompanyName");
            filedHolder.Add("ActionCode");
            filedHolder.Add("MisparMismach");
            filedHolder.Add("TarichMismach");
            filedHolder.Add("TarichAcher");
            filedHolder.Add("ActionDetails");
            filedHolder.Add("Maam");
            filedHolder.Add("SchumPaturMaam");
            filedHolder.Add("SchumMaam");
            filedHolder.Add("SchumKolelMaam");
            filedHolder.Add("Attachment");
            filedHolder.LoadData();

            StreamReader sr   = new StreamReader(filename, CheckEncoder()); //Encoding.GetEncoding("iso-8859-8") //Hebrew From Magic
            String       line = "";
            ArrayList    flds = filedHolder.GetFileds();

            //filedHolder.GetFiled("ActionCode")
            dblayer.Current_Company_Info = _companyinfo;

            //bool bSkipRow = false;

            while (!sr.EndOfStream)
            {
                line = sr.ReadLine();
                filedHolder.CurrentDataLine = line;

                ShuratHaklada shurat_haklada = new ShuratHaklada();

                String CompanyVAT  = filedHolder.GetFiledValue(filedHolder.GetFiledPosition("CompanyVAT"), delimiter);
                String CompanyName = filedHolder.GetFiledValue(filedHolder.GetFiledOrder("CompanyName"), delimiter);

                Company company = CompanyIdentification.Identify(dblayer, Company_Info, null, CompanyVAT, CompanyName, null);

                if (company != null)
                {
                    shurat_haklada.CompanyID = company.CompanyID;

                    shurat_haklada.ActionCode           = Convert.ToInt32(filedHolder.GetFiledValue("ActionCode"));
                    shurat_haklada.MisparMismach        = Convert.ToInt32(filedHolder.GetFiledValue("MisparMismach"));
                    shurat_haklada.TarichMismach        = Convert.ToDateTime(filedHolder.GetFiledValue("TarichMismach"));
                    shurat_haklada.TarichAcher          = Convert.ToDateTime(filedHolder.GetFiledValue("TarichAcher"));
                    shurat_haklada.ActionDetails        = filedHolder.GetFiledValue("ActionDetails");
                    shurat_haklada.AhuzHaMaam           = Convert.ToDouble(filedHolder.GetFiledValue("Maam"));
                    shurat_haklada.SchumPaturMaam       = Convert.ToDouble(filedHolder.GetFiledValue("SchumPaturMaam"));
                    shurat_haklada.SchumMaam            = Convert.ToDouble(filedHolder.GetFiledValue("SchumMaam"));
                    shurat_haklada.SchumKolelMaam       = Convert.ToDouble(filedHolder.GetFiledValue("SchumKolelMaam"));
                    shurat_haklada.Attachment           = filedHolder.GetFiledValue("Attachment");
                    shurat_haklada.CompamyInfoCountryID = Company_Info.CompanyCountryID;
                    shurat_haklada.CompamyInfoVAT       = Company_Info.CompanyVAT;
                    dblayer.AddHakladaRecord(shurat_haklada);
                }
            }

            sr.Close();
        }
예제 #35
0
 public bool ValidDeleteObject(CompanyInfo companyInfo, IBranchOfficeService _branchOfficeService)
 {
     companyInfo.Errors.Clear();
     //VDontHaveBranchOffices(companyInfo, _branchOfficeService);
     return(isValid(companyInfo));
 }
        public override void EmailPDFAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

            PgMng.Reset(10, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            SerieInfo serie = SerieInfo.Get(ActiveItem.OidSerie, false);

            PgMng.Grow();

            ClienteInfo client = ClienteInfo.Get(ActiveItem.OidCliente, false);

            PgMng.Grow();

            TransporterInfo transporter = TransporterInfo.Get(ActiveItem.OidTransportista, ETipoAcreedor.TransportistaDestino, false);

            PgMng.Grow();

            CompanyInfo company = CompanyInfo.Get(AppContext.ActiveSchema.Oid);

            PgMng.Grow();

            FormatConfFacturaAlbaranReport conf = new FormatConfFacturaAlbaranReport();

            conf.nota            = (client.OidImpuesto == 1) ? Library.Invoice.Resources.Messages.NOTA_EXENTO_IGIC : string.Empty;
            conf.nota           += Environment.NewLine + (ActiveItem.Nota ? serie.Cabecera : "");
            conf.cuenta_bancaria = ActiveItem.CuentaBancaria;
            PgMng.Grow();

            OutputInvoiceInfo item = OutputInvoiceInfo.Get(ActiveOID, true);

            PgMng.Grow();

            OutputInvoiceReportMng reportMng = new OutputInvoiceReportMng(AppContext.ActiveSchema, this.Text, this.FilterValues);
            ReportClass            report    = reportMng.GetDetailReport(item, serie, client, transporter, conf);

            PgMng.Grow();

            if (report != null)
            {
                ExportOptions options = new ExportOptions();
                DiskFileDestinationOptions diskFileDestinationOptions = new DiskFileDestinationOptions();

                string fileName = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                fileName += "\\" + ActiveItem.FileName;

                PgMng.Grow(String.Format(Face.Resources.Messages.EXPORTING_PDF, fileName), string.Empty);

                diskFileDestinationOptions.DiskFileName = fileName;
                options.ExportFormatType         = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
                options.ExportDestinationType    = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
                options.ExportDestinationOptions = diskFileDestinationOptions;

                PgMng.Grow();

                report.Export(options);

                PgMng.Grow(Face.Resources.Messages.SENDING_EMAIL);

                System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();

                mail.To.Add(new MailAddress(client.Email, client.Nombre));
                mail.From    = new MailAddress(SettingsMng.Instance.GetSMTPMail(), company.Name);
                mail.Body    = String.Format(Library.Invoice.Resources.Messages.FACTURA_EMAIL_ATTACHMENT_BODY, company.Name);
                mail.Subject = Library.Invoice.Resources.Messages.FACTURA_EMAIL_SUBJECT;
                mail.Attachments.Add(new Attachment(fileName));

                try
                {
                    PgMng.Grow(moleQule.Face.Resources.Messages.SENDING_EMAIL, string.Empty);

                    EMailClient.Instance.SmtpCliente.Send(mail);

                    if (item.EEstado == EEstado.Abierto)
                    {
                        ChangeStateAction(EEstadoItem.Emitido);
                    }

                    PgMng.ShowInfoException("Mensaje enviado con éxito");
                }
                catch (Exception ex)
                {
                    PgMng.ShowInfoException(ex.Message + Environment.NewLine + Environment.NewLine + moleQule.Library.Resources.Errors.SMTP_SETTINGS);
                }
                finally
                {
                    mail.Dispose();
                    PgMng.FillUp();
                }
            }
            else
            {
                PgMng.ShowInfoException(Face.Resources.Messages.NO_DATA_REPORTS);

                PgMng.FillUp();
            }
        }
예제 #37
0
파일: Company.cs 프로젝트: zzpgeorge/Wms
 public int Update(CompanyInfo model)
 {
     return(dal.Update(model));
 }
예제 #38
0
        private void GrowthVsIndustry()
        {
            try
            {
                string       strSQL      = "Select Industry From Companies Where Symbol ='" + Ticker + "'";
                MySqlCommand cmd         = new MySqlCommand(strSQL, Form1.sqlConn);
                object       industryOBJ = cmd.ExecuteScalar();

                strSQL = "Select Symbol, Name, Industry From Companies Where Industry ='" + (string)industryOBJ + "'";
                cmd    = new MySqlCommand(strSQL, Form1.sqlConn);
                MySqlDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    CompanyInfo info = new CompanyInfo();
                    info.Symbol = reader.GetString(0);
                    info.Name   = reader.GetString(1);

                    foreach (Form1.Industry industry in Enum.GetValues(typeof(Form1.Industry)))
                    {
                        if (industry.ToString() == reader.GetString(2))
                        {
                            info.Industry = industry;
                        }
                    }
                    CompanyInfoCollection.Add(info);
                }
                reader.Close();

                strSQL = "Select ";

                for (int x = 0; x < CompanyInfoCollection.Count - 2; x++)
                {
                    strSQL += CompanyInfoCollection[x].Symbol + ", ";
                }

                strSQL += CompanyInfoCollection[CompanyInfoCollection.Count - 1].Symbol + ", DateSubmitted From StockTable2019";
                cmd     = new MySqlCommand(strSQL, Form1.sqlConn);
                reader  = cmd.ExecuteReader();

                int index = 0;
                while (reader.Read())
                {
                    for (int y = 0; y < CompanyInfoCollection.Count - 1; y++)
                    {
                        DataPoint point = new DataPoint();
                        point.price = reader.GetDouble(y);
                        point.date  = reader.GetDateTime(CompanyInfoCollection.Count - 1);
                        if (CompanyInfoCollection[y].DataPointCollection.Count > 0)
                        {
                            point.PercentChanged = ((float)point.price / (float)CompanyInfoCollection[y].DataPointCollection[CompanyInfoCollection[y].DataPointCollection.Count - 1].price - 1) * 100;
                        }
                        CompanyInfoCollection[y].DataPointCollection.Add(point);
                        index++;
                    }
                }
                reader.Close();

                UpdateGrowthVsIndustryChart();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #39
0
        public override async Task <bool> UpdateFromOnlineMusicTrackAlbumCompanyAsync(AlbumInfo album, CompanyInfo company, string language, bool cacheOnly)
        {
            try
            {
                TrackLabel labelDetail = null;
                if (!string.IsNullOrEmpty(company.MusicBrainzId))
                {
                    labelDetail = await _musicBrainzHandler.GetLabelAsync(company.MusicBrainzId, cacheOnly).ConfigureAwait(false);
                }
                if (labelDetail == null)
                {
                    return(false);
                }
                if (labelDetail.Label == null)
                {
                    return(false);
                }

                company.MusicBrainzId = labelDetail.Label.Id;
                company.Name          = labelDetail.Label.Name;
                company.Type          = CompanyAspect.COMPANY_MUSIC_LABEL;
                if (!company.DataProviders.Contains(_name))
                {
                    company.DataProviders.Add(_name);
                }

                return(true);
            }
            catch (Exception ex)
            {
                ServiceRegistration.Get <ILogger>().Debug("MusicBrainzWrapper: Exception while processing company {0}", ex, company.ToString());
                return(false);
            }
        }
예제 #40
0
        public ActionResult InsertCompanyInfo()
        {
            var response    = new DBResponse();
            var companyInfo = new CompanyInfo();

            try
            {
                string filename = "";
                companyInfo.Id      = Convert.ToInt32(Request["Id"]);
                companyInfo.Name    = Convert.ToString(Request["Name"]);
                companyInfo.Contact = Convert.ToString(Request["Contact"]);
                companyInfo.Email   = Convert.ToString(Request["Email"]);
                companyInfo.Address = Convert.ToString(Request["Address"]);

                if (Request.Files.Count == 0)
                {
                    response.Id            = -1;
                    response.StatusCode    = "501";
                    response.StatusMessage = "Please Uplaod a file";
                }
                else
                {
                    for (int i = 0; i < Request.Files.Count; i++)
                    {
                        var file = Request.Files[i];
                        filename = companyInfo.Id + "_" + Path.GetFileName(Request.Files[i].FileName);
                        var TemporaryPath = Server.MapPath(uploadPath) + filename;
                        file.SaveAs(TemporaryPath);
                    }
                    companyInfo.LogoLocation = filename;

                    var job = _dalCompany.InsertCompany(companyInfo);

                    if (job.Any())
                    {
                        if (job.FirstOrDefault().Id > 0)
                        {
                            response.Id            = job.FirstOrDefault().Id;
                            response.StatusCode    = "200";
                            response.StatusMessage = "Success";
                        }
                        else
                        {
                            response.Id            = -1;
                            response.StatusCode    = "501";
                            response.StatusMessage = job.FirstOrDefault().StatusMessage;
                        }
                    }
                    else
                    {
                        response.StatusCode    = "404";
                        response.StatusMessage = "No available job";
                    }
                }
            }
            catch (Exception ex)
            {
                response.Id            = -1;
                response.StatusCode    = "500";
                response.StatusMessage = ex.Message.ToString();
            }
            var camelCaseFormatter = new JsonSerializerSettings();

            camelCaseFormatter.ContractResolver = new CamelCasePropertyNamesContractResolver();
            return(Json(JsonConvert.SerializeObject(response, camelCaseFormatter), JsonRequestBehavior.AllowGet));
        }
예제 #41
0
        public override async Task <bool> UpdateFromOnlineMusicTrackAlbumCompanyAsync(AlbumInfo album, CompanyInfo company, string language, bool cacheOnly)
        {
            try
            {
                AudioDbAlbum albumDetail = null;
                language = language ?? PreferredLanguage;

                if (album.AudioDbId > 0)
                {
                    albumDetail = await _audioDbHandler.GetAlbumAsync(album.AudioDbId, language, cacheOnly).ConfigureAwait(false);
                }
                if (albumDetail == null && !string.IsNullOrEmpty(album.MusicBrainzId))
                {
                    List <AudioDbAlbum> foundAlbums = await _audioDbHandler.GetAlbumByMbidAsync(album.MusicBrainzId, language, cacheOnly).ConfigureAwait(false);

                    if (foundAlbums != null && foundAlbums.Count == 1)
                    {
                        //Get the album into the cache
                        albumDetail = await _audioDbHandler.GetAlbumAsync(foundAlbums[0].AlbumId, language, cacheOnly).ConfigureAwait(false);
                    }
                }
                if (albumDetail == null)
                {
                    return(false);
                }

                if (!string.IsNullOrEmpty(albumDetail.Label) && company.MatchNames(company.Name, albumDetail.Label) && albumDetail.LabelId.HasValue)
                {
                    company.AudioDbId = albumDetail.LabelId.Value;
                    company.Name      = albumDetail.Label;
                    company.Type      = CompanyAspect.COMPANY_MUSIC_LABEL;
                    if (!company.DataProviders.Contains(_name))
                    {
                        company.DataProviders.Add(_name);
                    }
                    return(true);
                }

                return(false);
            }
            catch (Exception ex)
            {
                ServiceRegistration.Get <ILogger>().Debug("TheAudioDbWrapper: Exception while processing company {0}", ex, company.ToString());
                return(false);
            }
        }
예제 #42
0
 /// <summary>
 /// Function to get the current Date
 /// </summary>
 public void CurrentDate()
 {
     try
     {
         CompanyInfo infoComapany = new CompanyInfo();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
         FinancialYearBll bllFinancialYear = new FinancialYearBll();
         infoComapany = bllCompanyCreation.CompanyView(1);
         PublicVariables._dtCurrentDate = infoComapany.CurrentDate;
         infoFinancialYear = bllFinancialYear.FinancialYearView(1);
         PublicVariables._dtFromDate = infoFinancialYear.FromDate;
         PublicVariables._dtToDate = infoFinancialYear.ToDate;
         dateToolStripMenuItem.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy");
     }
     catch (Exception ex)
     {
         MessageBox.Show("MDI 2 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #43
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // 관리자 체크  check người quản lý
        EmployeeInfo loginEmployee = new EmployeeInfo();

        loginEmployee = (EmployeeInfo)Session["loginMember"];
        if (loginEmployee == null)
        {
            Response.Redirect("~/login.aspx", true);
        }

        if (loginEmployee.ISAdmin == false)
        {
            Response.Redirect("~/login.aspx", true);
        }

        if (Page.IsPostBack)
        {
            // 수정하기  sửa
            if (mode.Value.Equals("modify"))
            {
                CompanyInfo company = new CompanyInfo();

                company = bll.getCompany(Request["companyCode"]);

                company.CompanyCode         = Convert.ToInt32(Request.QueryString["companyCode"]);
                company.CompanyName         = companyName.Text;
                company.RegNumber1          = regNumber1.Text;
                company.RegNumber2          = regNumber2.Text;
                company.RegNumber3          = regNumber3.Text;
                company.Phone1              = phone1.Text;
                company.Phone2              = phone2.Text;
                company.Phone3              = phone3.Text;
                company.MasterName          = masterName.Text;
                company.Address             = address.Text;
                company.CompanyManagementNo = companyManagementNo.Text;
                company.CompanyStartNo      = companyStartNo.Text;

                int result = bll.updateCompany(company);
                Response.Redirect("companyList.aspx");
            }
            // 등록하기 quay lại
            else
            {
                // 등록 여부 검사   kiểm tra có đăng ký hay không
                bool exists = bll.existsComapny(regNumber1.Text, regNumber2.Text, regNumber3.Text, companyName.Text);

                if (exists == true)
                {
                    Page.RegisterStartupScript("alertMsg", JavaScriptBuilder.alert(companyName.Text + "là tên công ty đã được đăng ký. \\nHãy tìm theo tên công ty. (는 이미 등록된 업체 명입니다.\\n회사명으로 검색해 보시기 바랍니다)."));
                }
                else
                {
                    // 객체를 만들어 저장  lưu object được tạo
                    CompanyInfo company = new CompanyInfo();

                    company.CompanyName         = companyName.Text;
                    company.RegNumber1          = regNumber1.Text;
                    company.RegNumber2          = regNumber2.Text;
                    company.RegNumber3          = regNumber3.Text;
                    company.Phone1              = phone1.Text;
                    company.Phone2              = phone2.Text;
                    company.Phone3              = phone3.Text;
                    company.MasterName          = masterName.Text;
                    company.Address             = address.Text;
                    company.Approve             = 1;
                    company.EmployeeCode        = loginEmployee.Upnid;
                    company.CompanyManagementNo = companyManagementNo.Text;
                    company.CompanyStartNo      = companyStartNo.Text;
                    company.EmployeeName        = loginEmployee.DisplayName;
                    company.EmployeeDept        = loginEmployee.Dep_name;

                    int result = bll.insertCompany(company);
                    bll.CreateHtml(company);
                    Response.Redirect("companyList.aspx");
                }
            }
        }
        else
        {
            if (Request.QueryString["mode"].Equals("modify"))
            {
                CompanyInfo company = bll.getCompany(Request.QueryString["companyCode"]);

                companyName.Text         = company.CompanyName;
                regNumber1.Text          = company.RegNumber1;
                regNumber2.Text          = company.RegNumber2;
                regNumber3.Text          = company.RegNumber3;
                phone1.Text              = company.Phone1;
                phone2.Text              = company.Phone2;
                phone3.Text              = company.Phone3;
                masterName.Text          = company.MasterName;
                address.Text             = company.Address;
                companyManagementNo.Text = company.CompanyManagementNo;
                companyStartNo.Text      = company.CompanyStartNo;

                lableCodeName.Text = "Sửa thông tin công ty (업체 정보 수정하기) : " + company.CompanyName;
                mode.Value         = Request.QueryString["mode"];
            }
            else
            {
                lableCodeName.Text = "Đăng ký công ty (업체 등록하기)";
                mode.Value         = Request.QueryString["mode"];
            }
        }
    }
예제 #44
0
        static void Main( string [] args )
        {
            StockPortfolioEntities7 spe = new StockPortfolioEntities7( );

            var infos  = spe.InfoCompanies;
            foreach ( var ii in infos )
                Console.WriteLine( ii.Name );

            string oldPath = @"C:\Users\KNM\Desktop\halfway.csv";
            string newerPath = @"C:\Users\KNM\Documents\GitHub\KNMFin\DebugTest\DATA\sp500tickers.csv";
            String [] lines;

             using ( System.IO.StreamReader sr = new System.IO.StreamReader(oldPath) )
             {
                string [] separator = new string [] { "\r\n" };
                lines = sr.ReadToEnd( ).Split( separator, StringSplitOptions.None );
             }

            List<string []> items = new List<string []>( );
            Dictionary<string, string []> vals = new Dictionary<string, string []>( );
            string [] sep = new string [] { "," };
            int dummy = 0;
            foreach ( string s in lines )
            {
                if ( dummy == 0 ) dummy++;
                else{
                    var t = s.Split( sep, StringSplitOptions.None );
                    items.Add(t);
                    if ( !vals.ContainsKey( t [ 0 ] ) && t[0] != string.Empty)
                        vals.Add( t [ 0 ], new string [] {  t [ 1 ], t [ 2 ], t [ 3 ] } );
                }
            }

            Dictionary<string, string []> hasResult = new Dictionary<string, string []>( );
            List<string> noResults = new List<string>( );

            HashSet<CompanyInfo> companyInfos = new HashSet<CompanyInfo>( );
            // lines = GetDJIATickers( );

            CompanyInfo ci;
            int cID = spe.InfoCompanies.Count( );

            int every50 = 0;

            foreach ( KeyValuePair<string, string[]> kvp in  vals )
            {
                if ( kvp.Key == null || kvp.Key.Replace(" ", "") == string.Empty ) continue;
                ci = new CompanyInfo( kvp.Key, true );
                if ( ci.Ticker != null )
                {

                    var icQ = spe.InfoCompanies.Where( i => i.Ticker.ToUpper() == ci.Ticker.ToUpper()).FirstOrDefault();

                    InfoCompany ic;

                    if ( icQ == null)
                    {

                        ic = new InfoCompany( );
                        ic.Name = ci.Name;
                        if ( ci.Name.Length > 150 ) ic.Name = ic.Name.Substring( 0, 150 );
                        ic.Ticker = ci.Ticker;
                    }
                    else
                    {
                        ic = icQ;
                    }

                    if ( ci.Exchange != null)
                    {
                        var exc = spe.InfoExchanges.Where( i => i.Name == ci.Exchange ).FirstOrDefault( );
                        if ( exc == null){
                            ic.InfoExchanges.Add( new InfoExchange { Name = ci.Exchange } );
                            spe.SaveChanges( );
                        }
                        else
                        {
                            ic.InfoExchanges.Add( exc );
                        }

                        if ( ci.KeyStats.Count( ) > 0 )
                        {
                            int i = 0;
                            foreach ( KeyStatItems ks in ci.KeyStats )
                            {
                                bool annualorQ = i == 0 ? false : true;
                                KeyAccountingStat ksDB;
                                var kasQuery = spe.KeyAccountingStats.Where( j => j.Annual == annualorQ && j.CompanyID == ic.ID ).FirstOrDefault( );

                                if ( kasQuery == null )
                                {
                                    ksDB = new KeyAccountingStat( );
                                    if ( ks.CDPscore != null )
                                    {
                                        if ( ks.CDPscore.Item1 != null )
                                            ksDB.CDPScoreN = ks.CDPscore.Item1;
                                        else
                                            ksDB.CDPScoreN = null;
                                        if ( ks.CDPscore.Item2 != null )
                                            ksDB.CDPScoreL = ks.CDPscore.Item2;
                                        else
                                            ksDB.CDPScoreL = null;
                                    }
                                    else
                                    {
                                        ksDB.CDPScoreN = null;
                                        ksDB.CDPScoreL = null;

                                    }
                                    ksDB.Annual = i == 0 ? false : true;
                                    ksDB.EBITDMargin = ks.EBITDmargin;
                                    ksDB.Employees = (int?)ks.Employees;
                                    ksDB.NetProfitMargin = ks.NetProfitMargin;
                                    ksDB.OperatingMargin = ks.OperatingMargin;
                                    ksDB.Period = DateTime.Now;

                                    ksDB.ReturnOnAverageAssets = ks.ReturnOnAverageAssets;
                                    ksDB.ReturnOnAverageEquity = ks.ReturnOnAverageEquity;
                                    ic.KeyAccountingStats.Add( ksDB );
                                }
                                i++;
                            }

                        }

                        if(ic.Name == "Uranium Resources, Inc.")
                        {
                            var dbb = 1;
                        }

                        // TODO: Add update case
                        if ( ic.FinancialSnapshots.Count > 0  )
                        {

                        }
                        else
                        {
                            var fss = new FinancialSnapshot( );
                            fss.QueryDate = DateTime.Now;
                            // Nons-sensical value if this condition is false
                            if(ci.Beta < 100)
                                fss.Beta = (decimal?)ci.Beta;
                            fss.ClosePrice = (decimal?)ci.Close;
                            fss.OpenPrice = (decimal?)ci.Open;
                            fss.Dividend = (decimal?)ci.Dividend;
                            fss.DividendYield = (decimal?)ci.DividendYield;
                            fss.EarningsPerShare = (decimal?)ci.EarningsPerShare;
                            fss.FiftyTwoWeekHigh = (decimal?)ci.FiftyTwoWeekHigh;
                            fss.FiftyTwoWeekLow = (decimal?)ci.FiftyTwoWeekLow;
                            fss.InstitutionalOwnership = (decimal?)ci.InstitutionalOwnership;
                            fss.MarketCap = (decimal?)ci.MarketCap;
                            fss.PriceEarnings = (decimal?)ci.PriceEarnings;
                            fss.RangeHigh = (decimal?)ci.RangeHigh;
                            fss.RangeLow = (decimal?)ci.RangeLow;
                            fss.Shares = (decimal?)ci.Shares;
                            fss.VolumeAverage = (decimal?)ci.VolumeAverage;
                            fss.VolumeDaily = (decimal?)ci.VolumeTotal;
                            ic.FinancialSnapshots.Add( fss );

                        }

                        if ( ci.BalanceSheets != null )
                        {
                            foreach ( KNMFin.Google.BalanceSheet bs in ci.BalanceSheets )
                            {
                                if ( ic.BalanceSheets.Where( i => i.PeriodEnd == bs.PeriodEnd && i.InfoCompanies.FirstOrDefault( ) != null ? i.InfoCompanies.FirstOrDefault( ).ID == ic.ID : false ).FirstOrDefault( ) == null )
                                    ic.BalanceSheets.Add( balancesheetDB( bs ) );
                            }
                        }

                        if ( ci.IncomeStatements != null )
                        {
                            foreach ( KNMFin.Google.IncomeStatement inc in ci.IncomeStatements )
                            {
                                if ( ic.IncomeStatements.Where( i => i.PeriodEnd == inc.PeriodEnd && i.InfoCompanies.FirstOrDefault( ) != null ? i.InfoCompanies.FirstOrDefault( ).ID == ic.ID : false ).FirstOrDefault( ) == null )
                                    ic.IncomeStatements.Add( incomestatementDB( inc, spe ) );
                            }
                            int db = 1;
                        }

                        if ( ci.CashFlowStatements != null )
                        {
                            foreach ( KNMFin.Google.CashFlowStatement cfs in ci.CashFlowStatements )
                            {

                                if ( ic.StatementOfCashFlows.Where( i => i.PeriodEnd == cfs.PeriodEnd && i.InfoCompanies.FirstOrDefault( ) != null ? i.InfoCompanies.FirstOrDefault( ).ID == ic.ID : false ).FirstOrDefault( ) == null )
                                    ic.StatementOfCashFlows.Add( cashflowDB( cfs ) );
                            }
                        }

                        var industryName = kvp.Value [ 2 ];
                        var industryQ = spe.InfoIndustries.Where( i => i.Name == industryName ).FirstOrDefault( );
                        if(industryQ == null){
                            var iName = kvp.Value[2];
                            ic.InfoIndustries.Add( new InfoIndustry { Name = iName } );
                            try
                            {
                                spe.SaveChanges( );
                            }
                            catch(Exception ex)
                            {
                                var iex = ex.InnerException;
                            }
                            ic.InfoIndustries.Add( spe.InfoIndustries.Where( i => i.Name == iName ).FirstOrDefault( ) );

                        }
                        else{
                            ic.InfoIndustries.Add(industryQ);

                        }

                        var sectorName = kvp.Value [ 1 ];
                        var sectorQ = spe.InfoSectors.Where( i => i.Name == sectorName ).FirstOrDefault( );
                        if ( sectorQ == null )
                        {
                            var sName = kvp.Value [ 1 ];
                            ic.InfoSectors.Add( new InfoSector { Name = sName } );
                            spe.SaveChanges( );
                        }
                        else
                        {
                            ic.InfoSectors.Add( sectorQ );
                        }

                    }
                    if(icQ == null)
                        spe.InfoCompanies.Add( ic );

                    every50++;
                    if ( every50 == 50 )
                    {

                        every50 = 0;
                        try
                        {
                            spe.SaveChanges( );
                            Console.WriteLine( "Saving 50 results into database: " + DateTime.Now.ToShortTimeString( ) );
                        }
                        catch ( System.Data.Entity.Validation.DbEntityValidationException dbEx )
                        {
                            foreach ( var validationErrors in dbEx.EntityValidationErrors )
                            {
                                foreach ( var validationError in validationErrors.ValidationErrors )
                                {
                                    Console.WriteLine( "Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage );
                                    System.Diagnostics.Trace.TraceInformation( "Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage );
                                }
                            }
                        }
                        catch ( Exception ex )
                        {
                            var exin = ex.InnerException;
                        }

                    }
                    if ( !hasResult.ContainsKey( kvp.Key ) )
                    {
                        var t1 = kvp.Key;
                        var t2 = kvp.Value;
                        t2 [ 1 ] = ci.Ticker;
                        hasResult.Add( kvp.Key, kvp.Value );
                    }

                }
                else
                {
                    noResults.Add( kvp.Key );
                }
                Console.Write( "->Processed: " + kvp.Key );
            }
            try
            {
                spe.SaveChanges( );

            }
            catch ( System.Data.Entity.Validation.DbEntityValidationException dbEx )
            {
            foreach ( var validationErrors in dbEx.EntityValidationErrors )
            {
                foreach ( var validationError in validationErrors.ValidationErrors )
                {
                    Console.WriteLine( "Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage );
                }
            }
            }
            catch ( Exception ex )
            {
                var wutttt = ex.InnerException;
            }
            finally
            {
                using ( var writer = new StreamWriter( @"C:\users\knm\desktop\ticker_results.csv" ) )
                {
                    foreach ( KeyValuePair<string, string []> kvp in hasResult )
                    {
                        writer.WriteLine( "{0}, {1}, {2}, {3}", kvp.Key, kvp.Value [ 0 ], kvp.Value [ 1 ], kvp.Value [ 2 ] );
                    }
                }

                using ( var writer = new StreamWriter( @"C:\users\knm\desktop\no_ticker_results.csv" ) )
                {
                    foreach ( string s in noResults )
                    {
                        writer.WriteLine( s );
                    }
                }
            }

             var wut = 1;
        }
 /// <summary>
 /// Function for Edit
 /// </summary>
 public void EditFunction()
 {
     try
     {
         CompanyInfo infoCompany = new CompanyInfo();
         CompanyCreationBll BllCompanyCreation = new CompanyCreationBll();
         CompanyPathInfo infoCompanyPath = new CompanyPathInfo();
         CompanyPathBll BllCompanyPath = new CompanyPathBll();
         UserInfo infoUser = new UserInfo();
         UserBll bllUser = new UserBll();
         infoCompany.CompanyName = txtCompanyName.Text.Trim();
         infoCompany.MailingName = txtMailingName.Text.Trim();
         infoCompany.Address = txtAddress.Text.Trim();
         infoCompany.Phone = txtPhoneNo.Text.Trim();
         infoCompany.Mobile = txtMobile.Text.Trim();
         infoCompany.EmailId = txtEmail.Text.Trim();
         infoCompany.Web = txtWeb.Text.Trim();
         infoCompany.Country = txtCountry.Text.Trim();
         infoCompany.State = txtState.Text.Trim();
         infoCompany.Pin = txtPincode.Text.Trim();
         infoCompany.CurrencyId = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString());
         infoCompany.FinancialYearFrom = Convert.ToDateTime(txtFinancialYearFrom.Text.Trim().ToString());
         infoCompany.BooksBeginingFrom = Convert.ToDateTime(txtBooksBegining.Text.Trim().ToString());
         infoCompany.Tin = txtTinNo.Text.Trim();
         infoCompany.Cst = txtCstNo.Text.Trim();
         infoCompany.Pan = txtPanNo.Text.Trim();
         infoCompany.CurrentDate = DateTime.Now;
         infoCompany.Logo = logo;
         infoCompany.Extra1 = string.Empty;
         infoCompany.Extra2 = string.Empty;
         infoCompanyPath.CompanyName = txtCompanyName.Text.Trim();
         infoCompanyPath.IsDefault = cbxSetAsDefault.Checked;
         strPath = Application.StartupPath + "\\Data\\" + PublicVariables._decCurrentCompanyId;
         infoCompanyPath.CompanyPath = strPath;
         infoCompanyPath.Extra1 = string.Empty;
         infoCompanyPath.Extra2 = string.Empty;
         infoCompanyPath.ExtraDate = DateTime.Now;
         infoCompanyPath.CompanyId = 1;
         infoCompany.CompanyId = 1;
         BllCompanyCreation.CompanyEdit(infoCompany);
         BllCompanyPath.CompanyPathEdit(infoCompanyPath);
         Messages.UpdatedMessage();
         //  To set default currencyId...........In exchangeRate..//
         ExchangeRateBll BllExchangeRate = new ExchangeRateBll();
         ExchangeRateInfo infoExchangeRate = new ExchangeRateInfo();
         infoExchangeRate.ExchangeRateId = 1;
         infoExchangeRate.Date = PublicVariables._dtCurrentDate;
         infoExchangeRate.CurrencyId = infoCompany.CurrencyId;
         infoExchangeRate.ExtraDate = PublicVariables._dtCurrentDate;
         infoExchangeRate.Narration = string.Empty;
         infoExchangeRate.Rate = 1;
         infoExchangeRate.Extra1 = string.Empty;
         infoExchangeRate.Extra2 = string.Empty;
         BllExchangeRate.ExchangeRateEdit(infoExchangeRate);
         FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
         FinancialYearBll BllFinancialYear = new FinancialYearBll();
         decimal decIdentity;
         infoFinancialYear.FromDate = PublicVariables._dtFromDate;
         infoFinancialYear.ToDate = PublicVariables._dtToDate;
         infoFinancialYear.ExtraDate = DateTime.Now;
         infoFinancialYear.Extra1 = string.Empty;
         infoFinancialYear.Extra2 = string.Empty;
         bool isExist = BllFinancialYear.FinancialYearExistenceCheck(PublicVariables._dtFromDate, PublicVariables._dtToDate);
         if (!isExist)
         {
             decIdentity = BllFinancialYear.FinancialYearAddWithReturnIdentity(infoFinancialYear);
         }
         //===========Add companyDetails in ExternalDb =====================//
         decimal decCompanyIdForTemp = PublicVariables._decCurrentCompanyId;
         PublicVariables._decCurrentCompanyId = 0;
         CompanyCreationBll bllExCompanyCreation = new CompanyCreationBll();
         CompanyPathBll bllExCompanyPath = new CompanyPathBll();
         CompanyInfo infoExCompany = new CompanyInfo();
         CompanyPathInfo infoExCompanyPath = new CompanyPathInfo();
         infoExCompany = infoCompany;
         infoExCompanyPath = infoCompanyPath;
         infoExCompany.CompanyId = decCompanyIdForTemp;
         infoExCompanyPath.CompanyId = decCompanyIdForTemp;
         bllExCompanyCreation.CompanyEdit(infoExCompany);
         bllExCompanyPath.CompanyPathEdit(infoExCompanyPath);
         PublicVariables._decCurrentCompanyId = decCompanyIdForTemp;
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show("CR2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// These function is used to reset the form and clear its controlls
        /// </summary>
        public void Clear()
        {
            try
            {

                if (isAutomatic)
                {
                    VoucherNumberGeneration();
                    txtContraVoucherDate.Focus();
                }
                else
                {
                    txtVoucherNo.Text = string.Empty;
                    txtVoucherNo.ReadOnly = false;
                }
                BankOrCashComboFill(cmbBankAccount);
                GridBankOrCashComboFill();
                isEditMode = false;
                dtpContraVoucherDate.MinDate = PublicVariables._dtFromDate;
                dtpContraVoucherDate.MaxDate = PublicVariables._dtToDate;
                CompanyInfo infoComapany = new CompanyInfo();
                //CompanySP spCompany = new CompanySP();
                CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
                infoComapany = bllCompanyCreation.CompanyView(1);
                DateTime dtVoucherDate = infoComapany.CurrentDate;
                dtpContraVoucherDate.Value = dtVoucherDate;
                txtContraVoucherDate.Text = dtVoucherDate.ToString("dd-MMM-yyyy");
                dtpContraVoucherDate.Value = Convert.ToDateTime(txtContraVoucherDate.Text);
                txtContraVoucherDate.Focus();
                txtContraVoucherDate.SelectAll();
                if (txtVoucherNo.ReadOnly)
                {
                    txtContraVoucherDate.Focus();
                }
                else
                {
                    txtVoucherNo.Focus();
                }
                cmbBankAccount.SelectedIndex = -1;
                txtNarration.Text = string.Empty;
                txtTotal.Text = string.Empty;
                dgvContraVoucher.ClearSelection();
                rbtnDeposit.Checked = true;
                btnDelete.Enabled = false;
                btnSave.Text = "Save";
                dgvContraVoucher.Rows.Clear();
                if (frmContraRegisterObj != null)
                {
                    frmContraRegisterObj.Close();
                }
                if (frmContraReportObj != null)
                {
                    frmContraReportObj.Close();
                }
                SettingsBll BllSettings = new SettingsBll();

                if (BllSettings.SettingsStatusCheck("TickPrintAfterSave") == "Yes")
                {
                    cbxPrintafterSave.Checked = true;
                }
                else
                {
                    cbxPrintafterSave.Checked = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("CV:09" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);

            }
        }
예제 #47
0
 //Company Response
 protected LoyaltyCompanyResponse CreateCompanyResponseNoError(CompanyInfo inCompanyInfo)
 {
     return(CreateCompanyResponse(true, "", "", LoyaltyResponseCode.Successful, inCompanyInfo));
 }
        public bool UpdateCompanyInfo(string recuiterId, string company, string address, string district, int cityId, string phoneNumber, string description, string logoURL)
        {
            if (!String.IsNullOrEmpty(company) && !String.IsNullOrEmpty(recuiterId))
            {
                CompanyInfo companyInfo = this.CompanyInfoRepository.Get(s => s.RecruiterID == recuiterId).FirstOrDefault();
                IEnumerable<CompanyInfoCity> companyInfoCity = this.CompanyInfoCityRepository.Get(s => s.RecuiterID == recuiterId).AsEnumerable();

                for (int i = 0; i < companyInfoCity.Count(); i++)
                {
                    CompanyInfoCity cic = companyInfoCity.ElementAt(i);
                    cic.IsDeleted = true;
                    this.CompanyInfoCityRepository.Update(cic);
                    this.Save();
                }

                if (companyInfo != null)
                {
                    companyInfo.Company = company;
                    companyInfo.Address = address;
                    companyInfo.District = district;
                    companyInfo.PhoneNumber = phoneNumber;
                    companyInfo.Description = description;
                    companyInfo.LogoURL = logoURL;
                    this.CompanyInfoRepository.Update(companyInfo);
                    this.Save();

                    if (companyInfoCity != null)
                    {
                        CompanyInfoCity cic = this.CompanyInfoCityRepository.Get(s => s.RecuiterID == recuiterId && s.CityID == cityId).FirstOrDefault();
                        if (cic != null)
                        {
                            cic.IsDeleted = false;
                            this.CompanyInfoCityRepository.Update(cic);
                            this.Save();
                        }
                        else
                        {
                            CreateCompanyInfoCity(recuiterId, cityId);
                        }
                    }
                    else if (companyInfoCity == null)
                    {
                        CreateCompanyInfoCity(recuiterId, cityId);
                    }

                    return true;
                }
                else
                {
                    CompanyInfo newCompanyInfo = new CompanyInfo();
                    newCompanyInfo.RecruiterID = recuiterId;
                    newCompanyInfo.Company = company;
                    newCompanyInfo.Address = address;
                    newCompanyInfo.District = district;
                    newCompanyInfo.PhoneNumber = phoneNumber;
                    newCompanyInfo.Description = description;
                    newCompanyInfo.LogoURL = logoURL;
                    newCompanyInfo.IsVisible = false;
                    this.CompanyInfoRepository.Insert(newCompanyInfo);
                    this.Save();

                    CreateCompanyInfoCity(recuiterId, cityId);

                    return true;
                }
            }
            return false;
        }
예제 #49
0
 /// <summary>
 /// Function to check the Date
 /// </summary>
 public void CurrentDateBefore()
 {
     try
     {
         CompanyInfo infoComapany = new CompanyInfo();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         DateTime sysDate = System.DateTime.Today;
         PublicVariables._dtCurrentDate = sysDate;
         DateTime date = new DateTime(sysDate.Year, 04, 01);
         DateTime dtFromDate = new DateTime();
         DateTime dtToDate = new DateTime();
         if (sysDate < date)
         {
             dtFromDate = new DateTime(sysDate.Year - 1, 04, 01);
             dtToDate = new DateTime(sysDate.Year, 03, 31);
         }
         else
         {
             dtFromDate = new DateTime(sysDate.Year, 04, 01);
             dtToDate = new DateTime(sysDate.Year + 1, 03, 31);
         }
         PublicVariables._dtFromDate = dtFromDate;
         PublicVariables._dtToDate = dtToDate;
     }
     catch (Exception ex)
     {
         MessageBox.Show("MDI 1 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #50
0
 protected LoyaltyCompanyResponse CreateCompanyResponseError(string inMessage, string inDescription, LoyaltyResponseCode inResponseCode, CompanyInfo inCompanyInfo)
 {
     return(CreateCompanyResponse(false, inMessage, inDescription, inResponseCode, inCompanyInfo));
 }
예제 #51
0
 private LoyaltyCompanyResponse CreateCompanyResponse(bool inSuccesful, string inMessage, string inDescription, LoyaltyResponseCode inResponseCode, CompanyInfo inCompanyInfo)
 {
     return(new LoyaltyCompanyResponse(inSuccesful, inMessage, inDescription, inResponseCode, inCompanyInfo));
 }
예제 #52
0
        public UserInformation RemoteLoginUser(string username, string password, string hostServer)
        {
            var userInformation = new UserInformation
            {
                UserInfo = new User()
            };

            #region Null Validation

            if (username.IsNullOrEmpty() || password.IsNullOrEmpty() || hostServer.IsNullOrEmpty())
            {
                _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Login Failed! Reason: All the inputs are required";
                userInformation.Status          = _status;
                return(userInformation);
            }
            #endregion

            var stationInfo = new StationInfo
            {
                //Address = "",
                APIAccessKey        = "",
                HostServerAddress   = hostServer,
                StationKey          = "",
                StationName         = "",
                TimeStampRegistered = DateMap.CurrentTimeStamp(),
                Status = true,
            };

            #region Super Admin User Profile

            var superUserProfileInfo = new UserProfile
            {
                DateLastModified   = DateTime.Now.ToString("yyyy/MM/dd"),
                Email              = "*****@*****.**",
                FirstName          = "SuperAdmin",
                MobileNumber       = "2348036975694",
                ModifiedBy         = 1,
                OtherNames         = "",
                ProfileNumber      = "0001",
                ResidentialAddress = "EpayPlus Limited",
                Sex              = 1,
                Status           = 1,
                Surname          = "Epay",
                TimeLastModified = DateTime.Now.ToString("hh:mm:ss tt")
            };

            var superUserInfo = new User
            {
                Email = "*****@*****.**",
                FailedPasswordAttemptCount = 0,
                IsApproved              = true,
                IsLockedOut             = false,
                Password                = "******",
                RegisteredDateTimeStamp = DateTime.Now.ToString("yyyy/MM/dd - hh:mm:ss tt"),
                RoleId   = 1,
                UserName = "******",
                LastLockedOutTimeStamp       = "",
                LastLoginTimeStamp           = "",
                LastPasswordChangedTimeStamp = ""
            };

            #endregion


            using (var db = _uoWork.BeginTransaction())
            {
                try
                {
                    #region Remotely Connect & Login

                    #region Access Parameter - Authorize Access

                    var networkInterface = InternetHelp.GetMainNetworkInterface();
                    var loginParameter   = new RemoteLoginParameter
                    {
                        DeviceIP = InternetHelp.GetIpAddress(networkInterface),
                        DeviceId = InternetHelp.GetMACAddress(),
                        UserName = username,
                        Password = password
                    };
                    #endregion

                    string msg;
                    var    remoteLoginRespObj = new RemoteMessanger(RemoteProcessType.RemoteLogin, hostServer).RemoteLogin(loginParameter, out msg);
                    if (remoteLoginRespObj == null)
                    {
                        _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Process Failed! " + (string.IsNullOrEmpty(msg) ? "Unable to register Station Information" : msg);
                        userInformation.Status          = _status;
                        return(userInformation);
                    }
                    if (!remoteLoginRespObj.ResponseStatus.IsSuccessful || string.IsNullOrEmpty(remoteLoginRespObj.APIAccessKey) || remoteLoginRespObj.APIAccessKey.Length != 10)
                    {
                        _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = string.IsNullOrEmpty(remoteLoginRespObj.ResponseStatus.Message.FriendlyMessage) ? "Unable to complete your request! Please try again later" : remoteLoginRespObj.ResponseStatus.Message.FriendlyMessage;
                        userInformation.Status          = _status;
                        return(userInformation);
                    }

                    #endregion

                    #region Station Info

                    stationInfo.RemoteStationId = remoteLoginRespObj.ClientStationId;
                    stationInfo.APIAccessKey    = remoteLoginRespObj.APIAccessKey;
                    stationInfo.StationName     = remoteLoginRespObj.StationName;
                    stationInfo.StationKey      = remoteLoginRespObj.StationId;
                    stationInfo.Status          = Convert.ToBoolean(remoteLoginRespObj.StationStatus);
                    var addStationInfo = _stationInfoRepository.Add(stationInfo);
                    _uoWork.SaveChanges();

                    stationInfo.StationInfoId = addStationInfo.StationInfoId;
                    if (stationInfo.StationInfoId < 1)
                    {
                        db.Rollback();
                        _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Process Failed! Unable to register Station Information";
                        userInformation.Status          = _status;
                        return(userInformation);
                    }

                    #endregion

                    #region Company

                    var companyInfo = new CompanyInfo
                    {
                        StationName       = remoteLoginRespObj.StationName,
                        StationKey        = remoteLoginRespObj.StationId,
                        HostServerAddress = hostServer,
                        //Address = "",
                        Status = Convert.ToBoolean(remoteLoginRespObj.StationStatus),
                    };

                    var addCompanyInfo = _companyRepository.Add(companyInfo);
                    _uoWork.SaveChanges();
                    if (addCompanyInfo.CompanyInfoId < 1)
                    {
                        db.Rollback();
                        _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Unable to save Station's profile to the database";
                        userInformation.Status          = _status;
                        return(userInformation);
                    }
                    #endregion

                    #region User Profile

                    var staffRegistration = new UserProfile
                    {
                        StationInfoId      = stationInfo.StationInfoId,
                        Surname            = remoteLoginRespObj.Surname,
                        FirstName          = remoteLoginRespObj.FirstName,
                        OtherNames         = remoteLoginRespObj.Othernames,
                        ResidentialAddress = remoteLoginRespObj.ResidentialAddress,
                        MobileNumber       = remoteLoginRespObj.MobileNumber,
                        Email               = remoteLoginRespObj.Email,
                        ProfileNumber       = remoteLoginRespObj.EnrollerRegId,
                        UserProfileRemoteId = remoteLoginRespObj.EnrollerId,
                        Sex              = remoteLoginRespObj.Sex,
                        Status           = remoteLoginRespObj.EnrollerStatus,
                        TimeLastModified = DateTime.Now.ToString("hh:mm:ss tt"),
                        DateLastModified = DateTime.Now.ToString("yyyy/MM/dd"),
                        ModifiedBy       = 1
                    };

                    var userProfile = _userProfileRepository.Add(staffRegistration);
                    _uoWork.SaveChanges();
                    if (userProfile.UserProfileId < 1)
                    {
                        db.Rollback();
                        _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Error Occurred! Unable to add new user record";
                        userInformation.Status          = _status;
                        return(userInformation);
                    }

                    #endregion

                    #region User

                    var user = new User
                    {
                        UserName    = username,
                        Password    = password,
                        Email       = remoteLoginRespObj.Email,
                        RoleId      = 2,
                        IsApproved  = true,
                        IsLockedOut = false,
                        FailedPasswordAttemptCount   = 0,
                        LastLockedOutTimeStamp       = "",
                        LastLoginTimeStamp           = "",
                        LastPasswordChangedTimeStamp = "",
                        RegisteredDateTimeStamp      = DateTime.Now.ToString("yyyy/MM/dd - hh:mm:ss tt")
                    };

                    var thisUser = new UserRepository().GetUser(user.UserName);
                    if (thisUser != null)
                    {
                        if (thisUser.UserProfileId > 0)
                        {
                            db.Rollback();
                            _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Duplicate Error! This username already exist in local database";
                            userInformation.Status          = _status;
                            return(userInformation);
                        }
                    }

                    user.UserCode         = Crypto.HashPassword(user.Password);
                    user.Salt             = EncryptionHelper.GenerateSalt(30, 50);
                    user.Password         = Crypto.GenerateSalt(16);
                    user.IsFirstTimeLogin = true;
                    user.UserProfileId    = userProfile.UserProfileId;

                    var addUser = _repository.Add(user);
                    _uoWork.SaveChanges();
                    if (addUser.UserId < 1)
                    {
                        db.Rollback();
                        _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Error Occurred! Unable to add new user account";
                        userInformation.Status          = _status;
                        return(userInformation);
                    }

                    #endregion


                    #region Default Admin Profiles

                    var check = new UserRepository().GetUser("useradmin");
                    if (check == null || check.UserProfileId < 1)
                    {
                        superUserInfo.UserCode         = Crypto.HashPassword(superUserInfo.Password);
                        superUserInfo.Salt             = EncryptionHelper.GenerateSalt(30, 50);
                        superUserInfo.Password         = Crypto.GenerateSalt(16);
                        superUserInfo.IsFirstTimeLogin = false;
                        var processSuperProfile = _userProfileRepository.Add(superUserProfileInfo);
                        _uoWork.SaveChanges();
                        if (processSuperProfile.UserProfileId < 1)
                        {
                            db.Rollback();
                            _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Error Occurred! Unable to add new user account";
                            userInformation.Status          = _status;
                            return(userInformation);
                        }

                        superUserInfo.UserProfileId = processSuperProfile.UserProfileId;
                        var processSuperUser = _repository.Add(superUserInfo);
                        _uoWork.SaveChanges();
                        if (processSuperUser.UserId < 1)
                        {
                            db.Rollback();
                            _status.Message.FriendlyMessage = _status.Message.TechnicalMessage = "Error Occurred! Unable to add new user account";
                            userInformation.Status          = _status;
                            return(userInformation);
                        }
                    }

                    #endregion

                    db.Commit();
                    user.UserProfile            = userProfile;
                    _status.IsSuccessful        = true;
                    userInformation.Status      = _status;
                    userInformation.UserInfo    = user;
                    userInformation.StationInfo = stationInfo;
                    return(userInformation);
                }
                catch (DbEntityValidationException ex)
                {
                    ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
                    _status.Message.FriendlyMessage  = "Login Failed! Reason: " + ex.Message;
                    _status.Message.TechnicalMessage = "Error: " + ex.Message;
                    userInformation.Status           = _status;
                    return(userInformation);
                }
                catch (Exception ex)
                {
                    db.Rollback();
                    ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message);
                    _status.Message.FriendlyMessage  = "Login Failed! Reason: " + ex.Message;
                    _status.Message.TechnicalMessage = "Error: " + ex.Message;
                    userInformation.Status           = _status;
                    return(userInformation);
                }
            }
        }
 /// <summary>
 /// Function to set the voucherdate
 /// </summary>
 public void VoucherDate()
 {
     try
     {
         dtpVoucherDate.MinDate = PublicVariables._dtFromDate;
         dtpVoucherDate.MaxDate = PublicVariables._dtToDate;
         CompanyInfo infoComapany = new CompanyInfo();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.CompanyView(1);
         DateTime dtVoucherDate = infoComapany.CurrentDate;
         dtpVoucherDate.Value = dtVoucherDate;
         txtVoucherDate.Text = dtVoucherDate.ToString("dd-MMM-yyyy");
         dtpVoucherDate.Value = Convert.ToDateTime(txtVoucherDate.Text);
         txtVoucherDate.Focus();
         txtVoucherDate.SelectAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show("SV 05 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Setting the check box Status
 /// </summary>
 public void FillSettings()
 {
     try
     {
         BarcodeSettingsInfo Info = new BarcodeSettingsBll().BarcodeSettingsView(1);
         if (Info.ShowMRP == true)
         {
             cbxShowMrp.Checked = true;
         }
         else
         {
             cbxShowMrp.Checked = false;
         }
         if (Info.ShowProductCode == true)
         {
             rbtnShowProductCode.Checked = true;
         }
         else
         {
             rbtnShowProductName.Checked = true;
         }
         if (Info.ShowCompanyName == true)
         {
             cbxShowCompanyNAmeAs.Checked = true;
         }
         else
         {
             cbxShowCompanyNAmeAs.Checked = false;
         }
         if (Info.ShowPurchaseRate == true)
         {
             cbxShowPurchaseRate.Checked = true;
         }
         else
         {
             cbxShowPurchaseRate.Checked = false;
         }
         txtShowCompanyName.Text = Info.CompanyName;
         if (txtShowCompanyName.Text == string.Empty)
         {
             CompanyInfo InfoCompany = new CompanyInfo();
             //CompanySP Sp = new CompanySP();
             CompanyCreationBll Bll = new CompanyCreationBll();
             InfoCompany = Bll.CompanyView(1);
             txtShowCompanyName.Text = InfoCompany.CompanyName;
         }
         txtZero.Text = Info.Zero;
         txtOne.Text = Info.One;
         txtTwo.Text = Info.Two;
         txtThree.Text = Info.Three;
         txtFour.Text = Info.Four;
         txtFive.Text = Info.Five;
         txtSix.Text = Info.Six;
         txtSeven.Text = Info.Seven;
         txtEight.Text = Info.Eight;
         txtNine.Text = Info.Nine;
         txtPoint.Text = Info.Point;
     }
     catch (Exception ex)
     {
         MessageBox.Show("BS4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }