示例#1
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit(string id, string dotype)
        {
            this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId;
            this.txtLastHuman.Text        = this.SiteUserInfo.Name;
            this.txtLastDate.Enabled      = false;
            this.txtLastHuman.Enabled     = false;

            if (String.Equals(dotype, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id))
            {
                EyouSoft.BLL.SourceStructure.BSource            BLL   = new EyouSoft.BLL.SourceStructure.BSource();
                EyouSoft.Model.SourceStructure.MSourceMotorcade Model = BLL.GetMotorcadeModel(id);
                if (Model != null)
                {
                    Countryindex                    = Model.SourceModel.CountryId;
                    Provinceindex                   = Model.SourceModel.ProvinceId;
                    Cityindex                       = Model.SourceModel.CityId;
                    Areaindex                       = Model.SourceModel.CountyId;
                    this.txtRemark.Text             = Model.SourceModel.Remark;
                    this.txtteamName.Text           = Model.SourceModel.Name;
                    this.txtContractDate.Text       = UtilsCommons.SetDateTimeFormart(Model.SourceModel.ContractPeriodEnd);
                    this.txtContractDate_Start.Text = UtilsCommons.SetDateTimeFormart(Model.SourceModel.ContractPeriodStart);

                    this.txtLastHuman.Text = Model.SourceModel.LastModifierId;
                    this.txtLastDate.Text  = UtilsCommons.GetDateString(Model.SourceModel.LastModifyTime, ProviderToDate);
                    if (Model.SourceModel != null)
                    {
                        this.RadioButton2.Checked = true;
                        if (Model.SourceModel.IsCommission)
                        {
                            this.RadioButton1.Checked = true;
                            this.RadioButton2.Checked = false;
                        }
                        radRecommendno.Checked = true;
                        if (Model.SourceModel.IsRecommend)
                        {
                            radRecommendyes.Checked = true;
                            radRecommendno.Checked  = false;
                        }
                        radno.Checked = true;
                        if (Model.SourceModel.IsPermission)
                        {
                            radyes.Checked = true;
                            radno.Checked  = false;
                        }
                        Radio_hd_no.Checked = true;
                        if (Model.SourceModel.IsSignContract)
                        {
                            this.Radio_hd_yes.Checked   = true;
                            this.Radio_hd_no.Checked    = false;
                            this.txtContractNum.Visible = true;
                            this.txtContractNum.Text    = Model.SourceModel.ContractCode;
                        }
                        if (Model.SourceModel.ContractAttach != null)
                        {
                            StringBuilder strFile = new StringBuilder();
                            if (Model.SourceModel.ContractAttach.FilePath != "")
                            {
                                strFile.AppendFormat("<span class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}' target='_blank'>{1}</a><a href=\"javascript:void(0)\" onclick=\"CarEditPage.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideFileInfo\" value='{1}|{0}'/></span>", Model.SourceModel.ContractAttach.FilePath, Model.SourceModel.ContractAttach.Name);
                            }
                            this.lbFiles.Text = strFile.ToString();
                        }
                    }
                    if (Model.LinkManList.Count > 0)
                    {
                        //获取联系人信息
                        this.Contact1.SetTravelList = Model.LinkManList;
                    }
                    if (Model.CarList.Count > 0)
                    {
                        //获取联系人信息
                        this.SetTravelList = Model.CarList;
                    }
                    SetListCount = SetTravelList.Count;
                }
                else
                {
                    Utils.ResponseGoBack();
                }
            }
        }
示例#2
0
        /// <summary>
        /// 获取联系人信息
        /// </summary>
        /// <param name="sid">供应商编号</param>
        /// <returns></returns>
        protected string GetContactInfo(object sid, string type)
        {
            string sourceID = sid.ToString();

            EyouSoft.BLL.SourceStructure.BSource            bll   = new BSource();
            EyouSoft.Model.SourceStructure.MSourceMotorcade model = bll.GetMotorcadeModel(sourceID);
            StringBuilder stb = new System.Text.StringBuilder();

            if (model != null)
            {
                IList <EyouSoft.Model.CrmStructure.MCrmLinkman> list = model.LinkManList;
                bool IsPermission = false;
                bool IsRecommend  = false;
                if (model.SourceModel != null)
                {
                    IsPermission = model.SourceModel.IsPermission;
                    IsRecommend  = model.SourceModel.IsRecommend;
                }
                switch (type)
                {
                //供应商是否签单和推荐
                case "icon":
                    stb.Append(EyouSoft.Common.UtilsCommons.GetCompanyRecommend((object)IsRecommend, (object)IsPermission));
                    break;

                case "name":
                    if (list != null && list.Count > 0)
                    {
                        stb.Append(list[0].Name);
                    }
                    break;

                case "tel":
                    if (list != null && list.Count > 0)
                    {
                        stb.Append(string.IsNullOrEmpty(list[0].Telephone) ? list[0].MobilePhone : list[0].Telephone);
                    }
                    break;

                case "fax":
                    if (list != null && list.Count > 0)
                    {
                        stb.Append(list[0].Fax);
                    }
                    break;

                case "list":
                    if (list != null && list.Count > 0)
                    {
                        stb.Append("<table cellspacing='0' cellpadding='0' border='0' width='100%' class='pp-tableclass'><tr class='pp-table-title'><th height='23' width='7%' align='center'>编号</th><th width='19%' align='center'>联系人</th><th align='center' width='20%'>电话</th><th align='center'>手机</th><th align='center' width='18%'>传真</th></tr>");
                        for (int i = 0; i < list.Count; i++)
                        {
                            stb.Append("<tr><td align='center' width='7%'>" + (i + 1).ToString() + "</td><td  width='19%' align='center'>" + list[i].Name + "</td><td align='center' width='20%'>" + list[i].Telephone + "</td><td align='center' width='18%'>" + list[i].MobilePhone + "</td><td align='center' width='19%'>" + list[i].Fax + "</td></tr>");
                        }
                        stb.Append("</table>");
                    }
                    break;
                }
            }
            return(stb.ToString());
        }