コード例 #1
0
        private void savecompanyinfo(HttpContext context)
        {
            Foresight.DataAccess.Company company = null;
            if (!checkvalidcompany(context, out company))
            {
                var items = new { status = false, errormsg = "公司未登记" };
                WebUtil.WriteJson(context, items);
                return;
            }
            company.CompanyName  = context.Request.Params["CompanyName"];
            company.PhoneNumber  = context.Request.Params["PhoneNumber"];
            company.Address      = context.Request.Params["Address"];
            company.CompanyDesc  = context.Request.Params["CompanyDesc"];
            company.ChargePerson = context.Request.Params["ChargePerson"];
            company.Save();
            var item = new { status = true, errormsg = "OK" };

            WebUtil.WriteJson(context, item);
        }
コード例 #2
0
 private void SetInfo(Foresight.DataAccess.Company data)
 {
     this.tdRealName.Value             = data.CompanyName;
     this.tdPhoneNumber.Value          = data.PhoneNumber;
     this.tdAddress.Value              = data.Address;
     this.tdIsActive.Value             = data.IsActive ? "1" : "0";
     this.tdIsPay.Value                = data.IsPay ? "1" : "0";
     this.tdDesc.Value                 = data.CompanyDesc;
     this.tdChargeMan.Value            = data.ChargePerson;
     this.tdDistributor.Value          = data.Distributor;
     this.tdUserCount.Value            = data.UserCount == int.MinValue ? "0" : data.UserCount.ToString();
     this.tdStartTime.Value            = data.ServerStartTime == DateTime.MinValue ? "" : data.ServerStartTime.ToString("yyyy-MM-dd HH:mm:ss");
     this.tdEndTime.Value              = data.ServerEndTime == DateTime.MinValue ? "" : data.ServerEndTime.ToString("yyyy-MM-dd HH:mm:ss");
     this.LogoPath                     = data.Login_LogImg;
     this.LogoBodyPath                 = data.Login_BodyImg;
     this.HomeLogoPath                 = data.Home_LogoImg;
     this.tdProjectCount.Value         = data.ProjectCount >= 0 ? data.ProjectCount.ToString() : "";
     this.btnShowLogin_LogImg.Checked  = !data.IsHideLogin_LogImg;
     this.btnShowLogin_BodyImg.Checked = !data.IsHideLogin_BodyImg;
     this.btnShowHome_LogoImg.Checked  = !data.IsHideHome_LogoImg;
     this.tdCopyRightText.Value        = data.CopyRightText;
     this.btnShowCopyRightText.Checked = !data.IsHideCopyRightText;
     this.tdAlowRemoteUpdate.Value     = data.AlowRemoteUpdate ? "1" : "0";
     this.tdIsWechatOn.Value           = data.IsWechatOn ? "1" : "0";
     this.tdVersionCode.Value          = data.VersionCode > 0 ? data.VersionCode.ToString() : "";
     this.tdExpiringDay.Value          = data.ExpiringDay > 0 ? data.ExpiringDay.ToString() : "0";
     this.btnExpiringShow.Checked      = data.ExpiringShow;
     this.tdExpiringMsg.Value          = data.ExpiringMsg;
     if (string.IsNullOrEmpty(data.Signature) || string.IsNullOrEmpty(data.Token))
     {
         data.Signature = Utility.Tools.GetRandomString(32, true, false, true);
         data.Token     = Utility.Tools.GetByteString(4);
         data.Save();
     }
     this.tdSignature.InnerHtml = data.Signature;
     this.tdToken.InnerHtml     = data.Token;
 }