private void Button_科目保存_Click(object sender, RoutedEventArgs e)
        {
            if (CommonInfo.权限值 < 2)
            {
                MessageBoxCommon.Show("需要会计主管确认后再进行保存!");
                return;
            }
            string messageBoxText = "您现在正在进行保存年初金额操作,请谨慎操作?";
            string caption        = "注意";
            bool?  result         = MessageBoxDel.Show(caption, messageBoxText);

            if (result == false)
            {
                return;
            }
            bool flag = new ViewModel_年初金额().Update();

            if (flag)
            {
                mrc.日志 = "保存了年初金额初始化!";
                vmr.Insert(mrc);
                MessageBoxCommon.Show("保存成功!");
            }
            //刷新操作
            Button btn = sender as Button;

            //btn.Visibility = Visibility.Hidden;
            CommonInfo.是否初始化年初数 = true;
        }
 private void Button_停用_Click(object sender, RoutedEventArgs e)
 {
     if (DataGrid_权限设置.SelectedItem != null)
     {
         Model_用户 m = DataGrid_权限设置.SelectedItem as Model_用户;
         if (m.是否使用.Equals("停用"))
         {
             MessageBoxCommon.Show("当前用户已经停用,请勿重复操作!");
             return;
         }
         string messageBoxText = "用户停用后,将不能登录!";
         string caption        = "注意";
         bool?  result         = false;
         result = MessageBoxDel.Show(caption, messageBoxText);
         if (result == false)
         {
             return;
         }
         bool flag = vm.StopUse(m.ID);
         if (flag)
         {
             mrc.日志 = "进行停用了用户名:" + m.用户名;
             vmr.Insert(mrc);
             FreshData();
         }
         else
         {
             MessageBoxCommon.Show("操作失败!请联系管理员");
         }
     }
     else
     {
         MessageBoxCommon.Show("请选择需要停用的用户");
     }
 }
        private void Button_Del_Click(object sender, RoutedEventArgs e)
        {
            if (DataGrid_子细目.SelectedItems.Count == 0)
            {
                return;
            }
            string messageBoxText = "是否删除这些数据?";
            string caption        = "注意";
            bool?  result         = MessageBoxDel.Show(caption, messageBoxText);

            if (result == false)
            {
                return;
            }
            List <Model_科目管理> list = new List <Model_科目管理>();

            for (int i = 0; i < DataGrid_子细目.SelectedItems.Count; i++)
            {
                Model_科目管理 m = new Model_科目管理();
                try
                {
                    m = DataGrid_子细目.SelectedItems[i] as Model_科目管理;
                    //m.父ID = SubjectNum;
                }
                catch (Exception)
                {
                }
                list.Add(m);
            }
            vm.Delete(list);
            list.Clear();
            check();
        }
Beispiel #4
0
 private void Button_反审核_Click(object sender, RoutedEventArgs e)
 {
     if (this.DataGrid_本期凭证.SelectedCells.Count != 0)
     {
         this.StackPanel_MoreButton.Visibility = System.Windows.Visibility.Collapsed;
         if (vsy.ValidateRuning() == false)
         {
             MessageBoxCommon.Show("试用期已过,不能使用此功能!");
             return;
         }
         if (CommonInfo.权限值 >= 2)
         {
             bool?result = MessageBoxDel.Show("注意", "确认反审核凭证?");
             if (result == false)
             {
                 return;
             }
             Model_凭证管理 asd = this.DataGrid_本期凭证.SelectedCells[0].Item as Model_凭证管理;
             new PA.ViewModel.ViewModel_凭证管理().UnReview(asd.ID);
             ReflashData();
         }
         else
         {
             MessageBoxCommon.Show("您的权限不够,不能进行审核!");
         }
     }
     else
     {
         MessageBoxCommon.Show("请先选择数据");
     }
 }
Beispiel #5
0
 private void Button_Del_Click(object sender, RoutedEventArgs e)
 {
     if (this.DataGrid_本期凭证.SelectedCells.Count != 0)
     {
         bool?result = MessageBoxDel.Show("注意", "确认删除数据?");
         if (result == true)
         {
             Model_凭证管理 asd = this.DataGrid_本期凭证.SelectedCells[0].Item as Model_凭证管理;
             new PA.ViewModel.ViewModel_凭证管理().Delete(asd.ID);
             ReflashData();
         }
     }
 }
Beispiel #6
0
 private void Button_全部审核_Click(object sender, RoutedEventArgs e)
 {
     this.StackPanel_MoreButton.Visibility = System.Windows.Visibility.Collapsed;
     if (vsy.ValidateRuning() == false)
     {
         MessageBoxCommon.Show("试用期已过,不能使用此功能!");
         return;
     }
     if (CommonInfo.权限值 >= 2)
     {
         bool?result = MessageBoxDel.Show("注意", "确认审核全部凭证?");
         if (result == false)
         {
             return;
         }
         new PA.ViewModel.ViewModel_凭证管理().ReviewAll();
         ReflashData();
     }
     else
     {
         MessageBoxCommon.Show("您的权限不够,不能进行审核!");
     }
 }
Beispiel #7
0
        private void Button_本月结账_Click(object sender, RoutedEventArgs e)
        {
            if (vsy.ValidateRuning() == false)
            {
                MessageBoxCommon.Show("试用期已过,不能使用此功能!");
                return;
            }
            if (CommonInfo.权限值 < 2)
            {
                MessageBoxCommon.Show("权限不足,不能使用此功能!");
                return;
            }
            this.Button_隐藏.Focus();
            bool mark = false;

            if (CommonInfo.是否初始化年初数)
            {
                mark = true;
            }
            else
            {
                MessageBoxCommon.Show("当前未初始化年初金额,请先初始化年初数!");
                return;
            }
            if (!vmp.IsReview(CommonInfo.当前期))
            {
                Button_凭证审核_Click(this, null);
                mark = false;
                MessageBoxCommon.Show("检测到还有当前期未审核的凭证单,请先做审核!");
            }
            int temp = 0;

            if (mark)
            {
                bool?result2 = MessageBoxDel.Show("注意", "正在进行第" + CommonInfo.当前期 + "期结账操作,确认是否继续?");
                if (result2 == true)
                {
                    bool?result = MessageBoxInput.Show("安全确认,请输入密码");
                    if (result == true)
                    {
                        if (CommonInfo.验证密码.Equals(CommonInfo.登录密码))
                        {
                            bool flag = vm.CheckOut(CommonInfo.当前期);
                            if (flag)
                            {
                                MessageBoxCommon.Show("结账完毕!");
                                if (CommonInfo.当前期 <= 12)
                                {
                                    vmb.UpdatePeriod(CommonInfo.当前期);
                                }
                                temp  = CommonInfo.当前期;
                                mr.日志 = "进行了结账操作,结算第:" + temp + "期账";
                                vmr.Insert(mr);
                                OnTabChange(1, 0, "本月结账");
                            }
                        }
                        else
                        {
                            MessageBoxCommon.Show("当前输入密码错误!");
                        }
                    }
                }
            }
        }