예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //删除
            if (Request.QueryString["limit"] == "del")
            {
                string ids   = Request.QueryString["id"].ToString();
                int    count = WebCommon.Public.DataTableDel("tbl_ProjectBuilderLog", "id in(" + ids + ")");
                if (count > 0)
                {
                    WebCommon.Script.Redirect(WebCommon.Public.GetFromUrl());
                }
                else
                {
                    WebCommon.Script.AlertAndGoBack("删除失败!");
                }
            }
            //绑定列表
            string strWhere = "";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere = Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebBLL.Tbl_ProjectBuilderLogManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_ProjectBuilderLogManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, " id desc");
            ProjectList.DataBind();
        }
예제 #2
0
        public void Bind()
        {
            string projectid = WebCommon.Public.ToString(Request.QueryString["ProjectID"]);
            string wherePlus = "1=1";

            if (projectid != "")
            {
                wherePlus += " and projectid=" + projectid;
            }
            //string status = WebCommon.Public.ToString(Request.QueryString["Status"]);
            if (status != "")
            {
                wherePlus += " and status='" + status + "'";
            }
            string strWhere = wherePlus + " and (NodeUser like '%" + WebCommon.Public.GetUserName() + "%' or DT_SheJiRen='" + WebCommon.Public.GetUserName() + "' or DT_JiaoDuiRen='" + WebCommon.Public.GetUserName() + "' or DT_ShenHeRen='" + WebCommon.Public.GetUserName() + "' or DT_ShenDingRen='" + WebCommon.Public.GetUserName() + "')";

            string where = WebCommon.Public.ToString(Request.QueryString["where"]);
            if (where != "")
            {
                strWhere += " and (" + where + ")";
            }


            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebBLL.Tbl_DesignTaskManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_DesignTaskManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "id desc");
            ProjectList.DataBind();
        }
예제 #3
0
        void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Page.User.IsInRole("ProjectAdministrator"))
                {
                    ProjectData.SelectMethod = "GetAllProjects";
                }
                else
                {
                    ProjectData.SelectParameters.Add(new Parameter("userName", TypeCode.String, Page.User.Identity.Name));
                    ProjectData.SelectParameters.Add(new Parameter("sortParameter", TypeCode.String, string.Empty));
                    ProjectData.SelectMethod = "GetProjectsByManagerUserName";
                }
                ProjectList.DataBind();

                UserData.SelectParameters.Add(new Parameter("userNames", TypeCode.String, BuildValueList(ProjectList.Items, false)));
                UserData.SelectMethod = "GetProjectMembers";

                DateTime startingDate = DefaultValues.GetDateTimeMinValue();
                DateTime endDate      = DateTime.Now;
                StartDate.Text = startingDate.ToString("d");
                EndDate.Text   = endDate.ToString("d");
            }
        }
예제 #4
0
        public void Bind()
        {
            string strWhere = "(tbl_designcorrect.NodeUser like '%" + WebCommon.Public.GetUserName() + "%' or UserName='******' or DT_JiaoDuiRen='" + WebCommon.Public.GetUserName() + "' or DT_ShenHeRen='" + WebCommon.Public.GetUserName() + "' or DT_ShenDingRen='" + WebCommon.Public.GetUserName() + "')";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere += " and " + Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 6;
            AspNetPager1.RecordCount = WebBLL.Tbl_DesignCorrectManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_DesignCorrectManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "tbl_DesignCorrect.id desc");
            ProjectList.DataBind();
        }
        public void Bind()
        {
            string strWhere = "parentid=0";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere += " and " + Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebBLL.Tbl_FlowWorkLogManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_FlowWorkLogManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "id desc");
            ProjectList.DataBind();
        }
        public void Bind()
        {
            string strWhere = "";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere = Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebBLL.Tbl_ProjectArchiveVersionManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_ProjectArchiveVersionManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "a.id desc");
            ProjectList.DataBind();
        }
