protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { long Cpsid = Shove._Convert.StrToLong(Shove._Web.Utility.FilteSqlInfusion(Shove._Web.Utility.GetRequest("ID")), -1); Cps curCps = new Cps(); curCps.SiteID = _Site.ID; curCps.ID = Cpsid; string returndescription = string.Empty; curCps.GetCpsInformationByID(ref returndescription); if (_User.cps.ID < 0 || curCps.ID < 0 || _User.cps.ID != curCps.ParentID) { PF.GoError(ErrorNumber.NotEnoughCompetence, "当前推广员不是你发展的下线,没有权限查看.", this.GetType().BaseType.FullName); return; } hfCpsID.Value = Cpsid.ToString(); hfOwnerUserID.Value = curCps.OwnerUserID.ToString(); lblCpsName.Text = curCps.Name; BindData(); } }
public int GetCpsInformationByOwnerUserID(ref string ReturnDescription) { if ((this.SiteID < 0L) || (this.OwnerUserID < 0L)) { throw new Exception("Cps 尚未初始化 SiteID、 OwnerUserID 变量,无法获取信息"); } int returnValue = -1; ReturnDescription = ""; Cps cps = new Cps(); this.Clone(cps); if (Procedures.P_GetCpsInformationByOwnerUserID(this.SiteID, this.OwnerUserID, ref this.ID, ref this.Name, ref this.DateTime, ref this.Url, ref this.LogoUrl, ref this.BonusScale, ref this.ON, ref this.Company, ref this.Address, ref this.PostCode, ref this.ResponsiblePerson, ref this.ContactPerson, ref this.Telephone, ref this.Fax, ref this.Mobile, ref this.Email, ref this.QQ, ref this.ServiceTelephone, ref this.MD5Key, ref this.Type, ref this.ParentID, ref this.DomainName, ref returnValue, ref ReturnDescription) < 0) { cps.Clone(this); ReturnDescription = "数据库读写错误"; return(-1); } if (returnValue < 0) { cps.Clone(this); return(returnValue); } return(0); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { Cps cps = new Cps(); cps.SiteID = _Site.ID; cps.ID = Shove._Convert.StrToLong(Shove._Web.Utility.FilteSqlInfusion(Shove._Web.Utility.GetRequest("ID")), -1); string returndescription = ""; cps.GetCpsInformationByID(ref returndescription); tbUrlName.Text = cps.Name; tbUrl.Text = cps.Url; tbMD5Key.Text = cps.MD5Key; tbContactPerson.Text = cps.ContactPerson; tbPhone.Text = cps.Telephone; tbMobile.Text = cps.Mobile; tbQQNum.Text = cps.QQ; tbEmail.Text = cps.Email; tbDomainName.Text = cps.DomainName; linkBonusScale.NavigateUrl = "BonusScaleSetupForCps.aspx?ID=" + Shove._Web.Utility.GetRequest("ID"); if (cps.Type == 2) { lbType.Text = "代理商"; trMD5Key.Visible = true; } } }
public void Clone(Cps cps) { cps.ID = this.ID; cps.SiteID = this.SiteID; cps.OwnerUserID = this.OwnerUserID; cps.Name = this.Name; cps.DateTime = this.DateTime; cps.Url = this.Url; cps.LogoUrl = this.LogoUrl; cps.BonusScale = this.BonusScale; cps.ON = this.ON; cps.Company = this.Company; cps.Address = this.Address; cps.PostCode = this.PostCode; cps.ResponsiblePerson = this.ResponsiblePerson; cps.ContactPerson = this.ContactPerson; cps.Telephone = this.Telephone; cps.Fax = this.Fax; cps.Mobile = this.Mobile; cps.Email = this.Email; cps.QQ = this.QQ; cps.ServiceTelephone = this.ServiceTelephone; cps.MD5Key = this.MD5Key; cps.Type = this.Type; cps.DomainName = this.DomainName; cps.ParentID = this.ParentID; cps.OperatorID = this.OperatorID; cps.CommendID = this.CommendID; cps.Content = this.Content; cps.User = this.User; }
// validate the input value - this will be a string public override ValidationResult Validate(object value, CultureInfo cultureInfo) { double output; bool result = double.TryParse((string)value, out output); Cps.AppendMessage("\n*** changed value to (" + (string)value + ") ***" ); Cps.TellMeTbx("at ValidationResult| (" + value + ")" + " :: parse worked| " + result.ToString() ); return(new ValidationResult(result, null)); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { long Cpsid = Shove._Convert.StrToLong(Shove._Web.Utility.FilteSqlInfusion(Shove._Web.Utility.GetRequest("ID")), -1); Cps curCps = new Cps(); curCps.SiteID = _Site.ID; curCps.ID = Cpsid; string returndescription = string.Empty; curCps.GetCpsInformationByID(ref returndescription); hfCpsID.Value = Cpsid.ToString(); hfOwnerUserID.Value = curCps.OwnerUserID.ToString(); lblCpsName.Text = curCps.Name; linkReturn.NavigateUrl = "BaseInfo.aspx?ID=" + Cpsid; BindData(); } }
private void BindData() { long Cpsid = Shove._Convert.StrToLong(Shove._Web.Utility.FilteSqlInfusion(Shove._Web.Utility.GetRequest("ID")), -1); Cps curCps = new Cps(); curCps.SiteID = _Site.ID; curCps.ID = Cpsid; string returndescription = string.Empty; curCps.GetCpsInformationByID(ref returndescription); string cacheKeyScaleList = "Cps_Admin_BonusScaleView_ScaleList_" + curCps.OwnerUserID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(cacheKeyScaleList); if (dt == null) { int returnValue = -1; string returnDescription = ""; DataSet ds = null; int Result = DAL.Procedures.P_CpsGetUserBonusScaleList(ref ds, curCps.OwnerUserID, ref returnValue, ref returnDescription); if (Result < 0) { Shove._Web.JavaScript.Alert(this.Page, "系统出错!"); return; } if (ds == null || ds.Tables.Count < 1) { Shove._Web.JavaScript.Alert(this.Page, "获取数据出错!"); return; } dt = ds.Tables[0]; Shove._Web.Cache.SetCache(cacheKeyScaleList, dt, 100000); } PF.DataGridBindData(g, dt, gPager); }
public void ContinuationTest() { Func <int, Cps <int, int> > factorialCps = null; // Must have. factorialCps = x => x == 0 ? 1.Cps < int, int > () : (from y in factorialCps(x - 1) select x *y); Func <int, int> factorial = factorialCps.NoCps(); Assert.AreEqual(3 * 2 * 1, factorial(3)); // Functor law 1: F.Select(Id) == Id(F) Assert.AreEqual(factorialCps(3).Select(Functions.Id).Invoke(), Functions.Id(factorialCps(3)).Invoke()); // Functor law 2: F.Select(f2.o(f1)) == F.Select(f1).Select(f2) Func <int, int> addOne = x => x + 1; Func <int, int> addTwo = x => x + 2; Cps <int, int> cps1 = factorialCps(3).Select(addTwo.o(addOne)); Cps <int, int> cps2 = factorialCps(3).Select(addOne).Select(addTwo); Assert.AreEqual(cps1.Invoke(), cps2.Invoke()); }
private void BindData() { long Cpsid = Shove._Convert.StrToLong(Shove._Web.Utility.FilteSqlInfusion(Shove._Web.Utility.GetRequest("ID")), -1); Cps curCps = new Cps(); curCps.SiteID = _Site.ID; curCps.ID = Cpsid; string returndescription = string.Empty; curCps.GetCpsInformationByID(ref returndescription); string cacheKeyScaleList = "Cps_Admin_BonusScaleView_ScaleList_" + curCps.OwnerUserID.ToString(); DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(cacheKeyScaleList); if (dt == null ) { int returnValue=-1; string returnDescription=""; DataSet ds = null; int Result = DAL.Procedures.P_CpsGetUserBonusScaleList(ref ds, curCps.OwnerUserID, ref returnValue, ref returnDescription); if (Result < 0) { Shove._Web.JavaScript.Alert(this.Page, "系统出错!"); return; } if (ds == null || ds.Tables.Count < 1) { Shove._Web.JavaScript.Alert(this.Page, "获取数据出错!"); return; } dt = ds.Tables[0]; Shove._Web.Cache.SetCache(cacheKeyScaleList, dt, 100000); } PF.DataGridBindData(g, dt, gPager); }
public void Clone(Cps cps) { cps.ID = ID; cps.SiteID = SiteID; cps.OwnerUserID = OwnerUserID; cps.Name = Name; cps.DateTime = DateTime; cps.Url = Url; cps.LogoUrl = LogoUrl; cps.BonusScale = BonusScale; cps.ON = ON; cps.Company = Company; cps.Address = Address; cps.PostCode = PostCode; cps.ResponsiblePerson = ResponsiblePerson; cps.ContactPerson = ContactPerson; cps.Telephone = Telephone; cps.Fax = Fax; cps.Mobile = Mobile; cps.Email = Email; cps.QQ = QQ; cps.ServiceTelephone = ServiceTelephone; cps.MD5Key = MD5Key; cps.Type = Type; cps.DomainName = DomainName; cps.ParentID = ParentID; cps.OperatorID = OperatorID; cps.CommendID = CommendID; cps.Content = Content; cps.User = User; }
public int GetCpsInformationByID(ref string ReturnDescription) { if ((SiteID < 0) || (ID < 0)) { throw new Exception("Cps 尚未初始化 SiteID、 ID 变量,无法获取信息"); } int ReturnValue = -1; ReturnDescription = ""; Cps tp = new Cps(); Clone(tp); int Result = DAL.Procedures.P_GetCpsInformationByID(SiteID, ID, ref OwnerUserID, ref Name, ref DateTime, ref Url, ref LogoUrl, ref BonusScale, ref ON, ref Company, ref Address, ref PostCode, ref ResponsiblePerson, ref ContactPerson, ref Telephone, ref Fax, ref Mobile, ref Email, ref QQ, ref ServiceTelephone, ref MD5Key, ref Type, ref ParentID, ref DomainName, ref ReturnValue, ref ReturnDescription); if (Result < 0) { tp.Clone(this); ReturnDescription = "数据库读写错误"; return(-1); } if (ReturnValue < 0) { tp.Clone(this); return(ReturnValue); } return(Result); }
protected void btnOK_Click(object sender, EventArgs e) { string Cpsid = Shove._Convert.StrToLong(Shove._Web.Utility.FilteSqlInfusion(Shove._Web.Utility.GetRequest("ID")), -1).ToString(); Cps cps = new Cps(); cps.ID = Shove._Convert.StrToLong(Cpsid, -1); cps.SiteID = _Site.ID; string ReturnDescription = ""; cps.GetCpsInformationByID(ref ReturnDescription); string url = tbUrl.Text; if (!url.StartsWith("http://")) { url = "http://" + url; } Regex regex = new Regex(@"^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$", RegexOptions.IgnoreCase | RegexOptions.Compiled); Match m = regex.Match(url); if (!m.Success) { Shove._Web.JavaScript.Alert(this.Page, "网址填写错误"); return; } if (tbUrlName.Text.Trim() == "") { Shove._Web.JavaScript.Alert(this.Page, "请输入网站名称!"); return; } if (!Shove._String.Valid.isMobile(tbMobile.Text)) { Shove._Web.JavaScript.Alert(this.Page, "输入手机号码格式不正确。"); return; } if (!Shove._String.Valid.isEmail(tbEmail.Text)) { Shove._Web.JavaScript.Alert(this.Page, "输入Email格式不正确。"); return; } string DomainName = tbDomainName.Text; cps.Name = tbUrlName.Text; cps.Url = url; cps.MD5Key = tbMD5Key.Text; cps.ContactPerson = tbContactPerson.Text; cps.Telephone = tbPhone.Text; cps.Mobile = tbMobile.Text; cps.QQ = tbQQNum.Text; cps.Email = tbEmail.Text; cps.DomainName = DomainName; if (cps.DomainName.Trim() == "") { cps.DomainName = Shove._Web.Utility.GetUrl() + "/Default.aspx?cpsid=" + Shove._Web.Utility.GetRequest("ID"); } if (cps.EditByID(ref ReturnDescription) < 0) { Shove._Web.JavaScript.Alert(this.Page, ReturnDescription); return; } Shove._Web.JavaScript.Alert(this.Page, "基本信息修改成功!"); }
public Users(long siteid) { this.Site = new Sites(); this.HeadUrl = ""; this.cps = new Cps(this); this.Competences = new Competences(this); this.SiteID = siteid; this._id = -1L; this.Name = ""; this.NickName = ""; this.RealityName = ""; this.Password = ""; this.PasswordAdv = ""; this.Sex = "男"; this.BirthDay = DateTime.Parse("1980-01-01"); this.IDCardNumber = ""; this.CityID = 1; this.Address = ""; this.Email = ""; this.isEmailValided = false; this.QQ = ""; this.isQQValided = false; this.Telephone = ""; this.Mobile = ""; this.isMobileValided = false; this.isPrivacy = false; this.isCanLogin = true; this.RegisterTime = DateTime.Now; this.LastLoginTime = DateTime.Now; try { this.LastLoginIP = HttpContext.Current.Request.UserHostAddress; } catch { this.LastLoginIP = ""; } this.LoginCount = 0; this.UserType = 1; this.BankType = 1; this.BankName = ""; this.BankCardNumber = ""; this.Balance = 0.0; this.cardPasswordM = 0.0; this.Freeze = 0.0; this.ScoringOfSelfBuy = 0.0; this.ScoringOfCommendBuy = 0.0; this.Scoring = 0.0; this.Level = 0; this.CommenderID = -1L; this.CpsID = -1L; this.isAlipayCps = false; this.Bonus = 0.0; this.Reward = 0.0; this.AlipayID = ""; this.AlipayName = ""; this.isAlipayNameValided = false; this.Memo = ""; this.BonusThisMonth = 0.0; this.BonusAllow = 0.0; this.BonusUse = 0.0; this.PromotionMemberBonusScale = 0.0; this.PromotionSiteBonusScale = 0.0; this.OwnerSites = ""; this.ComeFrom = 0; this.IsCrossLogin = false; this.VisitSource = ""; this.HeadUrl = ""; this.SecurityQuestion = ""; this.SecurityAnswer = ""; this.FriendList = ""; this.Reason = ""; }
public int GetCpsInformationByID(ref string ReturnDescription) { if ((SiteID < 0) || (ID < 0)) { throw new Exception("Cps 尚未初始化 SiteID、 ID 变量,无法获取信息"); } int ReturnValue = -1; ReturnDescription = ""; Cps tp = new Cps(); Clone(tp); int Result = DAL.Procedures.P_GetCpsInformationByID(SiteID, ID, ref OwnerUserID, ref Name, ref DateTime, ref Url, ref LogoUrl, ref BonusScale, ref ON, ref Company, ref Address, ref PostCode, ref ResponsiblePerson, ref ContactPerson, ref Telephone, ref Fax, ref Mobile, ref Email, ref QQ, ref ServiceTelephone, ref MD5Key, ref Type, ref ParentID, ref DomainName, ref ReturnValue, ref ReturnDescription); if (Result < 0) { tp.Clone(this); ReturnDescription = "数据库读写错误"; return -1; } if (ReturnValue < 0) { tp.Clone(this); return ReturnValue; } return 0; }
public int GetCpsInformationByOwnerUserID(ref string ReturnDescription) { if ((this.SiteID < 0L) || (this.OwnerUserID < 0L)) { throw new Exception("Cps 尚未初始化 SiteID、 OwnerUserID 变量,无法获取信息"); } int returnValue = -1; ReturnDescription = ""; Cps cps = new Cps(); this.Clone(cps); if (Procedures.P_GetCpsInformationByOwnerUserID(this.SiteID, this.OwnerUserID, ref this.ID, ref this.Name, ref this.DateTime, ref this.Url, ref this.LogoUrl, ref this.BonusScale, ref this.ON, ref this.Company, ref this.Address, ref this.PostCode, ref this.ResponsiblePerson, ref this.ContactPerson, ref this.Telephone, ref this.Fax, ref this.Mobile, ref this.Email, ref this.QQ, ref this.ServiceTelephone, ref this.MD5Key, ref this.Type, ref this.ParentID, ref this.DomainName, ref returnValue, ref ReturnDescription) < 0) { cps.Clone(this); ReturnDescription = "数据库读写错误"; return -1; } if (returnValue < 0) { cps.Clone(this); return returnValue; } return 0; }
public Users(long siteid) { cps = new Cps(this); Competences = new Competences(this); SiteID = siteid; _id = -1; Name = ""; NickName = ""; RealityName = ""; Password = ""; PasswordAdv = ""; Sex = "男"; BirthDay = DateTime.Parse("1980-01-01"); IDCardNumber = ""; CityID = 1; Address = ""; Email = ""; isEmailValided = false; QQ = ""; isQQValided = false; Telephone = ""; Mobile = ""; isMobileValided = false; isPrivacy = false; isCanLogin = true; RegisterTime = DateTime.Now; LastLoginTime = DateTime.Now; try { LastLoginIP = System.Web.HttpContext.Current.Request.UserHostAddress; } catch { LastLoginIP = ""; } LoginCount = 0; UserType = 1; BankType = 1; BankName = ""; BankCardNumber = ""; Balance = 0; Freeze = 0; ScoringOfSelfBuy = 0; ScoringOfCommendBuy = 0; Scoring = 0; Level = 0; CommenderID = -1; CpsID = -1; isAlipayCps = false; Bonus = 0; Reward = 0; AlipayID = ""; AlipayName = ""; isAlipayNameValided = false; Memo = ""; BonusThisMonth = 0; BonusAllow = 0; BonusUse = 0; PromotionMemberBonusScale = 0; PromotionSiteBonusScale = 0; OwnerSites = ""; ComeFrom = 0; IsCrossLogin = false; VisitSource = ""; HeadUrl = ""; SecurityQuestion = ""; SecurityAnswer = ""; FriendList = ""; Reason = ""; }
private void Button_Copy3_Click(object sender, RoutedEventArgs e) { Cps.ShowDialog(); Cps = new ControlPoints(); }
public static T Invoke <T>(this Cps <T, T> cps) => cps(Functions.Id);