Beispiel #1
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            int index = SelfTitleGV.SelectedIndex;

            int       dataIndex = SelfTitleGV.Rows[index].DataItemIndex;
            DataTable dt        = (DataTable)Session["dtSources"];
            int       titleId   = int.Parse(dt.DefaultView[dataIndex].Row["titleId"].ToString());

            Button btn = null;

            btn         = (SelfTitleGV.Rows[index].FindControl("btnUpdate") as Button);
            btn.Visible = false;
            btn         = (SelfTitleGV.Rows[index].FindControl("btnCancle") as Button);
            btn.Visible = false;
            btn         = sender as Button;
            btn.Visible = false;

            SelfTitleProcess stp = Session["SelfTitleProcess"] as SelfTitleProcess;

            stp.SelfTitleDel(titleId);

            stp.SelfTitleView();

            DataTable taskTable = stp.MyDst.Tables["tbl_title"];

            Session["dtSources"]   = stp.MyDst.Tables["tbl_title"] as DataTable;
            SelfTitleGV.DataSource = Session["dtSources"];//["dtSources"] as DataTable;

            SelfTitleGV.SelectedIndex = -1;
            SelfTitleGV.EditIndex     = -1;
            SelfTitleGV.DataBind();

            btnAdd.Enabled = true;
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!(null == Session["totleAuthority"]))
            {
                AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"];

                bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.selfCompany);
                if (!flag)
                {
                    Response.Redirect("~/Main/NoAuthority.aspx");
                }
            }
            else
            {
                string url = Request.FilePath;
                Session["backUrl"] = url;
                Response.Redirect("~/Account/Login.aspx");
            }

            if (!IsPostBack)
            {
                DataSet          MyDst  = new DataSet();
                SelfTitleProcess myView = new SelfTitleProcess(MyDst);

                myView.SelfTitleView();
                DataTable taskTable = myView.MyDst.Tables["tbl_title"];

                Session["SelfTitleProcess"] = myView;
                Session["dtSources"]        = taskTable;

                SelfTitleGV.DataSource = Session["dtSources"];//["dtSources"] as DataTable;
                SelfTitleGV.DataBind();
            }
        }