예제 #7
0
        public void Bind()
        {
            string strWhere = "(NodeUser='******' or UserName='******') and RequestType='" + Request.QueryString["limit"] + "'";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere += " and " + Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebBLL.Tbl_ProjectArchiveRequestManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_ProjectArchiveRequestManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "id desc");
            ProjectList.DataBind();
        }
        void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if ((Page.User.IsInRole("ProjectAdministrator") || Page.User.IsInRole("ProjectManager")))
                {
                    UserList.DataSourceID = "ProjectMembers";

                    if (Page.User.IsInRole("ProjectAdministrator"))
                    {
                        ProjectData.SortParameterName = "sortParameter";
                        ProjectData.SelectMethod      = "GetAllProjects";
                    }
                    else if (Page.User.IsInRole("ProjectManager"))
                    {
                        ProjectData.SelectParameters.Add(new Parameter("userName", TypeCode.String, Page.User.Identity.Name));
                        ProjectData.SortParameterName = "sortParameter";
                        ProjectData.SelectMethod      = "GetProjectsByManagerUserName";
                    }
                }
                else
                {
                    ProjectData.SelectParameters.Add(new Parameter("userName", TypeCode.String, Page.User.Identity.Name));
                    ProjectData.SelectMethod = "GetProjectsByUserName";

                    UserList.Items.Add(Page.User.Identity.Name);
                }
                ProjectList.DataBind();
                UserList.DataBind();
                ProjectListGridView.DataBind();

                if (ProjectList.Items.Count >= 1)
                {
                    TimeEntryView.Visible = true;
                    MessageView.Visible   = false;
                }
                else
                {
                    TimeEntryView.Visible = false;
                    MessageView.Visible   = true;
                }
            }
            if (UserList.Items.Count == 0)
            {
                AddEntry.Enabled = false;
            }
        }
예제 #9
0
        public void Bind()
        {
            //string strWhere = "classname='" + WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).U_Specialty + "'";
            string strWhere = "username='******' or PD_Users='" + WebCommon.Public.GetUserName() + "'";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere = Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebBLL.Tbl_ProjectDocumentManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_ProjectDocumentManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "id desc");
            ProjectList.DataBind();
        }
 void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Page.User.IsInRole("ProjectAdministrator"))
         {
             ProjectData.SelectMethod = "GetAllProjects";
         }
         else
         {
             ProjectData.SelectParameters.Add(new Parameter("userName", TypeCode.String, Page.User.Identity.Name));
             ProjectData.SelectParameters.Add(new Parameter("sortParameter", TypeCode.String, string.Empty));
             ProjectData.SelectMethod = "GetProjectsByManagerUserName";
         }
         ProjectList.DataBind();
     }
 }
예제 #11
0
        public void Bind()
        {
            string sql      = "SELECT top 100 percent MAX(ID) AS ID,MAX(ClassName1) AS ClassName1, MAX(ClassName2) AS ClassName2, MAX(ClassName3) AS ClassName3, COUNT(*) AS TaskNum FROM Tbl_DesignVolume where dealflag=0 and " + wheres + " GROUP BY  ClassName1,ClassName2";
            string strWhere = "1=1";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere = Request.QueryString["where"];
                sql      = "SELECT top 100 percent MAX(ID) AS ID,MAX(ClassName1) AS ClassName1, MAX(ClassName2) AS ClassName2, MAX(ClassName3) AS ClassName3, COUNT(*) AS TaskNum FROM Tbl_DesignVolume where " + strWhere + " and (dealflag=0) GROUP BY  ClassName1,ClassName2";
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebCommon.Public.GetDataTableByCount(sql);

            //绑定分页数据
            ProjectList.DataSource = WebCommon.Public.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sql, "ClassName1 asc,ClassName2 asc");
            ProjectList.DataBind();
        }
예제 #12
0
        public void Bind()
        {
            string sql      = "SELECT top 100 percent MAX(ProjectID) AS ProjectID,MAX(ProjectName) AS ProjectName, MAX(ClassName1) AS ClassName1, MAX(DesignManager) AS DesignManager,MAX(DesignMain) AS DesignMain, MAX(AddDate) AS AddDate, COUNT(*) AS TaskNum FROM Tbl_DesignTask where dealflag=0 GROUP BY ProjectID, ClassName1";
            string strWhere = "1=1";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere = Request.QueryString["where"];
                sql      = "SELECT top 100 percent MAX(ProjectID) AS ProjectID,MAX(ProjectName) AS ProjectName, MAX(ClassName1) AS ClassName1, MAX(DesignManager) AS DesignManager,MAX(DesignMain) AS DesignMain, MAX(AddDate) AS AddDate, COUNT(*) AS TaskNum FROM Tbl_DesignTask where " + strWhere + " and (dealflag=0) GROUP BY ProjectID, ClassName1";
            }
            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebCommon.Public.GetDataTableByCount(sql);

            //绑定分页数据
            ProjectList.DataSource = WebCommon.Public.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sql, "adddate desc");
            ProjectList.DataBind();
        }
