Example #1
0
 private void UCOrganizationAddOrEdit_Load(object sender, EventArgs e)
 {
     base.SetBtnStatus(wStatus);
     BindTree();
     if (wStatus == WindowStatus.Edit || wStatus == WindowStatus.Copy)
     {
         DataTable dt = DBHelper.GetTable("查询组织", "tb_organization", "*", "org_id='" + strOrg_id + "'", "", "");
         if (dt.Rows.Count <= 0)
         {
             MessageBoxEx.Show("查询组织失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             return;
         }
         CommonCtrl.SelectTreeView(tvCompany, dt.Rows[0]["parent_id"].ToString());
         txtparent_id.Caption         = tvCompany.SelectedNode.Text;
         txtorg_code.Caption          = dt.Rows[0]["org_code"].ToString();
         txtorg_name.Caption          = dt.Rows[0]["org_name"].ToString();
         txtorg_short_name.Caption    = dt.Rows[0]["org_short_name"].ToString();
         txtcontact_name.Caption      = dt.Rows[0]["contact_name"].ToString();
         txtcontact_telephone.Caption = dt.Rows[0]["contact_telephone"].ToString();
         txtremark.Caption            = dt.Rows[0]["remark"].ToString();
     }
 }
Example #2
0
        private void UCOrganizationView_Load(object sender, EventArgs e)
        {
            //base.RoleButtonStstus(uc.Name);//角色按钮权限-是否隐藏
            base.SetBtnStatus(wStatus);
            DataSources.BindComBoxDataEnum(cbostate, typeof(DataSources.EnumStatus), true);//绑定状态 启用 停用
            BindTree();
            string strSql = "SELECT o.*,(select USER_NAME from sys_user where user_id =o.create_by )as create_Username , "
                            + "(select USER_NAME from sys_user where user_id =o.update_by ) as update_username  FROM  tb_organization o where org_id='" + id + "'";
            SQLObj sqlobj = new SQLObj();

            sqlobj.cmdType   = CommandType.Text;
            sqlobj.Param     = new Dictionary <string, ParamObj>();
            sqlobj.sqlString = strSql;
            DataSet ds = DBHelper.GetDataSet("查询组织", sqlobj);

            //DBHelper.GetTable("查询组织", "tb_organization", "*", "org_id='" + id + "'", "", "");
            if (ds == null || ds.Tables[0].Rows.Count <= 0)
            {
                MessageBoxEx.Show("查询组织失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            DataTable dt = ds.Tables[0];

            CommonCtrl.SelectTreeView(tvCompany, dt.Rows[0]["parent_id"].ToString());
            lblporg_code.Text         = tvCompany.SelectedNode.Name;
            lblporg_name.Text         = tvCompany.SelectedNode.Text;
            lblorg_code.Text          = dt.Rows[0]["org_code"].ToString();
            lblorg_name.Text          = dt.Rows[0]["org_name"].ToString();
            lblorg_short_name.Text    = dt.Rows[0]["org_short_name"].ToString();
            lblremark.Text            = dt.Rows[0]["remark"].ToString();
            lblcontact_name.Text      = dt.Rows[0]["contact_name"].ToString();
            lblcontact_telephone.Text = dt.Rows[0]["contact_telephone"].ToString();
            lblcreate_Username.Text   = dt.Rows[0]["create_Username"].ToString();
            lblcreate_time.Text       = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["create_time"].ToString())).ToString();
            lblupdate_username.Text   = dt.Rows[0]["update_username"].ToString();
            lblupdate_time.Text       = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["update_time"].ToString())).ToString();
            cbostate.SelectedValue    = dt.Rows[0]["status"].ToString();
        }
