Beispiel #1
0
 /// <summary>
 /// 设置初始界面
 /// </summary>
 private void fill()
 {
     try
     {
         Song.Entities.EmpGroup mm;
         if (id != 0)
         {
             mm = Business.Do <IEmpGroup>().GetSingle(id);
         }
         else
         {
             //如果是新增
             mm            = new Song.Entities.EmpGroup();
             mm.EGrp_IsUse = true;
         }
         //组名称
         tbName.Text = mm.EGrp_Name;
         //如果是系统组,则不允许修改
         tbName.Enabled    = !mm.EGrp_IsSystem;
         lbIsSytem.Visible = mm.EGrp_IsSystem;
         //是否显示
         cbIsUse.Checked = mm.EGrp_IsUse;
         //说明
         tbIntro.Text = mm.EGrp_Intro;
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }
Beispiel #2
0
        private void fill()
        {
            try
            {
                switch (type.ToLower())
                {
                case "posi":
                    Song.Entities.Position p = Business.Do <IPosition>().GetSingle(id);
                    ltName.Text = p.Posi_Name;
                    break;

                case "group":
                    Song.Entities.EmpGroup e = Business.Do <IEmpGroup>().GetSingle(id);
                    ltName.Text = e.EGrp_Name;
                    break;

                case "depart":
                    Song.Entities.Depart d = Business.Do <IDepart>().GetSingle(id);
                    ltName.Text = d.Dep_CnName;
                    break;
                }
            }
            catch (Exception ex)
            {
                Message.ExceptionShow(ex);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 修改是否显示的状态
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void sbShow_Click(object sender, EventArgs e)
 {
     try
     {
         StateButton ub    = (StateButton)sender;
         int         index = ((GridViewRow)(ub.Parent.Parent)).RowIndex;
         int         id    = int.Parse(this.GridView1.DataKeys[index].Value.ToString());
         //
         Song.Entities.EmpGroup entity = Business.Do <IEmpGroup>().GetSingle(id);
         entity.EGrp_IsUse = !entity.EGrp_IsUse;
         Business.Do <IEmpGroup>().Save(entity);
         BindData(null, null);
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }
Beispiel #4
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnEnter_Click(object sender, EventArgs e)
 {
     try
     {
         Song.Entities.EmpGroup mm;
         if (id != 0)
         {
             mm = Business.Do <IEmpGroup>().GetSingle(id);
         }
         else
         {
             //如果是新增
             mm            = new Song.Entities.EmpGroup();
             mm.EGrp_IsUse = true;
         }
         //属性
         mm.EGrp_Name  = tbName.Text;
         mm.EGrp_IsUse = cbIsUse.Checked;
         //说明
         mm.EGrp_Intro = tbIntro.Text;
         //确定操作
         if (id == 0)
         {
             Song.Entities.EmpAccount acc = Extend.LoginState.Admin.CurrentUser;
             mm.Org_ID   = acc.Org_ID;
             mm.Org_Name = acc.Org_Name;
             Business.Do <IEmpGroup>().Add(mm);
         }
         else
         {
             Business.Do <IEmpGroup>().Save(mm);
         }
         Master.AlertCloseAndRefresh("操作成功!");
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }
Beispiel #5
0
 private void fill()
 {
     try
     {
         //输出所有员工
         int orgid = Extend.LoginState.Admin.CurrentUser.Org_ID;
         Song.Entities.EmpAccount[] ea = Business.Do <IEmployee>().GetAll(orgid, -1, true, "");
         rtEmp.DataSource = ea;
         rtEmp.DataBind();
         //显示当前角色名
         Song.Entities.EmpGroup p = Business.Do <IEmpGroup>().GetSingle(id);
         this.lbGroup.Text = p.EGrp_Name;
         //输出隶属当前用户组的所有员工
         Song.Entities.EmpAccount[] emp4posi = Business.Do <IEmpGroup>().GetAll4Group(id);
         rbEmp4Posi.DataSource = emp4posi;
         rbEmp4Posi.DataBind();
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }
Beispiel #6
0
        private void fill()
        {
            try
            {
                switch (type.ToLower())
                {
                case "posi":
                    Song.Entities.Position p = Business.Do <IPosition>().GetSingle(id);
                    ltName.Text = p.Posi_Name;
                    break;

                case "group":
                    Song.Entities.EmpGroup e = Business.Do <IEmpGroup>().GetSingle(id);
                    ltName.Text = e.EGrp_Name;
                    break;

                case "depart":
                    Song.Entities.Depart d = Business.Do <IDepart>().GetSingle(id);
                    ltName.Text = d.Dep_CnName;
                    break;

                case "organ":
                    ltName.Text = "所有机构";
                    break;

                case "orglevel":
                    Song.Entities.OrganLevel lv = Business.Do <IOrganization>().LevelSingle(id);
                    ltName.Text = "机构等级:" + lv.Olv_Name;
                    break;
                }
            }
            catch (Exception ex)
            {
                Message.ExceptionShow(ex);
            }
        }