예제 #13
0
        public void Bind()
        {
            string strWhere = "1=1";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere = Request.QueryString["where"];
            }
            string Sql = "select * from tbl_flowwork where dealflag=0 and " + strWhere;

            //分页设置
            AspNetPager1.PageSize    = 5;
            AspNetPager1.RecordCount = WebCommon.Public.GetDataTableByCount(Sql);

            //绑定分页数据
            ProjectList.DataSource = WebCommon.Public.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, Sql, "");
            ProjectList.DataBind();
        }
예제 #14
0
        public void Bind()
        {
            string strWhere = "1=1";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere = Request.QueryString["where"];
            }
            String Sql = "SELECT Tbl_ProjectContract.*,Tbl_Project.ProjectNo, Tbl_Project.ProjectName,Tbl_Project.ProjectCustom, Tbl_Project.ProjectManager, Tbl_Project.ProjectCustomContact,Tbl_Project.ProjectCustomPhone, Tbl_Project.ProjectStartTime, Tbl_Project.ProjectEndTime, Tbl_Project.ProjectTypes,Tbl_Project.ProjectCity, Tbl_Project.ProjectLevel, Tbl_Project.ProjectInfo FROM  Tbl_ProjectContract LEFT OUTER JOIN Tbl_Project ON Tbl_ProjectContract.ProjectID = Tbl_Project.ID where Tbl_ProjectContract.dealflag=0 and " + strWhere;

            //分页设置
            AspNetPager1.PageSize    = 15;
            AspNetPager1.RecordCount = WebCommon.Public.GetDataTableByCount(Sql);

            //绑定分页数据
            ProjectList.DataSource = WebCommon.Public.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, Sql, "");
            ProjectList.DataBind();
        }
예제 #15
0
    protected void AssignUser_Click(object sender, EventArgs e)
    {
        divAddProject.Visible           = false;
        divAssignResourcePerson.Visible = true;
        divShowMine.Visible             = false;

        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["LoginConnectionString"].ConnectionString);

        con.Open();

        String         test = "select Name from ProjectInformation";
        SqlCommand     com  = new SqlCommand(test, con);
        SqlDataAdapter da   = new SqlDataAdapter(com);
        DataSet        ds   = new DataSet();

        da.Fill(ds);                                                         // fill dataset
        ProjectList.DataTextField = ds.Tables[0].Columns["Name"].ToString(); // text field name of table dispalyed in dropdown
        /*ProjectList.DataValueField = ds.Tables[0].Columns["id"].ToString();             // to retrive specific  textfield name */
        ProjectList.DataSource = ds.Tables[0];                               //assigning datasource to the dropdownlist
        ProjectList.DataBind();

        test = "select Name from ProjectInformation";
        com  = new SqlCommand(test, con);
        da   = new SqlDataAdapter(com);
        ds   = new DataSet();
        da.Fill(ds);                                                          // fill dataset
        ProjectList2.DataTextField = ds.Tables[0].Columns["Name"].ToString(); // text field name of table dispalyed in dropdown
        /*ProjectList.DataValueField = ds.Tables[0].Columns["id"].ToString();             // to retrive specific  textfield name */
        ProjectList2.DataSource = ds.Tables[0];                               //assigning datasource to the dropdownlist
        ProjectList2.DataBind();

        test = "select Name, Designation from LoginInformation where Designation not in('IT Admin')";
        com  = new SqlCommand(test, con);
        da   = new SqlDataAdapter(com);
        ds   = new DataSet();
        da.Fill(ds);                                                                // fill dataset
        ResourcePersonList.DataTextField = ds.Tables[0].Columns["Name"].ToString(); // text field name of table dispalyed in dropdown
        /*ProjectList.DataValueField = ds.Tables[0].Columns["id"].ToString();             // to retrive specific  textfield name */
        ResourcePersonList.DataSource = ds.Tables[0];                               //assigning datasource to the dropdownlist
        ResourcePersonList.DataBind();


        con.Close();
    }
        //*******************************************************
        //
        // BindProjectList method populates the DropDownList ProjectList to show
        // list of projects that belongs to the user.
        //
        //*******************************************************

        private void BindProjectList()
        {
            // Preserve the selected value so information is still there after postback.
            if (ProjectList.SelectedItem != null)
            {
                _userInput.ProjectID = Convert.ToInt32(ProjectList.SelectedItem.Value);
            }

            ProjectList.DataSource     = ListUserProjects();
            ProjectList.DataTextField  = "Name";
            ProjectList.DataValueField = "ProjectID";
            ProjectList.DataBind();

            // Select the correct item from ProjectList.
            if (ProjectList.Items.FindByValue(_userInput.ProjectID.ToString()) != null)
            {
                ProjectList.Items.FindByValue(_userInput.ProjectID.ToString()).Selected = true;
            }
        }
