Пример #1
0
        private void addDirButton_Click(object sender, EventArgs e)
        {
            string dirname = "";

            if (DialogWithEdittext.InputBox("Введите название директории", "Имя: ", ref dirname) == DialogResult.OK)
            {
                if (dirname != null && dirname.Equals("") == false)
                {
                    var             server = new NavigatorIServiceClient();
                    int             dirId  = -1;
                    OperationResult result = new OperationResult();
                    //var resp = server.AddDirectory(mCurrDirectoryData.currPath, dirname, mUserID, -1, 63);
                    dirId = server.AddDirectory(OWNER_MASK | GROUP_MASK, mCurrDirectoryData.currPath,
                                                -1, mUserID, dirname, null
                                                , out result);
                    if (result != null && result.mErrCode == 0)
                    {
                        refreshButton_Click(sender, e);
                    }
                    else if (result != null)
                    {
                        MessageBox.Show(result.mErrMessage);
                    }

                    server.Close();
                }
                else
                {
                    MessageBox.Show("Недопустимое имя для директории!");
                }
            }
        }
Пример #2
0
        private void addGroupButton_Click(object sender, EventArgs e)
        {
            string newGroupname = "";

            if (DialogWithEdittext.InputBox("Добавление группы", "Имя группы", ref newGroupname) == DialogResult.OK)
            {
                var server = new NavigatorIServiceClient();

                var resp1 = server.AddGroup(mUserID, newGroupname);
                if (resp1 != null && resp1.mErrCode == 0)
                {
                    var resp = server.GetGroups(mUserID);
                    RefreshGroupListView(resp);
                    server.Close();
                }
                else if (resp1 != null)
                {
                    MessageBox.Show(resp1.mErrMessage);
                }
            }
        }