预算管理系统开发随笔(一)

    前两天主管谈到需要对单位的预算开支做一个简单的管理软件,结合最近对C#的学习,我决定用C#来制作这个程序,程序的功能很简单 ,希望能通过这个程序的制作熟悉C#Winform应用程序的开发。我会把开发过程详细的记录下来,希望大家就软件的设计和编码上的问题多提建议.   
一、需求分析。
   程序要实现对每笔划分到单位的预算的使用情况进行管理,要求具有一定的安全控制手段。 
   对于预算管理要求实现的功能如下:
   1、可以很直观的管理每一笔预算,对于预算的性质和预算资金的设用状态必须有详细的记录。
   2、每笔预算可能用于若干项目,要求追踪每个项目的详细资料和资金拨付情况。 
   3、大的预算可能包含小的预算和若干项目。
二、概要设计
    数据库选择:Access(足够了)
    安全控制手段: 程序建立用户表,存储每个用户的用户名密码。每个用户均可以修改自己的密码,特殊的admin内置用户可以删除用户和添加新用户。
    数据模型:分析预算和项目的关系,很明显类似于系统的文件和文件夹的关系,文件夹可能包含文件夹和文件,而文件则保存具体的数据。 这里预算可以包含小预算和具体的项目,而实际资金的使用最终是通过项目来完成的。 每笔预算和每个项目应该记录的信息如下:
   

预算:

项目

名称    名称   
备注备注
预算金额预算金额
已分配金额 分配金额=预算金额
已支付金额已支付金额
子预算列表使用单位
子项目列表项目类别
是否固定资产
支出日期
资金类别
经办单位

    报表需求:待定。
三、详细设计:
    因为项目在某种程度上也是一种预算,所以抽象出基类BudgetBase包含预算的基本操作,预算(Budget)和项目(ProjectBudget)做为它的两个子类。
None.gif namespace  BudgetControl
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
public class BudgetBase
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ContractedSubBlock.gifExpandedSubBlockStart.gif        
Data member#region Data member
InBlock.gif        
private string m_name;
InBlock.gif        
private int m_id;
InBlock.gif        
private string m_remark;
InBlock.gif        
private decimal m_cashAmount;
InBlock.gif        
protected decimal m_payedAmount;
InBlock.gif        
protected decimal m_assignedAmount;
InBlock.gif
InBlock.gif        
public string Name
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return m_name;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                m_name 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public int ID
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return m_id;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                m_id 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public string Remark
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return m_remark;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                m_remark 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public decimal CashAmount
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return m_cashAmount;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                m_cashAmount 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif        
//返回预算金额
InBlock.gif
        public abstract decimal GetBudgetAmount();   
InBlock.gif        
//返回已支付金额
InBlock.gif
        public abstract decimal GetPayedAmount();
InBlock.gif        
//返回已非配金额
InBlock.gif
        public abstract decimal GetAssignedamount();
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

 

None.gif namespace  BudgetControl
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
public class Project: BudgetBase
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
//使用单位
InBlock.gif
        private string m_usedDepartment;
InBlock.gif
InBlock.gif        
public string UsedDepartment
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn m_usedDepartment; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ m_usedDepartment = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif        
//经办单位
InBlock.gif
        private string m_manageDepartment;
InBlock.gif
InBlock.gif        
public string ManageDepartment
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn m_manageDepartment; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ m_manageDepartment = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif        
//项目类别
InBlock.gif
        private string m_projectType;
InBlock.gif
InBlock.gif        
public string ProjectType
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn m_projectType; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ m_projectType = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//是否固定资产
InBlock.gif
        private string m_isFixedAssets;
InBlock.gif
InBlock.gif        
public string IsFixedAssets
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn m_isFixedAssets; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ m_isFixedAssets = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//立项日期
InBlock.gif
        private DateTime m_createdDate;
InBlock.gif
InBlock.gif        
public DateTime CreatedDate
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn m_createdDate; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ m_createdDate = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
//资金类别
InBlock.gif
        private string m_cashType;
InBlock.gif
InBlock.gif        
public string CashType
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
get dot.gifreturn m_cashType; }
ExpandedSubBlockStart.gifContractedSubBlock.gif            
set dot.gif{ m_cashType = value; }
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif        
public override decimal GetAssignedamount()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
throw new Exception("The method or operation is not implemented.");
ExpandedSubBlockEnd.gif        }

InBlock.gif        
public override decimal GetPayedAmount()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
throw new Exception("The method or operation is not implemented.");
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

 

None.gif namespace  BudgetControl
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
public class Budget: BudgetBase
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
private List<Budget> m_subBudgets;
InBlock.gif        
private List<Project> m_subProjects;
InBlock.gif        
public override decimal GetAssignedamount()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
throw new Exception("The method or operation is not implemented.");
ExpandedSubBlockEnd.gif        }

InBlock.gif        
public override decimal GetPayedAmount()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
throw new Exception("The method or operation is not implemented.");
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}





 

转载于:https://www.cnblogs.com/riordan/archive/2006/03/19/353134.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值