예제 #17
0
        public void Bind()
        {
            string strWhere = "Tbl_DesignCorrect.status='结束'";

            if (WebCommon.Public.ToString(Request.QueryString["where"]) != "")
            {
                strWhere += " and " + Request.QueryString["where"];
            }
            //分页设置
            AspNetPager1.PageSize    = 50;
            AspNetPager1.RecordCount = WebBLL.Tbl_DesignCorrectManager.GetDataTableByCount(strWhere);

            //绑定分页数据
            ProjectList.DataSource = WebBLL.Tbl_DesignCorrectManager.GetDataTableByPage(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, strWhere, "");
            ProjectList.DataBind();

            //统计结果
            System.Data.DataTable dt = WebBLL.Tbl_DesignCorrectManager.GetDataTableByStatistics(strWhere);
            Label1.Text = dt.Rows[0][0].ToString();
            Label2.Text = dt.Rows[0][1].ToString();
            Label3.Text = dt.Rows[0][2].ToString();
        }
예제 #18
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!Request.IsAuthenticated || LUser == null || LUser.LoginName.ToLower() == "anonymous")
                {
                    string loginUrl = System.Web.Security.FormsAuthentication.LoginUrl;
                    if (string.IsNullOrEmpty(loginUrl))
                    {
                        loginUrl = "~/MyAccount.aspx";
                    }
                    SignIn.Visible        = true; SignIn.NavigateUrl = loginUrl + (loginUrl.Contains("?") ? "&" : "?") + "logo=N";
                    SignoutPanel.Visible  = false;
                    cLoginName.Visible    = false;
                    cAppDomainUrl.Visible = false;
                    return;
                }
                else
                {
                    string extAppDomainUrl =
                        !string.IsNullOrWhiteSpace(System.Configuration.ConfigurationManager.AppSettings["ExtBaseUrl"])
                            ? System.Configuration.ConfigurationManager.AppSettings["ExtBaseUrl"]
                            : Request.Url.AbsoluteUri.Replace(Request.Url.Query, "").Replace(Request.Url.Segments[Request.Url.Segments.Length - 1], "");
                    cAppDomainUrl.Text    = extAppDomainUrl.EndsWith("/") ? extAppDomainUrl.Substring(0, extAppDomainUrl.Length - 1) : extAppDomainUrl;
                    cAppDomainUrl.Visible = true;
                    SignIn.Visible        = false;
                    SignoutPanel.Visible  = true;
                    cLoginName.Text       = LUser.LoginName;
                    cLoginName.Visible    = true;
                }
                if (LUser != null)
                {
                    if (base.LPref != null)
                    {
                        switch (base.LPref.SysListVisible)
                        {
                        case "N":
                            SystemsLabel.Visible = false; SystemsList.Visible = false; SystemsList.Enabled = true; CurrSys.Visible = false; break;

                        case "R":
                            SystemsLabel.Visible = true; SystemsList.Visible = true; SystemsList.Enabled = false; CurrSys.Visible = true; break;

                        default:
                            SystemsLabel.Visible = true; SystemsList.Visible = true; SystemsList.Enabled = true; CurrSys.Visible = true; break;
                        }
                        switch (base.LPref.PrjListVisible)
                        {
                        case "N":
                            ProjectLabel.Visible = false; ProjectList.Visible = false; ProjectList.Enabled = true; CurrPrj.Visible = false; break;

                        case "R":
                            ProjectLabel.Visible = true; ProjectList.Visible = true; ProjectList.Enabled = false; CurrPrj.Visible = true; break;

                        default:
                            ProjectLabel.Visible = true; ProjectList.Visible = true; ProjectList.Enabled = true; CurrPrj.Visible = true; break;
                        }
                        switch (base.LPref.ComListVisible)
                        {
                        case "N":
                            CompanyLabel.Visible = false; CompanyList.Visible = false; CompanyList.Enabled = true; CurrCmp.Visible = false; break;

                        case "R":
                            CompanyLabel.Visible = true; CompanyList.Visible = true; CompanyList.Enabled = false; CurrCmp.Visible = true; break;

                        default:
                            CompanyLabel.Visible = true; CompanyList.Visible = true; CompanyList.Enabled = true; CurrCmp.Visible = true; break;
                        }
                    }

                    CompanyList.Attributes["onchange"] = "javascript:return CanPostBack(true, this);"; CompanyList.Attributes["NeedConfirm"] = "Y";
                    ProjectList.Attributes["onchange"] = "javascript:return CanPostBack(true, this);"; ProjectList.Attributes["NeedConfirm"] = "Y";
                    SystemsList.Attributes["onchange"] = "javascript:return CanPostBack(true, this);"; SystemsList.Attributes["NeedConfirm"] = "Y";

                    UserLabel.Text = LUser != null ? LUser.UsrName : Context.User.Identity.Name;
                    if (LUser.HasPic)
                    {
                        UsrPic.ImageUrl = base.GetUrlWithQSHash("~/DnLoad.aspx?key=" + LUser.UsrId.ToString() + "&tbl=dbo.Usr&knm=UsrId&col=PicMed&sys=3"); UsrPic.Visible = true;
                    }

                    SystemsList.DataSource  = GetSystemsList();
                    CompanyList.DataSource  = GetCompanyList();
                    ProjectList.DataSource  = GetProjectList();
                    TimeZoneList.DataSource = GetTimeZoneList();

                    TranslateItems();

                    this.DataBind();
                    try { SystemsList.SelectedValue = LCurr.SystemId.ToString(); CurrSys.Text = SystemsList.SelectedItem.Text; }
                    catch { }
                    try { CompanyList.SelectedValue = LCurr.CompanyId.ToString(); CurrCmp.Text = CompanyList.SelectedItem.Text; }
                    catch { }
                    try { ProjectList.SelectedValue = LCurr.ProjectId.ToString(); CurrPrj.Text = ProjectList.SelectedItem.Text; }
                    catch { }
                    try { TimeZoneList.SelectedValue = CurrTimeZoneInfo().Id; }
                    catch { }
                    cMyAccountLink.NavigateUrl = System.Web.Security.FormsAuthentication.LoginUrl; // +(Request.QueryString["typ"] != null ? "?typ=" + Request.QueryString["typ"] : "");
                }
            }
            else if (Request.IsAuthenticated && base.LUser != null)     // Get around selectedIndexChange event not triggered because of viewstate-in-session.
            {
                if (SystemsList.Items.Count <= 0 && Request.Params["__EVENTTARGET"] == SystemsList.UniqueID)
                {
                    SystemsList.DataSource    = GetSystemsList(); SystemsList.DataBind();
                    SystemsList.SelectedValue = Request.Params[SystemsList.UniqueID];
                    SystemsList_SelectedIndexChanged(SystemsList, new EventArgs());
                }
                if (CompanyList.Items.Count <= 0 && Request.Params["__EVENTTARGET"] == CompanyList.UniqueID)
                {
                    CompanyList.DataSource    = GetCompanyList(); CompanyList.DataBind();
                    CompanyList.SelectedValue = Request.Params[CompanyList.UniqueID];
                    CompanyList_SelectedIndexChanged(CompanyList, new EventArgs());
                }
                if (ProjectList.Items.Count <= 0 && Request.Params["__EVENTTARGET"] == ProjectList.UniqueID)
                {
                    ProjectList.DataSource    = GetProjectList(); ProjectList.DataBind();
                    ProjectList.SelectedValue = Request.Params[ProjectList.UniqueID];
                    ProjectList_SelectedIndexChanged(ProjectList, new EventArgs());
                }
            }
        }
