protected void ValidateToken(BaseDC bdc, string userid, string returnurl) { if (bdc == null) { throw new ApplicationException(GeneralConstants.UserNotExist); } else if (bdc.IsActive.HasValue && !bdc.IsActive.Value) { throw new ApplicationException(GeneralConstants.Useractive); } else if (bdc.IsLocked.HasValue && !bdc.IsLocked.Value) { throw new ApplicationException(GeneralConstants.Userlocked); } else { Label lblName = (Label)this.Page.Master.FindControl(UCConstants.UserName); if (lblName != null) { lblName.Text = bdc.Username; } if (GMConvert.GetString(userid).Length > 0) { System.Web.Security.FormsAuthentication.RedirectFromLoginPage(userid, false); } GMReflectionUtils.InvokeMember(this.Page, ReflectionConstants.Redirect, (bdc.IsChangePasssword.HasValue && bdc.IsChangePasssword.Value == true) ? new object[] { UIConstants.ChangePwdAspx, QueryStringConstants.UserID, bdc.ID } : new object[] { returnurl }, EnumConstants.InvokeMethod); } }
dynamic ExecuteAction(string actionname, BaseDC bdc, object param) { dynamic di = GMReflectionUtils.GetInstance(GMReflectionUtils.GetHandler <Handler>(bdc.GetType()).TypeH); di.GetHeaderToken(bdc); dynamic rv = GMReflectionUtils.InvokeMember(di, actionname, new object[] { param }); di.Dispose(); return(rv); }
public BaseDC GetHeaderToken(BaseDC bdc) { DCUser2 dcusr = GetToken(); bdc.IsActive = dcusr.IsActive; bdc.IsChangePasssword = dcusr.IsChangePasssword; bdc.IsLocked = dcusr.IsLocked; bdc.UserID = dcusr.ID; bdc.Username = string.Format("( {0} {1}, Log-in Time: {2} )", dcusr.FirstName, dcusr.LastName, dcusr.LastLogon.Value.ToShortTimeString()); return(bdc); }
public BaseDC ChangePassword(DCChangePassword cp) { if (string.Compare(cp.NewPassword, cp.ConfirmNewPassword, true) != 0) { throw new ApplicationException(ErrorConstants.Passwordmatch); } BaseDC bdc = null; m_uf.ChangePassword(CryptoUtils.EncryptTripleDES(cp.SessionID), CryptoUtils.EncryptTripleDES(cp.ID.ToString()), CryptoUtils.EncryptTripleDES(cp.Password), CryptoUtils.EncryptTripleDES(cp.NewPassword)); bdc = GetHeaderToken((bdc = cp)); return(bdc); }
private void NewDCPopupAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(NonPersistentBaseObject)); baseDC = objectSpace.CreateObject <BaseDC>(); baseDC.Name = "Base"; baseDC.Items = GetItemsToItemsDC(objectSpace); objectSpace.CommitChanges(); DetailView view = Application.CreateDetailView(objectSpace, baseDC); view.ViewEditMode = ViewEditMode.Edit; e.View = view; }
BaseDC ExecuteAction(string actionname, bool isgetfromctl) { BaseDC bdc = GetDCInstance(); if (PageID > 0) { bdc.ID = PageID; } bdc.SessionID = CryptoUtils.EncryptTripleDES(SessionID); if (isgetfromctl) { FillUIValues(bdc); //To save information get the values from the control } bdc = (BaseDC)ExecuteAction(actionname, bdc, bdc); ValidateToken(bdc); if (!isgetfromctl) { UIUtilities.SetlValues(this.ControlsCollection, new object[] { bdc }); //To set value back to the control from Datacontract. } return(bdc); }
public BaseDC Method_BaseDC(BaseDC obj1) { return(obj1); }
public BaseDC Method_BaseDC_ref(ref BaseDC obj1) { return(obj1); }
public void Method_BaseDC_out(BaseDC obj1, out BaseDC obj2) { obj2 = obj1; return; }
protected void ValidateToken(BaseDC bdc) { ValidateToken(bdc, string.Empty, string.Empty); }
protected void FillUIValues(BaseDC instance) { FillUIValues(new BaseDC[] { instance }); }