Example #3
0
 private void UCOrganizationAddOrEdit_Load(object sender, EventArgs e)
 {
     //base.SetBtnStatus(windowStatus);
     BindTree();
     if (windowStatus == WindowStatus.Add)
     {
         if (parent_id != string.Empty)
         {
             TreeNode[] nodes = tvCompany.Nodes.Find(parent_id, true);
             if (nodes.Length > 0)
             {
                 tvCompany.SelectedNode = nodes[0];
             }
         }
         //SetSysManageAddBtn();
     }
     if (windowStatus == WindowStatus.Edit || windowStatus == WindowStatus.Copy)
     {
         DataTable dt = DBHelper.GetTable("查询组织", "tb_organization", "*", "org_id='" + strOrg_id + "'", "", "");
         if (dt.Rows.Count <= 0)
         {
             MessageBoxEx.Show("查询组织失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             return;
         }
         CommonCtrl.SelectTreeView(tvCompany, dt.Rows[0]["parent_id"].ToString());
         txtparent_id.Caption         = tvCompany.SelectedNode.Text;
         txtorg_code.Caption          = dt.Rows[0]["org_code"].ToString();
         txtorg_name.Caption          = dt.Rows[0]["org_name"].ToString();
         txtorg_short_name.Caption    = dt.Rows[0]["org_short_name"].ToString();
         txtcontact_name.Caption      = dt.Rows[0]["contact_name"].ToString();
         txtcontact_telephone.Caption = dt.Rows[0]["contact_telephone"].ToString();
         txtremark.Caption            = dt.Rows[0]["remark"].ToString();
         enumStatus = int.Parse(dt.Rows[0]["status"].ToString());
     }
     SetBtnStatus();
 }
Example #4
0
        private void UCOrganizationView_Load(object sender, EventArgs e)
        {
            //base.RoleButtonStstus(uc.Name);//角色按钮权限-是否隐藏
            //base.SetBtnStatus(wStatus);
            DataSources.BindComBoxDataEnum(cbostate, typeof(DataSources.EnumStatus), true);//绑定状态 启用 停用
            BindTree();
            //            string strSql = "SELECT o.*,(select USER_NAME from sys_user where user_id =o.create_by )as create_Username , "
            //+ "(select USER_NAME from sys_user where user_id =o.update_by ) as update_username  FROM  tb_organization o where org_id='" + id + "'";

            //SELECT o.*,(select USER_NAME from sys_user where user_id =o.create_by )as create_Username ,
            //(select USER_NAME from sys_user where user_id =o.update_by ) as update_username ,
            //po.org_code as parentcode,po.org_name as parentname ,c.com_name ,c.com_code FROM  tb_organization o
            //left join tb_organization po on o.parent_id=po.org_id
            //left join tb_company c on o.com_id=c.com_id
            //where o.org_id='8b4471da-b9bd-4d59-b3f1-af1841dc3ab5'
            string strSql = "SELECT o.*,(select USER_NAME from sys_user where user_id =o.create_by )as create_Username,";

            strSql += "(select USER_NAME from sys_user where user_id =o.update_by ) as update_username ,";
            strSql += "po.org_code as parentcode,po.org_name as parentname ,c.com_name ,c.com_code FROM  tb_organization o ";
            strSql += "left join tb_organization po on o.parent_id=po.org_id ";
            strSql += "left join tb_company c on o.com_id=c.com_id ";
            strSql += "where o.org_id='" + id + "'";
            SQLObj sqlobj = new SQLObj();

            sqlobj.cmdType   = CommandType.Text;
            sqlobj.Param     = new Dictionary <string, ParamObj>();
            sqlobj.sqlString = strSql;
            DataSet ds = DBHelper.GetDataSet("查询组织", sqlobj);

            //DBHelper.GetTable("查询组织", "tb_organization", "*", "org_id='" + id + "'", "", "");
            if (ds == null || ds.Tables[0].Rows.Count <= 0)
            {
                MessageBoxEx.Show("查询组织失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            DataTable dt = ds.Tables[0];

            CommonCtrl.SelectTreeView(tvCompany, dt.Rows[0]["parent_id"].ToString());
            if (dt.Rows[0]["parentname"] != null && dt.Rows[0]["parentname"].ToString() != string.Empty)
            {
                lblporg_name.Text = dt.Rows[0]["parentname"].ToString();
            }
            else
            {
                lblporg_name.Text = CommonCtrl.IsNullToString(dt.Rows[0]["com_name"]);
            }
            if (dt.Rows[0]["parentcode"] != null && dt.Rows[0]["parentcode"].ToString() != string.Empty)
            {
                lblporg_code.Text = dt.Rows[0]["parentcode"].ToString();
            }
            else
            {
                lblporg_code.Text = CommonCtrl.IsNullToString(dt.Rows[0]["com_code"]);
            }


            lblorg_code.Text          = dt.Rows[0]["org_code"].ToString();
            lblorg_name.Text          = dt.Rows[0]["org_name"].ToString();
            lblorg_short_name.Text    = dt.Rows[0]["org_short_name"].ToString();
            lblremark.Text            = dt.Rows[0]["remark"].ToString();
            lblcontact_name.Text      = dt.Rows[0]["contact_name"].ToString();
            lblcontact_telephone.Text = dt.Rows[0]["contact_telephone"].ToString();
            lblcreate_Username.Text   = dt.Rows[0]["create_Username"].ToString();
            lblcreate_time.Text       = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["create_time"].ToString())).ToString();
            lblupdate_username.Text   = dt.Rows[0]["update_username"].ToString();
            lblupdate_time.Text       = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["update_time"].ToString())).ToString();
            cbostate.SelectedValue    = dt.Rows[0]["status"].ToString();
            SetSysBtnView();
        }