예제 #19
0
        protected void CompanyList_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (CompanyList.SelectedValue != null && CompanyList.SelectedValue != string.Empty)
            {
                base.LCurr.CompanyId = Int32.Parse(CompanyList.SelectedValue);
            }
            else
            {
                base.LCurr.CompanyId = 0;
            }
            ProjectList.Items.Clear(); Session.Remove("ProjectList"); ProjectList.DataSource = GetProjectList(); ProjectList.DataBind();
            ListItem li = null;

            li = ProjectList.Items.FindByValue(base.LCurr.ProjectId.ToString());
            if (li != null)
            {
                ProjectList.ClearSelection(); li.Selected = true; base.LCurr.ProjectId = Int16.Parse(li.Value);
            }
            else if (ProjectList.Items.Count > 0)
            {
                ProjectList.Items[0].Selected = true;
                try
                {
                    base.LCurr.ProjectId = Int16.Parse(ProjectList.Items[0].Value);
                }
                catch { base.LCurr.ProjectId = 0; }
            }
            else
            {
                base.LCurr.ProjectId = 0;
            }
            SwitchCmpPrj();
            Response.Redirect(Request.RawUrl);
        }
예제 #20
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                string extAppDomainUrl =
                    !string.IsNullOrWhiteSpace(Config.ExtBaseUrl)
                        ? Config.ExtBaseUrl
                        : string.IsNullOrEmpty(Request.Url.Query) ? Request.Url.AbsoluteUri.Replace(Request.Url.Segments[Request.Url.Segments.Length - 1], "")
                        : Request.Url.AbsoluteUri.Replace(Request.Url.Query, "").Replace(Request.Url.Segments[Request.Url.Segments.Length - 1], "");
                cAppDomainUrl.Text = extAppDomainUrl.EndsWith("/") ? extAppDomainUrl.Substring(0, extAppDomainUrl.Length - 1) : extAppDomainUrl;
                if (!Request.IsAuthenticated || LUser == null || LUser.LoginName.ToLower() == "anonymous")
                {
                    string loginUrl = System.Web.Security.FormsAuthentication.LoginUrl;
                    if (string.IsNullOrEmpty(loginUrl))
                    {
                        loginUrl = "~/MyAccount.aspx";
                    }
                    SignIn.Visible       = true; SignIn.NavigateUrl = loginUrl + (loginUrl.Contains("?") ? "&" : "?") + "logo=N";
                    SignoutPanel.Visible = false;
                    cLoginName.Visible   = false;
                    // for client side login sync between React and asp.net(only when served under the same app tree
                    // this controls react/asp.net login sync for 'showpage' like usage, turn this off would disable auto login(from react token) in show page and other public page
                    cAppDomainUrl.Visible = true;
                    return;
                }
                else
                {
                    cAppDomainUrl.Visible = true;
                    SignIn.Visible        = false;
                    SignoutPanel.Visible  = true;
                    cLoginName.Text       = LUser.LoginName;
                    cLoginName.Visible    = true;
                }
                if (LUser != null)
                {
                    if (base.LPref != null)
                    {
                        switch (base.LPref.SysListVisible)
                        {
                        case "N":
                            SystemsLabel.Visible = false; SystemsList.Visible = false; SystemsList.Enabled = true; CurrSys.Visible = false; break;

                        case "R":
                            SystemsLabel.Visible = true; SystemsList.Visible = true; SystemsList.Enabled = false; CurrSys.Visible = true; break;

                        default:
                            SystemsLabel.Visible = true; SystemsList.Visible = true; SystemsList.Enabled = true; CurrSys.Visible = true; break;
                        }
                        switch (base.LPref.PrjListVisible)
                        {
                        case "N":
                            ProjectLabel.Visible = false; ProjectList.Visible = false; ProjectList.Enabled = true; CurrPrj.Visible = false; break;

                        case "R":
                            ProjectLabel.Visible = true; ProjectList.Visible = true; ProjectList.Enabled = false; CurrPrj.Visible = true; break;

                        default:
                            ProjectLabel.Visible = true; ProjectList.Visible = true; ProjectList.Enabled = true; CurrPrj.Visible = true; break;
                        }
                        switch (base.LPref.ComListVisible)
                        {
                        case "N":
                            CompanyLabel.Visible = false; CompanyList.Visible = false; CompanyList.Enabled = true; CurrCmp.Visible = false; break;

                        case "R":
                            CompanyLabel.Visible = true; CompanyList.Visible = true; CompanyList.Enabled = false; CurrCmp.Visible = true; break;

                        default:
                            CompanyLabel.Visible = true; CompanyList.Visible = true; CompanyList.Enabled = true; CurrCmp.Visible = true; break;
                        }
                    }

                    CompanyList.Attributes["onchange"] = "javascript:return CanPostBack(true, this);"; CompanyList.Attributes["NeedConfirm"] = "Y";
                    ProjectList.Attributes["onchange"] = "javascript:return CanPostBack(true, this);"; ProjectList.Attributes["NeedConfirm"] = "Y";
                    SystemsList.Attributes["onchange"] = "javascript:return CanPostBack(true, this);"; SystemsList.Attributes["NeedConfirm"] = "Y";

                    UserLabel.Text = LUser != null ? LUser.UsrName : Context.User.Identity.Name;
                    if (LUser.HasPic)
                    {
                        UsrPic.ImageUrl = base.GetUrlWithQSHash("~/DnLoad.aspx?key=" + LUser.UsrId.ToString() + "&tbl=dbo.Usr&knm=UsrId&col=PicMed&sys=3"); UsrPic.Visible = true;
                    }


                    SystemsList.DataSource = GetSystemsList();
                    if (LCurr != null && LUser != null)
                    {
                        DataTable dtSystem = GetCompanyProf();
                        if (dtSystem != null && dtSystem.Rows.Count > 0)
                        {
                            string   logo     = dtSystem.Rows[0]["CompanyLogo"].ToString();
                            string   systemLs = dtSystem.Rows[0]["SystemLs"].ToString();
                            DataView dv       = GetSystemsList();
                            if (!string.IsNullOrEmpty(systemLs) && systemLs != "()")
                            {
                                dv.RowFilter           = "Active='Y' AND SystemId IN " + systemLs;
                                SystemsList.DataSource = dv;
                            }
                        }
                    }
                    CompanyList.DataSource  = GetCompanyList();
                    ProjectList.DataSource  = GetProjectList();
                    TimeZoneList.DataSource = GetTimeZoneList();

                    TranslateItems();

                    this.DataBind();
                    try { SystemsList.SelectedValue = LCurr.SystemId.ToString(); CurrSys.Text = SystemsList.SelectedItem.Text; }
                    catch { }
                    try { CompanyList.SelectedValue = LCurr.CompanyId.ToString(); CurrCmp.Text = CompanyList.SelectedItem.Text; }
                    catch { }
                    try { ProjectList.SelectedValue = LCurr.ProjectId.ToString(); CurrPrj.Text = ProjectList.SelectedItem.Text; }
                    catch { }
                    try { TimeZoneList.SelectedValue = CurrTimeZoneInfo().Id; }
                    catch { }
                    cMyAccountLink.NavigateUrl = System.Web.Security.FormsAuthentication.LoginUrl; // +(Request.QueryString["typ"] != null ? "?typ=" + Request.QueryString["typ"] : "");
                }
            }
            else if (Request.IsAuthenticated && base.LUser != null)     // Get around selectedIndexChange event not triggered because of viewstate-in-session.
            {
                if (SystemsList.Items.Count <= 0 && Request.Params["__EVENTTARGET"] == SystemsList.UniqueID)
                {
                    SystemsList.DataSource    = GetSystemsList(); SystemsList.DataBind();
                    SystemsList.SelectedValue = Request.Params[SystemsList.UniqueID];
                    SystemsList_SelectedIndexChanged(SystemsList, new EventArgs());
                }
                if (CompanyList.Items.Count <= 0 && Request.Params["__EVENTTARGET"] == CompanyList.UniqueID)
                {
                    CompanyList.DataSource    = GetCompanyList(); CompanyList.DataBind();
                    CompanyList.SelectedValue = Request.Params[CompanyList.UniqueID];
                    CompanyList_SelectedIndexChanged(CompanyList, new EventArgs());
                }
                if (ProjectList.Items.Count <= 0 && Request.Params["__EVENTTARGET"] == ProjectList.UniqueID)
                {
                    ProjectList.DataSource    = GetProjectList(); ProjectList.DataBind();
                    ProjectList.SelectedValue = Request.Params[ProjectList.UniqueID];
                    ProjectList_SelectedIndexChanged(ProjectList, new EventArgs());
                }
            }
        }