Exemplo n.º 1
0
    public void AddNewUser()
    {
        Logger.Instance.WriteLog("保存新创建的用户信息");
        UserBasicDao ubdao = new UserBasicDao();

        ubdao.Insert001(accountName.value, UIRecord.UBInfo.Password, userName.value,
                        userMobile.value, System.DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss"),
                        userAdd.value, "正常", remark.value);

        ubdao.Select003(accountName.value);
        UserBasicInfo ubInfo = ubdao.Result [0];

        string goupId = "1";

        foreach (UILabel lb in groups)
        {
            if (lb.transform.parent.GetComponent <userGroupItem>().selectToggle.value)
            {
                goupId = lb.transform.parent.GetComponent <userGroupItem>().info.Id;
            }
        }

        UserGroupDao ugpDao = new UserGroupDao();

        ugpDao.Insert001(ubInfo.ID, goupId);

        ReLoadUserRecord();
        newBtn.SetActive(true);
        updateBtn.SetActive(false);
    }
Exemplo n.º 2
0
    /// <summary>
    /// 确定创建用户
    /// </summary>
    public void Comfirm()
    {
        Logger.Instance.WriteLog("保存新创建的用户信息");
        UserBasicDao ubdao = new UserBasicDao();

        ubdao.Insert001(IPTAccount.value, IPTPassword.value, IPTRealName.value,
                        IPTTelphone.value, System.DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss"),
                        IPTAddress.value, "正常", IPTMemo.value);

        ubdao.Select003(IPTAccount.value);
        UserBasicInfo ubInfo = ubdao.Result [0];

        string goupId = "1";

        foreach (GroupInfo info in Groups)
        {
            if (PPLGroup.value == info.Name)
            {
                goupId = info.Id;
                break;
            }
        }

        UserGroupDao ugpDao = new UserGroupDao();

        ugpDao.Insert001(ubInfo.ID, goupId);

        UserRecordManage.Instance.GetComponent <UserRecordManage> ().ReLoadUserRecord();
        Destroy(gameObject);
    }
Exemplo n.º 3
0
    public void Confirm()
    {
        Logger.Instance.WriteLog("保存修改后的用户信息");
        UserRecordItem tempItem = null;

        if (UIRecord.UBInfo.Status == "新建")
        {
            return;
        }
        else
        {
            UserBasicDao ubdao = new UserBasicDao();
            ubdao.Update003(userName.value, UIRecord.UBInfo.Password, userMobile.value,
                            userAdd.value, remark.value, UIRecord.UBInfo.ID);
        }

        for (int i = 0; i < Records.transform.childCount; i++)
        {
            tempItem = Records.transform.GetChild(i).GetComponent <UserRecordItem>();
            if (tempItem.LblAccount.text == UIRecord.UBInfo.UserName)
            {
                UIRecord.UBInfo.Telphone = userMobile.value;
                UIRecord.UBInfo.Address  = userAdd.value;
                UIRecord.UBInfo.RealName = userName.value;
                UIRecord.UBInfo.Memo     = remark.value;
                break;
            }
        }

        string gstr = string.Empty;

        foreach (UILabel lab in groups)
        {
            if (lab.transform.parent.GetComponent <userGroupItem>().selectToggle.value)
            {
                gstr = lab.text;
                break;
            }
        }
        UIRecord.GInfo.Name = gstr;

        GroupDao gpDao = new GroupDao();

        gpDao.Select003();
        List <GroupInfo> gpInfos = gpDao.Result;

        foreach (GroupInfo info in gpInfos)
        {
            if (gstr == info.Name)
            {
                UserGroupDao ugDao = new UserGroupDao();
                if (UIRecord.UBInfo.Status == "新建")
                {
                    ugDao.Insert001(UIRecord.UBInfo.ID, info.Id);
                    UIRecord.UBInfo.Status = "正常";
                }
                else
                {
                    ugDao.Update001(info.Id, UIRecord.UBInfo.ID);
                    break;
                }
            }
        }

        if (tempItem != null)
        {
            tempItem.SetValue(UIRecord);
        }
        //ReLoadUserRecord();
    }