Beispiel #3
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            int index = SelfTitleGV.SelectedIndex;

            int       dataIndex = SelfTitleGV.Rows[index].DataItemIndex;
            DataTable dt        = (DataTable)Session["dtSources"];

            GridViewRow row          = SelfTitleGV.Rows[index];
            TextBox     tbTitleName  = row.Cells[1].Controls[0] as TextBox;
            string      newTitleName = tbTitleName.Text.ToString().Trim();

            string strCheck = newTitleName;

            newTitleName = input_check(strCheck.Trim());

            if (newTitleName.Equals(strCheck))
            {
                int titleId = int.Parse(dt.DefaultView[dataIndex].Row["titleId"].ToString());

                SelfTitleProcess stp = Session["SelfTitleProcess"] as SelfTitleProcess;

                stp.SelfTitleUpdate(titleId, newTitleName);

                stp.SelfTitleView();

                DataTable taskTable = stp.MyDst.Tables["tbl_title"];

                Session["dtSources"] = stp.MyDst.Tables["tbl_title"] as DataTable;

                Button btn = null;
                btn         = (SelfTitleGV.Rows[index].FindControl("btnDel") as Button);
                btn.Visible = false;
                btn         = (SelfTitleGV.Rows[index].FindControl("btnCancle") as Button);
                btn.Visible = false;
                btn         = sender as Button;
                btn.Visible = false;

                SelfTitleGV.SelectedIndex = -1;
                SelfTitleGV.EditIndex     = -1;

                SelfTitleGV.DataSource = Session["dtSources"];//["dtSources"] as DataTable;
                SelfTitleGV.DataBind();

                btnAdd.Enabled = true;
            }
            else
            {
                tbTitleName.Text          = newTitleName;
                SelfTitleGV.SelectedIndex = index;
                SelfTitleGV.EditIndex     = index;
            }
        }
        protected void btnAccept_Click(object sender, EventArgs e)
        {
            SelfTitleProcess stp = Session["SelfTitleProcess"] as SelfTitleProcess;

            string newTitleName = txtTitleName.Text.ToString().Trim();

            string strCheck = newTitleName;

            newTitleName = input_check(strCheck.Trim());
            if (newTitleName.Equals(strCheck))
            {
                stp.SelfTitleAdd(newTitleName);

                Response.Redirect("~/Main/self_depart_title/selfTitle/SelfTitle.aspx");
            }
            else
            {
                txtTitleName.Text = newTitleName;
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //        txtName.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"];
            if (!(null == Session["totleAuthority"]))
            {
                AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"];

                bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.projectTagApply);
                if (!flag)
                {
                    Response.Redirect("~/Main/NoAuthority.aspx");
                }
            }
            else
            {
                string url = Request.FilePath;
                Session["backUrl"] = url;
                Response.Redirect("~/Account/Login.aspx");
            }

            if (!IsPostBack)
            {
                DataSet dst = new DataSet();
                DataRow dr  = null;

                #region ddlSelfDepartView

                SelfDepartProcess ddlSelfDepartView = new SelfDepartProcess(dst);

                ddlSelfDepartView.SelDepView();
                DataTable ddlSelfDepartTable = ddlSelfDepartView.MyDst.Tables["tbl_department"].DefaultView.ToTable();

                dr = ddlSelfDepartTable.NewRow();
                dr["departmentId"]   = -1;
                dr["departmentName"] = string.Empty;
                dr["endTime"]        = "9999-12-31";
                ddlSelfDepartTable.Rows.Add(dr);

                ddlDepart.DataValueField = "departmentId";
                ddlDepart.DataTextField  = "departmentName";
                ddlDepart.DataSource     = ddlSelfDepartTable;
                ddlDepart.DataBind();
                ddlDepart.SelectedValue = "-1";

                #endregion

                #region ddlSelfTitleView

                SelfTitleProcess ddlSelfTitleView = new SelfTitleProcess(dst);

                ddlSelfTitleView.SelfTitleView();
                DataTable ddlSelfTitleTable = ddlSelfTitleView.MyDst.Tables["tbl_title"].DefaultView.ToTable();

                dr              = ddlSelfTitleTable.NewRow();
                dr["titleId"]   = -1;
                dr["titleName"] = string.Empty;
                dr["endTime"]   = "9999-12-31";
                ddlSelfTitleTable.Rows.Add(dr);

                ddlTitle.DataValueField = "titleId";
                ddlTitle.DataTextField  = "titleName";
                ddlTitle.DataSource     = ddlSelfTitleTable;
                ddlTitle.DataBind();
                ddlTitle.SelectedValue = "-1";

                #endregion
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!(null == Session["totleAuthority"]))
            {
                AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"];

                bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.selfCompany);
                if (!flag)
                {
                    Response.Redirect("~/Main/NoAuthority.aspx");
                }
            }
            else
            {
                string url = Request.FilePath;
                Session["backUrl"] = url;
                Response.Redirect("~/Account/Login.aspx");
            }

            //DataSet MyDst = new DataSet();
            //SelfDepartProcess myView = new SelfDepartProcess(MyDst);


            if (!IsPostBack)
            {
                DataSet           upDst  = new DataSet();
                DataSet           sdDst  = new DataSet();
                DataSet           stDst  = new DataSet();
                UserProcess       upView = new UserProcess(upDst);
                SelfDepartProcess sdView = new SelfDepartProcess(sdDst);
                SelfTitleProcess  stView = new SelfTitleProcess(stDst);

                upView.UsrSelfDepartTitleView();
                sdView.RealDepView();
                stView.RealTitleView();
                DataTable upTable = upView.MyDst.Tables["view_usr_department_title"];
                DataTable sdTable = sdView.MyDst.Tables["tbl_department"];
                DataTable stTable = stView.MyDst.Tables["tbl_title"];

                //DataColumn[] sdKey = new DataColumn[1];
                //DataColumn[] stKey = new DataColumn[1];
                //sdKey[0] = sdTable.Columns[1];
                //stKey[0] = stTable.Columns[1];

                //sdTable.PrimaryKey = sdKey;
                //stTable.PrimaryKey = stKey;

                //object findVals = new object();
                //findVals = "无";

                Session["UserProcess"] = upView;
                Session["upDtSources"] = upTable;
                Session["sdDtSources"] = sdTable;
                Session["stDtSources"] = stTable;

                //if (Session["PAGESIZE"] != null)
                //{
                //    SelfDepartGV.DataSource = Session["dtSources"];//["dtSources"] as DataTable;
                //    SelfDepartGV.DataBind();
                //}
                //else
                //{
                //}
                usrGV.DataSource = Session["upDtSources"];//["dtSources"] as DataTable;
                //string[] strKeyNames = new string[1];
                //strKeyNames[0] = "departmentName";
                //SelfDepartGV.DataKeyNames = strKeyNames;
                usrGV.DataBind();
            }
        }