Exemplo n.º 1
0
        private void cmdMove_Click(object sender, System.EventArgs e)
        {
            UDS.Components.Position dept = new UDS.Components.Position();

            switch (dept.MoveDeparement(PositionID, Int32.Parse(lstDeparment.Items[lstDeparment.SelectedIndex].Value)))
            {
            case 0:
                Response.Write("<script laguage='javascript'>alert('移动到" + lstDeparment.Items[lstDeparment.SelectedIndex].Text + " 职位成功!');</script>");
                Response.Redirect("ListView.aspx?PositionID=" + PositionID + "&Refresh=1");
                break;

            case -1:
                Response.Write("<script laguage='javascript'>alert('不能移动到下级职位!');</script>");
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                txtPositionName.Text = "";
                OnDutyTime = "";
                OffDutyTime = "";

                SqlDataReader dr=null;
                try
                {
                    //�õ�ְλID
                    PositionID = (Request.QueryString["PositionID"] == null ? 0 : Int32.Parse(Request.QueryString["PositionID"].ToString()));

                    UDS.Components.Position dp = new UDS.Components.Position();

                    dr = dp.GetPositionInfo(PositionID);

                    if (dr.Read())
                    {
                        PositionName = dr["Position_Name"].ToString();
                        PositionDescription = dr["Position_Description"].ToString();
                    }

                    dr.Close();

                    dr = dp.GetPositionDutyTime(PositionID);
                    if (dr.Read())
                    {
                        OnDutyTime = DateTime.Parse(dr["OnDutyTime"].ToString()).ToShortTimeString();
                        OffDutyTime = DateTime.Parse(dr["OffDutyTime"].ToString()).ToShortTimeString();
                    }
                }
                finally
                {

                    if (dr != null)
                    {

                        dr.Close();
                    }
                }

                if(Request.QueryString["DisplayType"] !=null)
                    DisplayType = Int32.Parse(Request.QueryString["DisplayType"].ToString());
                else
                    DisplayType = 0;
                // ��ʾ��ͬ���
                switch(DisplayType)
                {
                    case 0:
                        tabAdd.Visible = true;
                        tabDelete.Visible = false;
                        tabModify.Visible = false;
                        tabMove.Visible =false;

                        lbAddPosition.BackColor = Color.FromArgb(0xf0f0f0);
                        lbDeletePosition.BackColor = Color.FromArgb(0xffffff);
                        lbModifyPosition.BackColor = Color.FromArgb(0xffffff);
                        lbMovePosition.BackColor  = Color.FromArgb(0xffffff);

                        addPositionName.Text = PositionName;
                        break;
                    case 1:
                        tabAdd.Visible = false;
                        tabDelete.Visible = true;
                        tabModify.Visible = false;
                        tabMove.Visible =false;
                        lbAddPosition.BackColor = Color.FromArgb(0xffffff);
                        lbDeletePosition.BackColor = Color.FromArgb(0xf0f0f0);
                        lbModifyPosition.BackColor = Color.FromArgb(0xffffff);
                        lbMovePosition.BackColor  = Color.FromArgb(0xffffff);

                        delPositionName.Text  = PositionName;
                        break;
                    case 2:
                        tabAdd.Visible = false;
                        tabDelete.Visible = false;
                        tabModify.Visible = true;
                        tabMove.Visible =false;

                        txtPositionName.Text = PositionName;
                        txtMPositionRemark.Text = PositionDescription;

                        lbAddPosition.BackColor = Color.FromArgb(0xffffff);
                        lbDeletePosition.BackColor = Color.FromArgb(0xffffff);
                        lbModifyPosition.BackColor = Color.FromArgb(0xf0f0f0);
                        lbMovePosition.BackColor  = Color.FromArgb(0xffffff);

                        txtuOnDutyTime.Text  = OnDutyTime;
                        txtuOffDutyTime.Text  = OffDutyTime;
                        break;
                    case 3:
                        tabAdd.Visible = false;
                        tabDelete.Visible = false;
                        tabModify.Visible = false;
                        tabMove.Visible =true;

                        lbAddPosition.BackColor = Color.FromArgb(0xffffff);
                        lbDeletePosition.BackColor = Color.FromArgb(0xffffff);
                        lbModifyPosition.BackColor = Color.FromArgb(0xffffff);
                        lbMovePosition.BackColor  = Color.FromArgb(0xf0f0f0);

                        lblPosition.Text = PositionName;
                        BindPosition();
                        break;
                    default:
                        break;
                }

            }
        }
