Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        public DCUser2 AuthenticateUser(string sessionid, string username, string pwd, string pwdattempts)
        {
            UserBiz     m_ubiz = new UserBiz();
            User2Detail dtuser = null;
            DCUser2     dcusr  = null;
            GroupBiz    m_gbiz = new GroupBiz();

            try
            {
                dtuser = m_ubiz.AuthenticateUser(CryptoUtils.DecryptTripleDES(username), CryptoUtils.DecryptTripleDES(pwd),
                                                 GMConvert.GetInt16(CryptoUtils.DecryptTripleDES(pwdattempts)));
                if (dtuser != null && dtuser.LastLogon.HasValue)
                {
                    dtuser.Permissions = new List <int>();
                    List <Int32> groups = m_ubiz.GetGroups(dtuser.ID);
                    foreach (int group in groups)
                    {
                        dtuser.Permissions.AddRange(m_gbiz.GetPermissions(group));
                    }

                    dcusr = new DCUser2();
                    GMReflectionUtils.Copy(dtuser, dcusr);
                    SetCache(sessionid, dcusr);
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
            finally { m_ubiz.Dispose(); m_gbiz.Dispose(); }
            return(dcusr);
        }
Exemplo n.º 3
0
 protected string GetRedirectURL(string url, params object[] qs)
 {
     if (GMConvert.GetString(url).Length > 0)
     {
         StringBuilder sb  = null;
         Int16         len = 0;
         if (qs != null)
         {
             len = (Int16)qs.GetLength(0);
             if ((len % 2 == 0) && (len > 1))
             {
                 sb = new StringBuilder();
                 for (Int16 ix = 0; ix < len; ix++)
                 {
                     if (ix != 0)
                     {
                         sb.Append(GeneralConstants.QueryStringSeparator);
                     }
                     sb.AppendFormat("{0}{1}{2}", qs[ix], GeneralConstants.EqualOperator, qs[ix + 1]);
                     ix++;
                 }
             }
         }
         return(string.Format("{0}?{1}{2}{3}", string.Format(@"{0}\{1}", Request.ApplicationPath, url), (len != 0) ? GeneralConstants.QueryStringName : string.Empty, (len != 0) ? GeneralConstants.EqualOperator : string.Empty,
                              ((sb != null) ? System.Web.HttpContext.Current.Server.UrlEncode(CryptoUtils.EncryptTripleDES(sb.ToString())) : string.Empty)));
     }
     return("");
 }
Exemplo n.º 4
0
 protected void Redirect(string url, params object[] qs)
 {
     if (GMConvert.GetString(url).Length > 0)
     {
         Response.Redirect(GetRedirectURL(url, qs));
     }
 }
Exemplo n.º 5
0
 private void SetErrorMessage(string msg)
 {
     lblErrorMsg.Text = msg;
     if (GMConvert.GetString(lblErrorMsg.Text).Length > 0 && !this.Page.ClientScript.IsStartupScriptRegistered(this.ID))
     {
         this.Page.ClientScript.RegisterStartupScript(this.GetType(), this.ID, UCConstants.Seterrortdon, true);
     }
 }
Exemplo n.º 6
0
        // Override the ProcessRequest method
        public void ProcessRequest(HttpContext context)
        {
            string ns = context.Request[QueryStringConstants.NamespaceAjax];

            if (GMConvert.GetString(ns).Length > 0)
            {
                ProcessCall(ns, context);
            }
        }
Exemplo n.º 7
0
        public void Save(DataTable dt, BatchDetail batchDet, string sessionid)
        {
            BatchRecordDetail det;
            string            strDate, strTime;
            int iPass = 0, iFail = 0, iBlank = 0, iType = 0;

            foreach (DataRow dr in dt.Rows)
            {
                det = new BatchRecordDetail();
                try
                {
                    if (DataUtils.GetColumnValue(dr, BatchUploadConstants.Name).Length > 0)
                    {
                        det.BatchID       = batchDet.ID;
                        det.CompanyID     = batchDet.CompanyID;
                        strDate           = DataUtils.GetColumnValue(dr, BatchUploadConstants.ReceivedDate);
                        strTime           = DataUtils.GetColumnValue(dr, BatchUploadConstants.ReceivedTime);
                        det.ReceivedDate  = Convert.ToDateTime(strDate);
                        det.CustomerRefNo = DataUtils.GetColumnValue(dr, BatchUploadConstants.CustomerRefNo);
                        det.LeadNo        = GMConvert.GetInt32(DataUtils.GetColumnValue(dr, BatchUploadConstants.LeadNumber));
                        det.CountyID      = GMConvert.GetInt32(DataUtils.GetColumnValue(dr, BatchUploadConstants.CountyID));
                        det.Name          = DataUtils.GetColumnValue(dr, BatchUploadConstants.Name);
                        det.DOB           = Convert.ToDateTime(DataUtils.GetColumnValue(dr, BatchUploadConstants.DOB));
                        iType             = GMConvert.GetInt32(DataUtils.GetColumnValue(dr, BatchUploadConstants.CaseTypeID));
                        if (iType > 0)
                        {
                            det.CaseTypeID = iType;
                        }
                        det.RecordStatusID   = Convert.ToInt32(BatchUploadConstants.EnumRecordStatusType.RESEARCH);
                        det.Years            = GMConvert.GetInt32(DataUtils.GetColumnValue(dr, BatchUploadConstants.Years));
                        det.SSN              = DataUtils.GetColumnValue(dr, BatchUploadConstants.SSN);
                        det.ClientRemarks    = DataUtils.GetColumnValue(dr, BatchUploadConstants.ClientRemarks);
                        det.ClientSplRemarks = DataUtils.GetColumnValue(dr, BatchUploadConstants.ClientSplRemarks);
                        det.ActualCaseType   = DataUtils.GetColumnValue(dr, BatchUploadConstants.ActualCaseType);
                        Save(det);
                        SaveRecordHistory(det.ID, det.RecordStatusID, batchDet.UserID);
                        iPass += 1;
                    }
                    else
                    {
                        iBlank += 1;
                    }
                }
                catch (Exception ex)
                {
                    iFail += 1;
                    m_msg.Add(string.Format(ErrorConstants.BatchSaveFailed, det.Name));
                    Logger.LogException(ex);
                }
            }
            batchDet.FailCount  = iFail;
            batchDet.PassCount  = iPass;
            batchDet.TotalCount = dt.Rows.Count - iBlank;
        }
Exemplo n.º 8
0
        void DisplayByCaseType()
        {
            bool iscivil = GMConvert.GetBool(hdnIsCivil.Value);

            lblSentencingDetails.Visible = grvCaseRecord.Visible = btnAddCaseRecord.Visible = txtProbationType.Visible = txtRestitution.Visible = txtJailCredit.Visible = txtFileFee.Visible = txtJail.Visible =
                txtDOBFound.Visible      = txtViolationDate.Visible = !iscivil;

            txtCaseName.Visible = txtPlaintiff.Visible = txtStatusJudgment.Visible = txtDefendant.Visible = txtCaseTypeLevel.Visible = txtDistrictCourt.Visible = iscivil;

            if (iscivil)
            {
                txtSentencingDetail.Label = "Comments:";
            }
        }
Exemplo n.º 9
0
        void DisplayByCaseType()
        {
            bool iscivil = GMConvert.GetBool(hdnIsCivil.Value);

            DataUtils.SetVisible(grdCase, (int)ColumnOrder.ViolationDate, !iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.FileDate, !iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.DispoDate, !iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.CaseCount, !iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.ProbationType, !iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.FileFee, !iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.Restitution, !iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.DistrictCourt, iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.CaseTypeLevel, iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.CaseName, iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.Plaintiff, iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.Defendant, iscivil);
            DataUtils.SetVisible(grdCase, (int)ColumnOrder.StatusJudgment, iscivil);
        }
Exemplo n.º 10
0
        protected void DisplayByCaseType(GridView grdCase, dynamic iscivil)
        {
            bool ciscivil = GMConvert.GetBool(iscivil);

            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.ViolationDate, !ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.FileDate, !ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.DispoDate, !ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.CaseCount, !ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.ProbationType, !ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.FileFee, !ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.Restitution, !ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.DistrictCourt, ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.CaseTypeLevel, ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.CaseName, ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.Plaintiff, ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.Defendant, ciscivil);
            DataUtils.SetVisible(grdCase, (int)Entity.ColumnOrder.StatusJudgment, ciscivil);
        }
Exemplo n.º 11
0
        public void ChangePassword(string sessionid, string userid, string oldpwd, string newpwd)
        {
            DCUser2 dcusr = GetCache(sessionid);

            if (string.Compare(dcusr.Password, CryptoUtils.EncryptSHA(oldpwd), true) != 0)
            {
                throw new ApplicationException(ErrorConstants.ExistingPassword);
            }
            User2Detail detusr = new User2Detail();

            detusr.ID                 = (Int32?)GMConvert.GetInt32(userid);
            detusr.Password           = CryptoUtils.EncryptSHA(newpwd);
            detusr.LastPassword       = CryptoUtils.EncryptSHA(oldpwd);
            detusr.PasswordChangeDate = DateTime.Now;
            detusr.IsChangePasssword  = false;
            detusr.ModifiedDate       = DateTime.Now;
            Save(detusr);
            dcusr.Password          = CryptoUtils.EncryptSHA(newpwd);
            dcusr.IsChangePasssword = false;
        }
Exemplo n.º 12
0
 protected virtual void Page_Load(object sender, EventArgs e)
 {
     if (SessionID.Length == 0)
     {
         SessionID = Session.SessionID;
     }
     if (!(this.Request.Url.AbsolutePath.ToLower().IndexOf(UIConstants.LoginAspx) != -1) && !HasToken())
     {
         LogOut();
     }
     else
     {
         m_query = GMConvert.GetString(this.Request.QueryString[GeneralConstants.QueryStringName]);
         if (!this.IsPostBack)
         {
             if (!ClientScript.IsStartupScriptRegistered(UCConstants.Unload))
             {
                 ClientScript.RegisterStartupScript(this.GetType(), UCConstants.Unload, string.Format("{0}('{1}','{2}','{3}');", UCConstants.Unload, UIConstants.DefaultAspx, GeneralConstants.EventTarget, GeneralConstants.Logout), true);
             }
         }
     }
 }
Exemplo n.º 13
0
 protected void OnDelete(object sender, GridViewDeleteEventArgs e)
 {
     grvCountyRate.Rows[e.RowIndex].Visible = false;
     m_biz.Delete(GMConvert.GetInt32(grvCountyRate.DataKeys[e.RowIndex].Value));
     Bind();
 }
Exemplo n.º 14
0
 public DCCase2(DataRow dr)
     : this(GMConvert.GetInt32(dr[Case2Record.ID.ToString()]), dr[Case2Record.Description.ToString()].ToString(), GMConvert.GetInt32(dr[Case2Record.LevelTypeID.ToString()]),
            GMConvert.GetInt32(dr[Case2Record.PleaTypeID.ToString()]), GMConvert.GetInt32(dr[Case2Record.DispositionTypeID.ToString()]))
 {
 }
Exemplo n.º 15
0
 public DCCase2(GridView gv, GridViewRow gvr)
     : this(GMConvert.GetInt32(gv.DataKeys[gvr.RowIndex].Value), DataUtils.GetText(gvr, (int)Case2Record.Description), DataUtils.GetID(gvr, (int)Case2Record.LevelTypeID),
            DataUtils.GetID(gvr, (int)Case2Record.PleaTypeID), DataUtils.GetID(gvr, (int)Case2Record.DispositionTypeID))
 {
 }
Exemplo n.º 16
0
 string GetQueryValue(string qname)
 {
     return(GMConvert.GetString(this.Request.QueryString[qname]));
 }