Пример #1
0
        private void InitControls()
        {
            int            id    = CompanyID;
            CompanysEntity model = companyApp.GetCompany(id);

            txtAddress1.Text = model.Address1;
            txtAddress2.Text = model.Address2;
            //model.AssignedSystemUrl = "http://client.sunnet.us";
            txtCity.Text        = model.City;
            txtCompanyName.Text = model.CompanyName;
            txtFax.Text         = model.Fax;
            txtPhone.Text       = model.Phone;
            ListItem state = ddlState.Items.FindByText(model.State);

            if (state != null)
            {
                state.Selected = true;
            }
            txtWebsite.Text = model.Website;

            InitControl(model);

            InitProjects();
            InitUsers();

            if (CompanyID == 1)
            {
                phFiles.Visible = false;
            }
            else
            {
                phFiles.Visible = true;
                InitFiles();
            }
        }
Пример #2
0
        private void InitCompanyInfo()
        {
            CompanyApplication comApp  = new CompanyApplication();
            CompanysEntity     company = comApp.GetCompany(UserInfo.CompanyID);

            if (UserInfo.CompanyID == 1)  //Sunnet 公司
            {
                ltLogo.Text = string.Format("<a href=\"http://www.sunnet.us\" target=\"_blank\">{0}</a>"
                                            , BuilderLogo(company.Logo));
            }
            else
            {
                CompanysEntity sunntCompanyEntity = comApp.GetCompany(1); //获取Sunnet公司

                if (company.Logo.IndexOf("logomain.jpg") >= 0)            //没有上传Logo ,则显示 Sunnet 公司Logo
                {
                    ltLogo.Text = string.Format("<a href=\"http://www.sunnet.us\" target=\"_blank\">{0}</a>"
                                                , BuilderLogo(sunntCompanyEntity.Logo));
                }
                else
                {
                    ltLogo.Text = BuilderLogo(company.Logo);

                    ltSunnetLogo.Text = string.Format("<a href=\"http://www.sunnet.us\" target=\"_blank\">{0}</a>"
                                                      , BuilderLogo(sunntCompanyEntity.Logo));
                }
            }
        }
Пример #3
0
        private void InitCompany()
        {
            var            comApp  = new CompanyApplication();
            CompanysEntity company = comApp.GetCompany(UserInfo.CompanyID);

            if (company != null)
            {
                ltlCompany.Text = company.CompanyName;
            }
        }
Пример #4
0
        private void InitCompanyInfo()
        {
            IEncrypt           encrypt = UtilFactory.GetEncryptProvider(EncryptType.DES);
            CompanyApplication comApp  = new CompanyApplication();
            CompanysEntity     company = comApp.GetCompany(UserInfo.CompanyID);

            if (UserInfo.CompanyID == 1)  //Sunnet 公司
            {
                ltLogo.Text = string.Format("<a href=\"http://www.sunnet.us\" target=\"_blank\">{0}</a>"
                                            , BuilderLogo(company.Logo));
                UtilFactory.Helpers.CookieHelper.Add(encrypt.Encrypt("LtLogo"),
                                                     encrypt.Encrypt(ltLogo.Text), DateTime.Now.AddMinutes(30));
            }
            else
            {
                CompanysEntity sunntCompanyEntity = comApp.GetCompany(1); //获取Sunnet公司

                if (company.Logo.IndexOf("logomain.jpg") >= 0)            //没有上传Logo ,则显示 Sunnet 公司Logo
                {
                    ltLogo.Text = string.Format("<a href=\"http://www.sunnet.us\" target=\"_blank\">{0}</a>"
                                                , BuilderLogo(sunntCompanyEntity.Logo));
                    UtilFactory.Helpers.CookieHelper.Add(encrypt.Encrypt("LtLogo"),
                                                         encrypt.Encrypt(ltLogo.Text), DateTime.Now.AddMinutes(30));
                }
                else
                {
                    ltLogo.Text = BuilderLogo(company.Logo);

                    ltSunnetLogo.Text = string.Format("<a href=\"http://www.sunnet.us\" target=\"_blank\">{0}</a>"
                                                      , BuilderLogo(sunntCompanyEntity.Logo));


                    UtilFactory.Helpers.CookieHelper.Add(encrypt.Encrypt("LtLogo"),
                                                         encrypt.Encrypt(ltLogo.Text), DateTime.Now.AddMinutes(30));
                    UtilFactory.Helpers.CookieHelper.Add(encrypt.Encrypt("LtSunnetLogo"),
                                                         encrypt.Encrypt(ltSunnetLogo.Text), DateTime.Now.AddMinutes(30));
                }
            }
        }
Пример #5
0
        private void InitCompany()
        {
            CompanyApplication comApp = new CompanyApplication();

            if (UserInfo.Role == RolesEnum.CLIENT)
            {
                CompanysEntity model = comApp.GetCompany(UserInfo.CompanyID);
                ddlCompany.Items.Add(new ListItem(model.CompanyName, model.ID.ToString()));
                tdCompanyLabel.Visible = false;
                tdCompanyDdl.Visible   = false;
            }
            else
            {
                List <CompanysEntity> list = comApp.GetAllCompanies();
                list.BindDropdown <CompanysEntity>(ddlCompany, "CompanyName", "ID", "All", "0");
            }
            ddlCompany_OnSelectedIndexChanged(null, null);
        }
Пример #6
0
        private void InitCompany()
        {
            CompanyApplication comApp = new CompanyApplication();

            if (UserInfo.Role == RolesEnum.CLIENT)
            {
                CompanysEntity model = comApp.GetCompany(UserInfo.CompanyID);
                ddlCompany.Items.Add(new ListItem(model.CompanyName, model.ID.ToString()));
                tdCompanyLabel.Visible = false;
                tdCompanyDdl.Visible   = false;

                ltlWhosCompany.Text = "";
            }
            else
            {
                List <CompanysEntity> list = comApp.GetAllCompanies();
                list = list.FindAll(c => c.ID > 1);
                list.BindDropdown <CompanysEntity>(ddlCompany, "CompanyName", "ID", "All", "0");
                ltlWhosCompany.Text = " - All company files";
            }
        }