用C#编写个人通讯录程序 40

麻烦大侠给个邮箱我把要求发给你们。。。在下等任务需求在仿真器手机里面实现管理和查询个人通信录信息,主要涉及分组、姓名、电话号码、手机号码、工作单位、家庭地址、电子邮箱和其... 麻烦大侠给个邮箱我把要求发给你们。。。在下等
任务需求
在仿真器手机里面实现
管理和查询个人通信录信息,主要涉及分组、姓名、电话号码、手机号码、工作单位、家庭地址、电子邮箱和其他主要的个人通信录信息。
主要功能模块
分组管理模块:新加、删除、修改 组信息;
通信录管理:新加、删除、修改 通信录信息;
查询模块:能够通过姓名、电话号码、手机号码、工作单位、家庭地址、电子邮箱等条件快速地检索到通信录信息
我的邮箱是wudehao2007@126.com 麻烦发给我
展开
 我来答
工控知识乐园
2012-04-10 · 超过24用户采纳过TA的回答
知道答主
回答量:138
采纳率:0%
帮助的人:29.5万
展开全部
using System;

namespace TheFirstClassApp
{
enum Sexly
{
male,
female
}

struct Date
{
public int year;
public int month;
public int day;
public int Year
{
get
{
return this.year;
}
set
{
if (value >= 1990)
this.year = value;
else
this.year = 0;
}
}
public int Month
{
get
{
return this.month;
}
set
{
if (value >= 1 && value <= 12)
this.month = value;
else
this.month = 0;
}
}
public int Day
{
get
{
return this.day;
}
set
{
switch (this.month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
{
if (day >= 1 && day <= 31)

this.day = value;
else
this.day = 0;
}
break;
case 4:
case 6:
case 9:
case 11:
{
if (day >= 1 && day <= 30)
this.day = value;
else
this.day = 0;
}
break;
case 2:
if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
{
if (day >= 1 && day <= 29)
this.day = value;
else
this.day = 0;
break;
}
else
{
if (day >= 1 && day <= 28)
this.day = value;
else
this.day = 0;
break;
}
default:
break;
}

}
}

public string DateString
{
get
{
return year.ToString() + "年" + month.ToString() + "月" + day.ToString() + "日";
}
}
public Date(int year, int month, int day)
{
this.year = year;
this.month = month;
this.day = day;
}

public bool IsLegalDate(int year, int month, int day)
{
if (year >= 1990 && year <= 2011)
{
if (month <= 12 && month >= 1)
{
switch (this.month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
{
if (day >= 1 && day <= 31)
this.day = day;
else
Console.WriteLine("您输入有误");
return false;
}
case 4:
case 6:
case 9:
case 11:
{
if (day >= 1 && day <= 30)
this.day = day;
else
Console.WriteLine("您输入有误");
return false;
}
case 2:
if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
{
if (day >= 1 && day <= 29)
this.day = day;
else
Console.WriteLine("您输入有误");
return false;
}
else
{
if (day >= 1 && day <= 28)
this.day = day;
else
Console.WriteLine("您输入有误");
return false;
}
default:
return false;

}

}
else
return false;
}
else
return false;
}

}
class Person
{
private string name;
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
private Sexly sex;
public Sexly Sex
{
get
{
return sex;
}
set
{
if (Convert.ToString(value) == "male" || Convert.ToString(value) == "female")
sex = value;
}
}
private string mobile;
public string Mobile
{
get
{
return this.mobile;
}
set
{
this.mobile = value;
}
}
private string address;
public string Address
{
get
{
return this.address;
}
set
{
this.address = value;
}
}
private string id;
public string ID
{
get
{
return this.id;
}
set
{
this.id = value;
}
}
private Date birthday;
public Date Birthday
{
set
{
if (value.year >= 1990 && value.year <= 1999)
this.birthday = value;
else
{
this.birthday = value;
this.birthday.year = 1990;
}

}
}
private Date work;
public Date Work
{
get
{
return this.work;
}
set
{
this.work = value;
}
}
public int WorkYear
{
get
{
return this.CalculateWorkYear();
}
}
private int CalculateWorkYear()
{
int currentYear = DateTime.Now.Year;
int workYear = this.work.year;
return currentYear - workYear;
}
public int Age
{
get
{
return this.CalculateAgeFromBirthday();
}
}
private int CalculateAgeFromBirthday()
{
int currentYear = DateTime.Now.Year;
int birthYear = this.birthday.year;
return currentYear - birthYear + 1;
}
public Person()
{ }
public Person(string name, Sexly Sex, Date birthday, string mobile, string address, string id)
{
this.name = name;
this.sex = Sex;
this.birthday = birthday;
this.mobile = mobile;
this.address = address;
this.id = id;

}
public bool SetDate(out string errorMsg, params int[] dateDates)
{
Date birthday = new Date();
errorMsg = "";
if (dateDates.Length == 1)
{
birthday.year = dateDates[0];
birthday.month = 1;
birthday.day = 1;
if (birthday.year < DateTime.Now.Year)

return true;

else
{
errorMsg = "输入年份有误";
return false;
}

}
else
{
if (dateDates.Length == 2)
{
birthday.year = dateDates[0];
birthday.month = dateDates[1];
birthday.day = 1;
if (birthday.year < DateTime.Now.Year)
{
if (birthday.month <= 12 && birthday.month >= 1)

return true;
else
{
errorMsg = "输入的月份有误!";
return false;
}

}
else
{
errorMsg = "输入的年份有误!";
return false;
}
}
else
{
if (dateDates.Length == 3)
{
birthday.year = dateDates[0];
birthday.month = dateDates[1];
birthday.day = dateDates[2];
if (birthday.year < DateTime.Now.Year)
{
if (birthday.month <= 12 && birthday.month >= 1)
{
switch (birthday.month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
if (birthday.day >= 1 && birthday.day <= 31)
return true;
else
{
errorMsg = "输入日期有误";
return false;
}
case 4:
case 6:
case 9:
case 11:
if (birthday.day >= 1 && birthday.day <= 30)
return true;
else
{
errorMsg = "输入日期有误";
return false;
}
case 2:
if (birthday.year % 4 == 0 && birthday.year % 100 != 0 || birthday.year % 400 == 0)
{
if (birthday.day >= 1 && birthday.day <= 29)
return true;
else
{
errorMsg = "输入日期有误";
return false;

}
}
else
{
if (birthday.day >= 1 && birthday.day <= 28)
return true;
else
{
errorMsg = "输入日期有误";
return false;
}
}
default:
{
errorMsg = "输入月份有误";
return false;
}
}
}
else
{
errorMsg = "输入月份有误";
return false;
}
}
else
{
errorMsg = "输入年份有误";
return false;
}
}
else
{
errorMsg = string.Empty;
return true;
}
}
}
}
public string Information
{
get
{
string info = "";
info += "姓名:" + this.name + "\r\n";
info += "性别:" + (this.sex == Sexly.male ? "男" : "女") + "\r\n";
info += "年龄:" + this.Age + "\r\n";
info += "出生日期:" + this.birthday.DateString + "\r\n";
info += "手机号码:" + this.mobile + "\r\n";
info += "地址:" + this.address + "\r\n";
info += "身份证:" + this.id + "\r\n";
info += "工龄:" + this.WorkYear;
return info;
}
}
}
class ProgEntry
{
static void Main()
{

Date birthday = new Date();
Date theWork1 = new Date();
Person thePerson = new Person();
Console.WriteLine("请输入姓名:");
thePerson.Name = Console.ReadLine();
Console.WriteLine("请输入您的性别(男用"0"表示,女用"1"表示):");
thePerson.Sex = (Sexly)Convert.ToInt32(Console.ReadLine());

Console.WriteLine("请输入您的出生年份:");
birthday.year = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入您的出生月份:");
birthday.month = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入您的出生日期:");
birthday.day = Convert.ToInt32(Console.ReadLine());
thePerson.Birthday = birthday;

Console.WriteLine("手机号码");
thePerson.Mobile = Console.ReadLine();

Console.WriteLine("地址:");
thePerson.Address = Console.ReadLine();

Console.WriteLine("身份证:");
thePerson.ID = Console.ReadLine();

Console.WriteLine("请输入您的开始工作年份:");
theWork1.year = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("请输入您的开始工作月份:");
theWork1.month = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("请输入您的开始工作日期:");
theWork1.day = Convert.ToInt32(Console.ReadLine());
thePerson.Work = theWork1;

/*Console.WriteLine("工作年:");
Work.year = int.Parse(Console.ReadLine());
Console.WriteLine("工作月:");
Work.month = int.Parse(Console.ReadLine());
Console.WriteLine("工作日:");
Work.day = int.Parse(Console.ReadLine());*/

//Console.WriteLine("您的姓名:{0},性别:{2} ,年龄:{4} ,手机:{1}\n,家庭地址:{5}",thePerson.Name,thePerson.Sex,thePerson.Age,thePerson.Mobile,thePerson.Address);

/*Date theBirthday1 = new Date(1978, 12, 31);

Person thePerson = new Person("张三", Sexly.male, theBirthday1, "188888888", "青年东路七号", "328888888888885");

Date theWork1 = new Date(2010,12,31);
thePerson.Work = theWork1;*/
string errorMsg = "";
//int[] arr = new int[3];

//Date birthday1 = new Date();
thePerson.SetDate(out errorMsg, birthday.year, birthday.month, birthday.day);
//thePerson.Birthday = birthday1;

Console.WriteLine(thePerson.Information);
Console.WriteLine(errorMsg);
Console.ReadLine();
}
}
}
邢发明
2009-12-27 · 超过24用户采纳过TA的回答
知道答主
回答量:100
采纳率:0%
帮助的人:56.5万
展开全部
jaas说的对,拖几个控件,建几个表就解决了。
像这样简单的东西,看看基本的资料就能搞出来。
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友91a1dda
2009-12-27
知道答主
回答量:5
采纳率:0%
帮助的人:0
展开全部
建几个表 拖个界面 自己设计下搞定... 不过 20分 不想去装环境...
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
kong_bird
2009-12-27 · TA获得超过321个赞
知道答主
回答量:244
采纳率:0%
帮助的人:129万
展开全部
很费时间的大哥,有什么好处啊?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 2条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式