Exemplo n.º 3
0
        private void cmdMove_Click(object sender, System.EventArgs e)
        {
            UDS.Components.Position dept = new UDS.Components.Position();

            switch(dept.MoveDeparement(PositionID,Int32.Parse(lstDeparment.Items[lstDeparment.SelectedIndex].Value)))
            {
                case 0:
                    Response.Write("<script laguage='javascript'>alert('�ƶ���" + lstDeparment.Items[lstDeparment.SelectedIndex].Text +" ְλ�ɹ���');</script>");
                    Response.Redirect("ListView.aspx?PositionID="+PositionID+"&Refresh=1");
                    break;
                case -1:
                    Response.Write("<script laguage='javascript'>alert('�����ƶ����¼�ְλ��');</script>");
                    break;
                default:
                    break;
            }
        }
Exemplo n.º 4
0
        private static string OffDutyTime = "";                   //下班时间

        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                txtPositionName.Text = "";
                OnDutyTime           = "";
                OffDutyTime          = "";

                SqlDataReader dr;

                //得到职位ID
                PositionID = (Request.QueryString["PositionID"] == null?0:Int32.Parse(Request.QueryString["PositionID"].ToString()));

                UDS.Components.Position dp = new UDS.Components.Position();

                dr = dp.GetPositionInfo(PositionID);

                if (dr.Read())
                {
                    PositionName        = dr["Position_Name"].ToString();
                    PositionDescription = dr["Position_Description"].ToString();
                }

                dr.Close();

                dr = dp.GetPositionDutyTime(PositionID);
                if (dr.Read())
                {
                    OnDutyTime  = DateTime.Parse(dr["OnDutyTime"].ToString()).ToShortTimeString();
                    OffDutyTime = DateTime.Parse(dr["OffDutyTime"].ToString()).ToShortTimeString();
                }

                if (Request.QueryString["DisplayType"] != null)
                {
                    DisplayType = Int32.Parse(Request.QueryString["DisplayType"].ToString());
                }
                else
                {
                    DisplayType = 0;
                }
                // 显示不同表格
                switch (DisplayType)
                {
                case 0:
                    tabAdd.Visible    = true;
                    tabDelete.Visible = false;
                    tabModify.Visible = false;
                    tabMove.Visible   = false;

                    lbAddPosition.BackColor    = Color.FromArgb(0xf0f0f0);
                    lbDeletePosition.BackColor = Color.FromArgb(0xffffff);
                    lbModifyPosition.BackColor = Color.FromArgb(0xffffff);
                    lbMovePosition.BackColor   = Color.FromArgb(0xffffff);

                    addPositionName.Text = PositionName;
                    break;

                case 1:
                    tabAdd.Visible             = false;
                    tabDelete.Visible          = true;
                    tabModify.Visible          = false;
                    tabMove.Visible            = false;
                    lbAddPosition.BackColor    = Color.FromArgb(0xffffff);
                    lbDeletePosition.BackColor = Color.FromArgb(0xf0f0f0);
                    lbModifyPosition.BackColor = Color.FromArgb(0xffffff);
                    lbMovePosition.BackColor   = Color.FromArgb(0xffffff);

                    delPositionName.Text = PositionName;
                    break;

                case 2:
                    tabAdd.Visible    = false;
                    tabDelete.Visible = false;
                    tabModify.Visible = true;
                    tabMove.Visible   = false;

                    txtPositionName.Text    = PositionName;
                    txtMPositionRemark.Text = PositionDescription;

                    lbAddPosition.BackColor    = Color.FromArgb(0xffffff);
                    lbDeletePosition.BackColor = Color.FromArgb(0xffffff);
                    lbModifyPosition.BackColor = Color.FromArgb(0xf0f0f0);
                    lbMovePosition.BackColor   = Color.FromArgb(0xffffff);

                    txtuOnDutyTime.Text  = OnDutyTime;
                    txtuOffDutyTime.Text = OffDutyTime;
                    break;

                case 3:
                    tabAdd.Visible    = false;
                    tabDelete.Visible = false;
                    tabModify.Visible = false;
                    tabMove.Visible   = true;

                    lbAddPosition.BackColor    = Color.FromArgb(0xffffff);
                    lbDeletePosition.BackColor = Color.FromArgb(0xffffff);
                    lbModifyPosition.BackColor = Color.FromArgb(0xffffff);
                    lbMovePosition.BackColor   = Color.FromArgb(0xf0f0f0);

                    lblPosition.Text = PositionName;
                    BindPosition();
                    break;

                default:
                    break;
                }
            }
        }