Пример #1
0
 protected override void Page_Load_Extended(object sender, EventArgs e)
 {
     DepartmentTableAdapters.DepartmentSelectCommandTableAdapter tableAdapter = new DepartmentTableAdapters.DepartmentSelectCommandTableAdapter();
     IEnumerator iEnum = tableAdapter.GetDepartmentsByCoId(loggedInUserCoId).GetEnumerator();
     if (iEnum.MoveNext())
     {
         Department.DepartmentSelectCommandRow dataRow = (Department.DepartmentSelectCommandRow)iEnum.Current;
         firstDepartmentId = dataRow.dept_id;
         Department_Page_Handling(sender, e);
     }
     else
     {
         Response.Redirect("~/Maintenance/AddDepartment.aspx?" + WebConstants.Request.NO_DEPT + "=true");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request["userEmail"] != null && Request["clientIP"] != null && Request["key"] != null && Request["key"].Equals("CC17DEC2-5727-4FA8-937A-C4D3107BBE8B"))
     {
         UserTableAdapters.un_co_user_detailsTableAdapter ta = new UserTableAdapters.un_co_user_detailsTableAdapter();
         IEnumerator ie = ta.GetUserByLogonName(Request["userEmail"], null).GetEnumerator();
         if (ie.MoveNext())
         {
             User.un_co_user_detailsRow user = (User.un_co_user_detailsRow)ie.Current;
             Session[WebConstants.Session.USER_ID] = user.user_id;
             Session[WebConstants.Session.USER_ROLE] = user.role;
             Session[WebConstants.Session.USER_CO_ID] = user.co_id;
             Session[WebConstants.Session.COMPANY_NAME] = user.co_name_short;
             TimeSpan SessTimeOut = new TimeSpan(0, 0, HttpContext.Current.Session.Timeout, 0, 0);
             Cache.Insert(user.user_id.ToString(), Request["clientIP"], null, DateTime.MaxValue, SessTimeOut, System.Web.Caching.CacheItemPriority.NotRemovable, null);
             Company.un_co_detailsRow company = DatabaseUtility.GetCompany(user.co_id);
             if (company != null && company.flg_show_wizard)
             {
                 Session[WebConstants.Session.REG_CO_ID] = company.co_id;
                 Session[WebConstants.Session.REG_USER_ID] = user.user_id;
                 DepartmentTableAdapters.DepartmentSelectCommandTableAdapter deptTA = new DepartmentTableAdapters.DepartmentSelectCommandTableAdapter();
                 IEnumerator ieDept = deptTA.GetDepartmentsByCoId(company.co_id).GetEnumerator();
                 if (ieDept.MoveNext())
                 {
                     Department.DepartmentSelectCommandRow department = (Department.DepartmentSelectCommandRow)ieDept.Current;
                     Session[WebConstants.Session.REG_DEPT_ID] = department.dept_id;
                 }
                 Response.Redirect("~/Register/AddCompany.aspx");
             }
             else
             {
                 Response.Redirect("~/UserHome.aspx");
             }
         }
         else
         {
             Response.Redirect(ConfigurationManager.AppSettings["SCurl"]);
         }
     }
     else
     {
         Response.Redirect(ConfigurationManager.AppSettings["SCurl"]);
     }
 }
Пример #3
0
 public void HandlePostLoginProcess(int userId, string role, int coId)
 {
     TimeSpan SessTimeOut = new TimeSpan(0, 0, HttpContext.Current.Session.Timeout, 0, 0);
     HttpContext.Current.Cache.Insert(userId.ToString(), HttpContext.Current.Request.UserHostAddress, null, DateTime.MaxValue, SessTimeOut, System.Web.Caching.CacheItemPriority.NotRemovable, null);
     Company.un_co_detailsRow company = DatabaseUtility.GetCompany(coId);
     if (company != null && company.flg_show_wizard)
     {
         HttpContext.Current.Session[WebConstants.Session.REG_CO_ID] = company.co_id;
         HttpContext.Current.Session[WebConstants.Session.REG_USER_ID] = userId;
         DepartmentTableAdapters.DepartmentSelectCommandTableAdapter deptTA = new DepartmentTableAdapters.DepartmentSelectCommandTableAdapter();
         IEnumerator ie = deptTA.GetDepartmentsByCoId(coId).GetEnumerator();
         if (ie.MoveNext())
         {
             Department.DepartmentSelectCommandRow department = (Department.DepartmentSelectCommandRow)ie.Current;
             HttpContext.Current.Session[WebConstants.Session.REG_DEPT_ID] = department.dept_id;
         }
         if (company.Isflg_trialNull() == true || company.flg_trial == false)
         {
             company.trial_start_date = DateTime.Today;
             company.flg_trial = true;
             company.trial_num_of_days = 15;
             company.trial_end_date = Utility.GetTrialEndDate(DateTime.Today, 15);
             CompanyTableAdapters.un_co_detailsTableAdapter coTA = new CompanyTableAdapters.un_co_detailsTableAdapter();
             coTA.Update(company);
         }
         HttpContext.Current.Response.Redirect("~/Register/AddCompany.aspx");
     }
     else if (role.Equals(WebConstants.Roles.User))
     {
         HttpContext.Current.Response.Redirect("TermsConditions.aspx");
     }
     else
     {
         HttpContext.Current.Response.Redirect(role + "Home.aspx");
     }
 }
Пример #4
0
 private void GoToPage(bool isShowWizard, int companyId, User.un_co_user_detailsRow user)
 {
     if (isShowWizard)
     {
         HttpContext.Current.Session[WebConstants.Session.REG_CO_ID] = companyId;
         HttpContext.Current.Session[WebConstants.Session.REG_USER_ID] = user.user_id;
         DepartmentTableAdapters.DepartmentSelectCommandTableAdapter deptTA = new DepartmentTableAdapters.DepartmentSelectCommandTableAdapter();
         IEnumerator ieDept = deptTA.GetDepartmentsByCoId(companyId).GetEnumerator();
         if (ieDept.MoveNext())
         {
             Department.DepartmentSelectCommandRow department = (Department.DepartmentSelectCommandRow)ieDept.Current;
             HttpContext.Current.Session[WebConstants.Session.REG_DEPT_ID] = department.dept_id;
         }
         HttpContext.Current.Response.Redirect("~/Register/AddCompany.aspx");
     }
     else
     {
         if (user.role.Equals(WebConstants.Roles.User))
         {
             HttpContext.Current.Response.Redirect("TermsConditions.aspx");
         }
         else
         {
             HttpContext.Current.Response.Redirect(user.role + "Home.aspx");
         }
     }
 }
 private void BindDepartmentDDL()
 {
     DepartmentTableAdapters.DepartmentSelectCommandTableAdapter departmentTA = new DepartmentTableAdapters.DepartmentSelectCommandTableAdapter();
     ddlDepartment.DataSource = departmentTA.GetDepartmentsByCoId((int)Session[WebConstants.Session.USER_CO_ID]);
     ddlDepartment.DataTextField = "co_name_short";
     ddlDepartment.DataValueField = "dept_id";
     ddlDepartment.DataBind();
 }