snapman是一个简单而强大的团队协作软件,在上面的信息可以是数据、可以是规则、也可以是自动化代码;最重要的它是一个可以开发的协作平台,所有信息都可以作用到所有人或机器上,大大减少了工作的复杂度。软件开发项目是人类工程中对人力、脑力的配合度要求最高的项目。所以高智商的人才开发出各种项目定义实施流程:PMBOK、CMMI、IPD、SCRUM、XP等,这些流程的实施离不开各种强大的信息系统。但是这些系统只适合于大公司大流程,到单个的项目组级别很难为项目具体的特点做适配,随心所欲的更改。比如做10个项目要开发出10个软件版本这是基本不可能的事情。下面我们看看一个人如何在短短的三天内开发一个软件项目管理系统,短时间为每个项目开发一个适配的系统,将不可能变为可能。

一个软件项目包括:市场、客户需求、设计、开发、测试、版本发布、财务回款、软件维护等过程。我们今天设计的花季项目管理系统只包含:设计、开发、测试、版本发布的核心部分。花季项目管理系统组成包括:

1、项目信息和团队信息

2、设计及计划安排信息

3、员工每天工作日报

4、问题单提单与跟踪

5、员工工作绩效考评

项目中每个环节相互联系并紧密依赖:建立一个项目和团队,按照需求进行系统设计及每天每个员工的工作安排,员工每天按照计划进行工作并进行日报报告,MDE对Story功能进行验收和工作考评,测试人员的问题提单,开发人员对问题进行修复,直到版本成功发布,最终项目完成后系统和项目经理对员工进行评价考核。这个系统总共花费3天大部分时间在业务设计上,代码实现只花了一天多一点点:

  一、首选是数据存储部分,如下创建五张表:花季项目信息、花季计划信息、花季工作日报、花季问题跟踪、花季员工考评;这五张表只用来存储数据,不涉及任何 代码,所以业务设计好后,每张表花了5-8分钟来实现

01.花季项目信息,这张表包括:项目的相关信息、需求任务书、项目附件、必要的团队成员、角色及其主管;这张表直接由PM手工维护,这里面的信息由后面的工作表格进行使用。

02.花季计划信息,这张表包括:项目的各个关键里程碑时间点,项目的工作点数和每人每天的平均点数(使用点数可以衡量一个模块的复杂难易程度从而安排不同级别员工的工作),每员工每天的工作内容及完成状态;这张表直接由PM、SE、MDE、TC维护,这里面的信息由后面的工作表格进行使用。

03.花季工作日报,这张表包括:每天每个员工的工作完成状态、今天的总结和明天的计划,员工主管对员工今天工作完成的验收及质量考核;这张表由:01.花季我的日报、01.花季日报审核,2张表自动维护。

04.花季问题跟踪,这张表包括:测试人员提单的问题要素、跟踪状态和开发人员的分析及修复状态;这张表由:03.花季我的问题、04.花季我的测试,2张表自动维护。

05.花季员工考评,这张表包括:每个员工的工作状态、工作质量、工作态度、主管的考核等;这张表由:02.花季团队考评、01.花季日报审核,2张表自动维护。

二、其次是员工工作部分,如下创建四张表:花季我的日报、花季我的任务、花季我的问题、花季我的测试;这4张表是员工每天需要完成的工作。这几张表涉及界面设计和代码控制,界面设计总共花了半个小时,代码控制每张表花了不到1个小时。

01.花季我的日报,这张表包括:项目信息、员工今天的工作点数、完成进度、今天总结、明天计划、工作相关的图片和附件。事件包括:

A、初始化事件,自动获取项目信息、如果今天已经写过日报取今天日报呈现出来,事件代码:

int GetDaily(void *g,wchar_t *date,wchar_t *name)
{
int row = ;
wchar_t *d,*n;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(d,date)==&&wcsicmp(n,name)==)return row;
row++;
}
return ;
}
wchar_t * GetUserManager(void *g,wchar_t *name)
{
int row = ;
int col = ;
wchar_t *manager = NULL, *strName = NULL;
while()
{
strName = SnapmanCellGetText(g,row,);
if(!strName || wcslen(strName)==)break;
if(wcsicmp(name,strName)==)
{
manager = SnapmanCellGetText(g,row,);
break;
}
row++;
}
return manager;
} void OnInitialize(void *g)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
if(gProject&&gDaily)
{
int row = GetDaily(gDaily,Date(),SnapmanGetUserName());
if(row > )
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetProgress(g,,,SnapmanCellGetInt(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gDaily,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gDaily,row,));
}
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,Date());
SnapmanCellSetText(g,,,SnapmanCellGetText(gProject,,));
SnapmanCellSetText(g,,,SnapmanGetUserName());
SnapmanCellSetText(g,,,GetUserManager(gProject,SnapmanGetUserName()));
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
}
SnapmanCleanUp();
}

B、取昨天日报按钮事件,事件代码:

#include "time.h"
int GetLastDaily(void *g,wchar_t *date,wchar_t *name)
{
int row = SnapmanGridGetDataRowCount(g,);
wchar_t *d,*n;
while(row >= )
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(d&&n)
{
if(wcsicmp(d,date)!=&&wcsicmp(n,name)==)return row;
}
row--;
}
return ;
} void OnButtonClick(void *g, int row, int col)
{
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
if(gDaily)
{
int row = GetLastDaily(gDaily,Date(),SnapmanGetUserName());
if(row > )
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetProgress(g,,,SnapmanCellGetInt(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gDaily,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gDaily,row,));
MessageBox(SnapmanWnd,"日报获取成功!","获取日报",MB_OK);
}else
{
MessageBox(SnapmanWnd,"找不到昨天的日报!","获取日报",MB_OK);
}
}
}

C、提交日报按钮事件 ,事件代码:

int GetDaily(void *g,wchar_t *date,wchar_t *name)
{
int row = ;
wchar_t *d,*n;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(d,date)==&&wcsicmp(n,name)==)return row;
row++;
}
return ;
}
void OnButtonClick(void *g, int row, int col)
{
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
if(gDaily)
{
wchar_t *strWorkPoint = SnapmanCellGetText(g,,);
wchar_t *strWorkload = SnapmanCellGetText(g,,);
wchar_t *strPlanTomorrow = SnapmanCellGetText(g,,);
if(!strWorkPoint || *strWorkPoint==)
{
MessageBox(SnapmanWnd,"请填写工作点数!","提交日报",MB_OK);
return;
}
if(!strWorkload || *strWorkload==)
{
MessageBox(SnapmanWnd,"请填写今天工作总结!","提交日报",MB_OK);
return;
}
if(!strPlanTomorrow || *strPlanTomorrow==)
{
MessageBox(SnapmanWnd,"请填写明天工作计划!","提交日报",MB_OK);
return;
}
int row = GetDaily(gDaily,Date(),SnapmanGetUserName());
if(row > )
{
SnapmanCellSetText(gDaily,row,,SnapmanCellGetText(g,,));
SnapmanCellSetInt(gDaily,row,,SnapmanCellGetInt(g,,));
SnapmanCellSetText(gDaily,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gDaily,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gDaily,row,,DateTime());
SnapmanCellSetFile(gDaily,row,,SnapmanCellGetFile(g,,));
SnapmanCellSetPicture(gDaily,row,,SnapmanCellGetPicture(g,,));
}else
{
int maxRow = SnapmanGridGetDataRowCount(gDaily,) + ; SnapmanCellSetText(gDaily,maxRow,,itostr(maxRow-));
SnapmanCellSetText(gDaily,maxRow,,Date());
SnapmanCellSetText(gDaily,maxRow,,SnapmanGetUserName());
SnapmanCellSetText(gDaily,maxRow,,SnapmanCellGetText(g,,));
SnapmanCellSetInt(gDaily,maxRow,,SnapmanCellGetInt(g,,));
SnapmanCellSetText(gDaily,maxRow,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gDaily,maxRow,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gDaily,maxRow,,DateTime());
SnapmanCellSetFile(gDaily,maxRow,,SnapmanCellGetFile(g,,));
SnapmanCellSetPicture(gDaily,maxRow,,SnapmanCellGetPicture(g,,));
}
if(SnapmanGridSave(gDaily))
{
MessageBox(SnapmanWnd,"日报提交成功!","提交日报",MB_OK);
}
}
SnapmanCleanUp();
}

D、最终代码写完后将表格设置为不可以保存状态,这样表格就只能用来工作而不能用来存储数据,这样每个人写的日报就不会产生相互影响

02.花季我的任务,这张表包括:项目信息、员工前面未完成工作的统计、今天任务信息、今天任务完成状况。事件包括:

A、初始化事件,自动获取项目信息、自动计算员工前面未完成的工作,自动获取今天分配的任务,获取员工已经提交的任务信息,事件代码:

//一、获取日期和名字所在任务的行号
int GetPlanning(void *g,wchar_t *date,wchar_t *name)
{
int row = ;
wchar_t *d,*n;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(d,date)==&&wcsicmp(n,name)==)return row;
row++;
}
return ;
}
//二、获用名字获取其主管名称
wchar_t * GetUserManager(void *g,wchar_t *name)
{
int row = ;
int col = ;
wchar_t *manager = NULL, *strName = NULL;
while()
{
strName = SnapmanCellGetText(g,row,);
if(!strName || wcslen(strName)==)break;
if(wcsicmp(name,strName)==)
{
manager = SnapmanCellGetText(g,row,);
break;
}
row++;
}
return manager;
}
//三、设置用户信息
void SetUserInfo(void *g,void *gProject)
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,Date());
SnapmanCellSetText(g,,,SnapmanCellGetText(gProject,,));
SnapmanCellSetText(g,,,SnapmanGetUserName());
SnapmanCellSetText(g,,,GetUserManager(gProject,SnapmanGetUserName()));
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
}
//四、设置计划信息
void SetPlanningInfo(void *g,void *gPlanning,int row)
{
//1、设置今天需要完成的计划任务
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
//2、设置今天任务完成状态
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetProgress(g,,,SnapmanCellGetInt(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
}
//五、计算并设置未完成工作
void SetUnfinishedInfo(void *g,void *gPlanning)
{
int nUnfinished = ,nProgress = ;
wchar_t *d,*n;
wchar_t *today = SnapmanCellGetText(g,,);
wchar_t *name = SnapmanCellGetText(g,,);
if(!today||!name)return;
int nTotalPlanning = SnapmanGridGetDataRowCount(gPlanning,);
for(int row = ; row <= nTotalPlanning; row++)
{
d = SnapmanCellGetText(gPlanning,row,);
n = SnapmanCellGetText(gPlanning,row,);
nProgress = SnapmanCellGetInt(gPlanning,row,);
if(d&&n&&nProgress!=&&wcsicmp(d,today)<&&wcsicmp(n,name)==)nUnfinished++;
}
if(nUnfinished > )
{
SnapmanCellSetText(g,,,concat3(L("前面您还有"),itostr(nUnfinished),L("天工作未正常完成,请取上一天任务完成它。")));
}else
{
SnapmanCellSetText(g,,,L("您前面的工作都正常完成了,好棒哦!"));
} }
//六、表格初始化事件函数
void OnInitialize(void *g)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gPlanning = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\02.花季计划信息"));
if(gProject&&gPlanning)
{
int row = GetPlanning(gPlanning,Date(),SnapmanGetUserName());
if(row > )
{
SetPlanningInfo(g,gPlanning,row);
}else
{
Print("今天暂时没有您的任务,请好好休息一下哦!");
}
SetUserInfo(g,gProject);
SetUnfinishedInfo(g,gPlanning);
}
SnapmanCleanUp();
}

B、取上一天任务按钮事件,事件代码:

//一、获取日期和名字所在任务的行号
int GetLastDayPlanning(void *g,wchar_t *date,wchar_t *name)
{
int row = ,result = ;
wchar_t *d,*n,*l = NULL;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(d,date)<&&wcsicmp(n,name)==)
{
if(!l||wcsicmp(d,l)>)
{
result = row;
l = d;
}
}
row++;
}
return result;
}
//二、获用名字获取其主管名称
wchar_t * GetUserManager(void *g,wchar_t *name)
{
int row = ;
int col = ;
wchar_t *manager = NULL, *strName = NULL;
while()
{
strName = SnapmanCellGetText(g,row,);
if(!strName || wcslen(strName)==)break;
if(wcsicmp(name,strName)==)
{
manager = SnapmanCellGetText(g,row,);
break;
}
row++;
}
return manager;
}
//四、设置计划信息
void SetPlanningInfo(void *g,void *gPlanning,int row)
{
//1、设置今天需要完成的计划任务
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
//2、设置今天任务完成状态
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetProgress(g,,,SnapmanCellGetInt(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
}
//五、计算并设置未完成工作
void SetUnfinishedInfo(void *g,void *gPlanning)
{
int nUnfinished = ,nProgress = ;
wchar_t *d,*n;
wchar_t *today = SnapmanCellGetText(g,,);
wchar_t *name = SnapmanCellGetText(g,,);
if(!today||!name)return;
int nTotalPlanning = SnapmanGridGetDataRowCount(gPlanning,);
for(int row = ; row <= nTotalPlanning; row++)
{
d = SnapmanCellGetText(gPlanning,row,);
n = SnapmanCellGetText(gPlanning,row,);
nProgress = SnapmanCellGetInt(gPlanning,row,);
if(d&&n&&nProgress!=&&wcsicmp(d,today)<&&wcsicmp(n,name)==)nUnfinished++;
}
if(nUnfinished > )
{
SnapmanCellSetText(g,,,concat3(L("前面您还有"),itostr(nUnfinished),L("天工作未正常完成,请取上一天任务完成它。")));
}else
{
SnapmanCellSetText(g,,,L("您前面的工作都正常完成了,好棒哦!"));
} }
//六、按钮事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gPlanning = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\02.花季计划信息"));
if(gProject&&gPlanning)
{
int row = GetLastDayPlanning(gPlanning,SnapmanCellGetText(g,,),SnapmanCellGetText(g,,));
if(row > )
{
SetPlanningInfo(g,gPlanning,row);
SetUnfinishedInfo(g,gPlanning);
}else
{
Print("没能找到上一天的任务哦!");
}
}
SnapmanCleanUp();
}

C、取下一天任务按钮事件,事件代码:

//一、获取日期和名字所在任务的行号
int GetNextDayPlanning(void *g,wchar_t *date,wchar_t *name)
{
int row = ,result = ;
wchar_t *d,*n,*l = NULL;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(d,date)>&&wcsicmp(n,name)==)
{
if(!l||wcsicmp(d,l)<)
{
result = row;
l = d;
}
}
row++;
}
return result;
}
//二、获用名字获取其主管名称
wchar_t * GetUserManager(void *g,wchar_t *name)
{
int row = ;
int col = ;
wchar_t *manager = NULL, *strName = NULL;
while()
{
strName = SnapmanCellGetText(g,row,);
if(!strName || wcslen(strName)==)break;
if(wcsicmp(name,strName)==)
{
manager = SnapmanCellGetText(g,row,);
break;
}
row++;
}
return manager;
}
//四、设置计划信息
void SetPlanningInfo(void *g,void *gPlanning,int row)
{
//1、设置今天需要完成的计划任务
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
//2、设置今天任务完成状态
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
SnapmanCellSetProgress(g,,,SnapmanCellGetInt(gPlanning,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gPlanning,row,));
}
//五、计算并设置未完成工作
void SetUnfinishedInfo(void *g,void *gPlanning)
{
int nUnfinished = ,nProgress = ;
wchar_t *d,*n;
wchar_t *today = SnapmanCellGetText(g,,);
wchar_t *name = SnapmanCellGetText(g,,);
if(!today||!name)return;
int nTotalPlanning = SnapmanGridGetDataRowCount(gPlanning,);
for(int row = ; row <= nTotalPlanning; row++)
{
d = SnapmanCellGetText(gPlanning,row,);
n = SnapmanCellGetText(gPlanning,row,);
nProgress = SnapmanCellGetInt(gPlanning,row,);
if(d&&n&&nProgress!=&&wcsicmp(d,today)<&&wcsicmp(n,name)==)nUnfinished++;
}
if(nUnfinished > )
{
SnapmanCellSetText(g,,,concat3(L("前面您还有"),itostr(nUnfinished),L("天工作未正常完成,请取上一天任务完成它。")));
}else
{
SnapmanCellSetText(g,,,L("您前面的工作都正常完成了,好棒哦!"));
} }
//六、按钮事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gPlanning = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\02.花季计划信息"));
if(gProject&&gPlanning)
{
int row = GetNextDayPlanning(gPlanning,SnapmanCellGetText(g,,),SnapmanCellGetText(g,,));
if(row > )
{
SetPlanningInfo(g,gPlanning,row);
SetUnfinishedInfo(g,gPlanning);
}else
{
Print("下一天没有安排任务哦!终于可以休息一下叻!");
}
}
SnapmanCleanUp();
}

D、提交任务进度按钮事件,事件代码:

//一、获取日期和名字所在任务的行号
int GetPlanning(void *g,wchar_t *date,wchar_t *name)
{
int row = ;
wchar_t *d,*n;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(d,date)==&&wcsicmp(n,name)==)return row;
row++;
}
return ;
} //四、设置计划信息
void SavePlanningInfo(void *g,void *gPlanning,int row)
{
//2、设置今天任务完成状态
SnapmanCellSetText(gPlanning,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gPlanning,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gPlanning,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gPlanning,row,,SnapmanCellGetText(g,,));
SnapmanCellSetProgress(gPlanning,row,,SnapmanCellGetInt(g,,));
SnapmanCellSetText(gPlanning,row,,SnapmanCellGetText(g,,));
SnapmanGridSave(gPlanning);
} //六、表格初始化事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gPlanning = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\02.花季计划信息"));
if(gPlanning)
{
wchar_t *today = SnapmanCellGetText(g,,);
wchar_t *name = SnapmanCellGetText(g,,);
int row = GetPlanning(gPlanning,today,name);
if(row > )
{
SavePlanningInfo(g,gPlanning,row);
}else
{
Print("今天暂时没有您的任务,请好好休息一下哦!");
}
}
SnapmanCleanUp();
}

E、最终代码写完后将表格设置为不可以保存状态,这样表格就只能用来工作而不能用来存储数据,这样每个人写的任务进度就不会产生相互影响

03.花季我的问题,这张表包括:项目信息、我的问题单列表、当前选择问题信息、此问题的处理情况。事件包括:

A、初始化事件,自动获取项目信息、我的问题单列表、当前选择的问题信息展示、此问题的处理情况,问题还分为开发人员问题和测试人员问题侧重不同,事件代码:

wchar_t *GetDevTestProblemList(void *g,wchar_t *name)
{
wchar_t *result = NULL,*n,*t;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = ;row <= maxrow; row++)
{
t = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(n&&(==wcsicmp(name,n)||==wcsicmp(t,name)))//开发或测试人员的都列上了
{
if(result==NULL)
{
result = SnapmanCellGetText(g,row,);
}else
{
result = concat3(result,L"\n",SnapmanCellGetText(g,row,));
}
}
}
return result;
}
int GetLastDevRow(void *g,wchar_t *name)
{
wchar_t *n;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = maxrow;row >= ; row--)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(name,n))
{
return row;
}
}
return ;
} //二、获用名字获取其主管名称
wchar_t * GetUserManager(void *g,wchar_t *name)
{
int row = ;
int col = ;
wchar_t *manager = NULL, *strName = NULL;
while()
{
strName = SnapmanCellGetText(g,row,);
if(!strName || wcslen(strName)==)break;
if(wcsicmp(name,strName)==)
{
manager = SnapmanCellGetText(g,row,);
break;
}
row++;
}
return manager;
}
//三、设置用户信息
void SetUserInfo(void *g,void *gProject)
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,Date());
SnapmanCellSetText(g,,,SnapmanCellGetText(gProject,,));
SnapmanCellSetText(g,,,SnapmanGetUserName());
SnapmanCellSetText(g,,,GetUserManager(gProject,SnapmanGetUserName()));
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
} void SetProblemInfo(void *g,void *gProblem,int row)
{
if(row > )
{
if(==wcsicmp(SnapmanGetUserName(),SnapmanCellGetText(gProblem,row,)))//是测试人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,)); SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); }else//是开发人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
}
}
}
void OnInitialize(void *g)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
SnapmanCellSetCombo(g,,,GetDevTestProblemList(gProblem,SnapmanGetUserName()));
SetProblemInfo(g,gProblem,GetLastDevRow(gProblem,SnapmanGetUserName()));
SetUserInfo(g,gProject);
}
SnapmanCleanUp();
}

B、我的问题单下拉框的选择事件,获取当前问题信息展示、此问题的处理情况,事件代码:

int GetProblemRow(void *g,wchar_t *Index)
{
wchar_t *n;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = ;row <= maxrow; row++)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(Index,n))
{
return row;
}
}
return ;
} void SetProblemInfo(void *g,void *gProblem,int row)
{
if(row > )
{
if(==wcsicmp(SnapmanGetUserName(),SnapmanCellGetText(gProblem,row,)))//是测试人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,)); SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); }else//是开发人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
}
}
} void OnComboChanged(void *g, int row, int col,wchar_t *text)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
SetProblemInfo(g,gProblem,GetProblemRow(gProblem,text));
}
}

C、取上一个问题按钮事件,获取上一个问题信息展示、此问题处理状况,事件代码:

int GetLastDevRow(void *g,wchar_t *name)
{
wchar_t *n;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = maxrow;row >= ; row--)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(name,n))
{
return row;
}
}
return ;
} int GetPrevDevRow(void *g,wchar_t *name,wchar_t *curIndex)
{
if(curIndex==NULL||curIndex[]==)
{
return GetLastDevRow(g,name);
}else
{
int result = ;
wchar_t *n,*d,*l = NULL;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = maxrow;row >= ; row--)
{
n = SnapmanCellGetText(g,row,);
d = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(name,n)&& d && wcsicmp(d,curIndex) < )
{
if(!l||wcsicmp(d,l)>)
{
result = row;
l = d;
}
}
}
return result;
}
} void SetProblemInfo(void *g,void *gProblem,int row)
{
if(row > )
{
if(==wcsicmp(SnapmanGetUserName(),SnapmanCellGetText(gProblem,row,)))//是测试人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,)); SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); }else//是开发人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
}
}else
{
Print("没有上一个问题咯!");
}
} //六、按钮事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
SetProblemInfo(g,gProblem,GetPrevDevRow(gProblem,SnapmanGetUserName(),SnapmanCellGetText(g,,)));
}
SnapmanCleanUp();
}

D、取下一个问题按钮事件,获取下一个问题信息展示、此问题处理状况,事件代码:

int GetLastDevRow(void *g,wchar_t *name)
{
wchar_t *n;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = maxrow;row >= ; row--)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(name,n))
{
return row;
}
}
return ;
} int GetNextDevRow(void *g,wchar_t *name,wchar_t *curIndex)
{
if(curIndex==NULL||curIndex[]==)
{
return GetLastDevRow(g,name);
}else
{
int result = ;
wchar_t *n,*d,*l = NULL;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = maxrow;row >= ; row--)
{
n = SnapmanCellGetText(g,row,);
d = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(name,n)&& d && wcsicmp(d,curIndex) > )
{
if(!l||wcsicmp(d,l)<)
{
result = row;
l = d;
}
}
}
return result;
}
} void SetProblemInfo(void *g,void *gProblem,int row)
{
if(row > )
{
if(==wcsicmp(SnapmanGetUserName(),SnapmanCellGetText(gProblem,row,)))//是测试人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,)); SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); }else//是开发人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
}
}else
{
Print("没有下一个问题咯!");
}
} //六、按钮事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
SetProblemInfo(g,gProblem,GetNextDevRow(gProblem,SnapmanGetUserName(),SnapmanCellGetText(g,,)));
}
SnapmanCleanUp();
}

E、提交问题进度按钮事件,事件代码:

int GetProblemRow(void *g,wchar_t *Index)
{
wchar_t *n;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = ;row <= maxrow; row++)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(Index,n))
{
return row;
}
}
return ;
}
void SaveProblemProgress(void *g,void *gProblem)
{
wchar_t *d = SnapmanCellGetText(g,,);
if(d&&d[]!=)
{
int row = GetProblemRow(gProblem,d);
if(==wcsicmp(SnapmanGetUserName(),SnapmanCellGetText(gProblem,row,)))//是测试人员
{
if(SnapmanCellIsEmpty(g,,))
{
Print("请填写问题状态!");
}else
{
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanGridSave(gProblem);
Print("问题进度提交成功!");
}
}else if(row>)//是开发人员
{
if(SnapmanCellIsEmpty(g,,))
{
Print("请填写问题状态!");
}else if(SnapmanCellIsEmpty(g,,))
{
Print("请填写问题分析!");
}else if(SnapmanCellIsEmpty(g,,))
{
Print("请填写修复时间!");
}else if(SnapmanCellIsEmpty(g,,))
{
Print("请填写修复版本!");
}else
{
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanGridSave(gProblem);
Print("问题进度提交成功!");
}
}else
{
wPrint(L("问题列表中找不到问题单号为:%s"),d);
}
}else
{
Print("请选择问题单号!");
}
} //六、按钮事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
SaveProblemProgress(g,gProblem);
}
SnapmanCleanUp();
}

F、最终代码写完后将表格设置为不可以保存状态,这样表格就只能用来工作而不能用来存储数据,这样每个人写的问题处理进度就不会产生相互影响

04.花季我的测试,这张表包括:测试人员提单的问题要素、跟踪状态和开发人员的分析及修复状态;这张表由:03.花季我的问题、04.花季我的测试,2张表自动维护。

A、初始化事件,自动获取项目信息、我的问题单列表、当前选择的问题信息展示,事件代码:

wchar_t *GetUserProblemList(void *g,wchar_t *name)
{
wchar_t *result = NULL,*n;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = ;row <= maxrow; row++)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(name,n))
{
if(result==NULL)
{
result = n;
}else
{
result = concat3(result,L"\n",n);
}
}
}
return result;
}
wchar_t *GetDevList(void *g)
{
wchar_t *result = NULL,*n;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = ;row <= maxrow; row++)
{
n = SnapmanCellGetText(g,row,);
if(n&&n[]!=)
{
if(result==NULL)
{
result = n;
}else
{
result = concat3(result,L"\n",n);
}
}
}
return result;
}
//二、获用名字获取其主管名称
wchar_t * GetUserManager(void *g,wchar_t *name)
{
int row = ;
int col = ;
wchar_t *manager = NULL, *strName = NULL;
while()
{
strName = SnapmanCellGetText(g,row,);
if(!strName || wcslen(strName)==)break;
if(wcsicmp(name,strName)==)
{
manager = SnapmanCellGetText(g,row,);
break;
}
row++;
}
return manager;
}
//三、设置用户信息
void SetUserInfo(void *g,void *gProject)
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,Date());
SnapmanCellSetText(g,,,SnapmanCellGetText(gProject,,));
SnapmanCellSetText(g,,,SnapmanGetUserName());
SnapmanCellSetText(g,,,GetUserManager(gProject,SnapmanGetUserName()));
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
}
void OnInitialize(void *g)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
SnapmanCellSetCombo(g,,,GetUserProblemList(g,SnapmanGetUserName()));
SnapmanCellSetCombo(g,,,GetDevList(gProject));
SetUserInfo(g,gProject); }
}

B、我的问题单下拉框的选择事件,获取当前问题信息展示,事件代码:

int GetProblemRow(void *g,wchar_t *Index)
{
wchar_t *n;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = ;row <= maxrow; row++)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(Index,n))
{
return row;
}
}
return ;
} void SetProblemInfo(void *g,void *gProblem,int row)
{
if(row > )
{
if(==wcsicmp(SnapmanGetUserName(),SnapmanCellGetText(gProblem,row,)))//是测试人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,)); SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,);
SnapmanCellSetBackgoundColor(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); }else//是开发人员
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,)); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);;
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
}
}
} void OnComboChanged(void *g, int row, int col,wchar_t *text)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
SetProblemInfo(g,gProblem,GetProblemRow(gProblem,text));
}
}

C、取上一个问题按钮事件,获取上一个问题信息展示,事件代码:

//一、获取日期和名字所在任务的行号
int GetPrevProblem(void *g,int index,wchar_t *name)
{
wchar_t *n = NULL;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = maxrow;row >= ; row--)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(name,n))
{
if(index==)
{
return row;
}else if(SnapmanCellGetInt(g,row,)<index)
{
return row;
}
}
}
return ;
}
void SetProblemInfo(void *g,void *gProblem,int row)
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,));
}
//六、按钮事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
int row = GetPrevProblem(gProblem,SnapmanCellGetInt(g,,),SnapmanCellGetText(g,,));
if(row > )
{
SetProblemInfo(g,gProblem,row);
}else
{
Print("找不到上一个问题单了哦!");
}
}
SnapmanCleanUp();
}

D、取下一个问题按钮事件,获取下一个问题信息展示,事件代码:

//一、获取日期和名字所在任务的行号
int GetNextProblem(void *g,int index,wchar_t *name)
{
wchar_t *n = NULL;
int maxrow = SnapmanGridGetTotalDataRow(g);
for(int row = maxrow;row >= ; row--)
{
n = SnapmanCellGetText(g,row,);
if(n&&==wcsicmp(name,n))
{
if(index==)
{
return row;
}else if(SnapmanCellGetInt(g,row,)>index)
{
return row;
}
}
}
return ;
}
void SetProblemInfo(void *g,void *gProblem,int row)
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gProblem,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gProblem,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gProblem,row,));
}
//六、按钮事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
if(gProject&&gProblem)
{
int row = GetNextProblem(gProblem,SnapmanCellGetInt(g,,),SnapmanCellGetText(g,,));
if(row > )
{
SetProblemInfo(g,gProblem,row);
}else
{
Print("找不到下一个问题单了哦!");
}
}
SnapmanCleanUp();
}

E、提交问题单按钮事件,事件代码:

//一、获取日期和名字所在任务的行号
int GetProblemRow(void *g,int index)
{
wchar_t *n = NULL;
int maxrow = SnapmanGridGetTotalDataRow(g);
if(index > )
{
for(int row = maxrow;row >= ; row--)
{
if(SnapmanCellGetInt(g,row,)==index)
{
return row;
}
}
}
return maxrow + ;
}
void SetProblemInfo(void *g,void *gProblem,int row)
{
SnapmanCellSetInt(gProblem,row,,row - );
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gProblem,row,,SnapmanCellGetText(g,,));
SnapmanCellSetPicture(gProblem,row,,SnapmanCellGetPicture(g,,));
SnapmanCellSetFile(gProblem,row,,SnapmanCellGetFile(g,,));
SnapmanCellSetText(gProblem,row,,DateTime());
SnapmanCellSetText(gProblem,row,,SnapmanGetUserName());
SnapmanGridSave(gProblem);
//清空问题单
SnapmanCellClearData(g,,);
SnapmanCellClearData(g,,);
SnapmanCellClearData(g,,);
SnapmanCellClearData(g,,);
SnapmanCellClearData(g,,);
SnapmanCellClearData(g,,);
SnapmanCellClearData(g,,);
SnapmanCellClearData(g,,); }
//六、按钮事件函数
void OnButtonClick(void *g, int row, int col)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
int row = , rego = ;
if(gProject&&gProblem)
{
wchar_t *text1 = SnapmanCellGetText(g,,);
wchar_t *text2 = SnapmanCellGetText(g,,);
wchar_t *text3 = SnapmanCellGetText(g,,);
wchar_t *text4 = SnapmanCellGetText(g,,);
wchar_t *text5 = SnapmanCellGetText(g,,);
if(!text1||text1[]==)
{
rego = ;
Print("请选择问题级别!");
}else if(!text2||text2[]==)
{
rego = ;
Print("请选择开发人员!");
}else if(!text3||text3[]==)
{
rego = ;
Print("请选择问题状态!");
}else if(!text4||text4[]==)
{
rego = ;
Print("请填写问题相关Story!");
}else if(!text5||text5[]==)
{
rego = ;
Print("请填写问题描述!");
}
if(rego)
{
row = GetProblemRow(gProblem,SnapmanCellGetInt(g,,));
SetProblemInfo(g,gProblem,row);
Print("问题单已经成功提交!");
}
}
SnapmanCleanUp();
}

F、最终代码写完后将表格设置为不可以保存状态,这样表格就只能用来工作而不能用来存储数据,这样每个人写的问题单就不会产生相互影响

、再次是领导主管的工作部分,如下创建三张表:花季日报审核、花季团队考评、花季项目进度。这几张表涉及界面设计和代码控制,界面设计总共花了20多分钟,代码控制每张表花了不到1个小时。

01.花季日报审核,这张表包括:项目信息、员工列表、当前选择员工的日报、主管的考评信息(每天的考核分数纳入到最终的考核成绩里)。事件包括:

A、初始化事件,自动获取项目信息、员工列表、当前选择员工的日报、考评信息,事件代码:

wchar_t* GetEmployee(void *g,void *m,wchar_t *date,wchar_t *name)
{
int row = ;
wchar_t *d,*n,*result = NULL,*manager;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(date,d)==)
{
manager = FindMap(m,n);
if(manager&&wcsicmp(manager,name)==)
{
if(!result)
{
result = n;
}else
{
result = concat3(result,L"\n",n);
}
}
}
row++;
}
return result;
}
void * GetUserManager(void *g)
{
int row = ;
int maxRow = SnapmanGridGetTotalDataRow(g);
wchar_t *strName = NULL, *strManager = NULL;
void *result = NULL;
for(; row <= maxRow; row++)
{
strName = SnapmanCellGetText(g,row,);
strManager = SnapmanCellGetText(g,row,);
if(strName && strManager)
{
result = InsertMap(result,strName,strManager);
}
}
return result;
} int GetDailyRow(void *g,wchar_t *user,wchar_t *time)
{
int row = ;
wchar_t *d,*n;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(time,d)==&&wcsicmp(n,user)==)return row;
row++;
}
return ;
} void OnInitialize(void *g)
{
int row = ;
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
if(gProject&&gDaily)
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,Date());
SnapmanCellSetText(g,,,SnapmanCellGetText(gProject,,));
SnapmanCellSetCombo(g,,,GetEmployee(gDaily,GetUserManager(gProject),Date(),SnapmanGetUserName()));
SnapmanCellSetText(g,,,SnapmanGetUserName());
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetComboIndex(g,,,);
row = GetDailyRow(gDaily,SnapmanCellGetText(g,,),Date());
if(row > )
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetProgress(g,,,SnapmanCellGetInt(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gDaily,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gDaily,row,)); SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
}else
{
Print("没有用户日报。");
} }
SnapmanCleanUp();
}

B、员工选择下拉框的选择事件,获取当前选择员工的日报、考评信息,事件代码:

int GetDailyRow(void *g,wchar_t *user,wchar_t *time)
{
int row = ;
wchar_t *d,*n;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(time,d)==&&wcsicmp(n,user)==)return row;
row++;
}
return ;
} void OnComboChanged(void *g, int row, int col,wchar_t *text)
{ int row = ;
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
if(gProject&&gDaily)
{
row = GetDailyRow(gDaily,text,Date());
if(row > )
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetProgress(g,,,SnapmanCellGetInt(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetFile(g,,,SnapmanCellGetFile(gDaily,row,));
SnapmanCellSetPicture(g,,,SnapmanCellGetPicture(gDaily,row,)); SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
SnapmanCellSetText(g,,,SnapmanCellGetText(gDaily,row,));
}else
{
Print("找不到用户日报。");
} }
SnapmanCleanUp();
}

C、提交日报考评按钮事件,事件代码:

int GetDailyRow(void *g,wchar_t *user,wchar_t *time)
{
int row = ;
wchar_t *d,*n;
while()
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(!d||!n)break;
if(wcsicmp(time,d)==&&wcsicmp(n,user)==)return row;
row++;
}
return ;
} void OnButtonClick(void *g, int row, int col)
{
if(!SnapmanCellIsEmpty(g,,))
{
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
int row = GetDailyRow(gDaily,SnapmanCellGetText(g,,),Date());
SnapmanCellSetText(gDaily,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gDaily,row,,SnapmanCellGetText(g,,));
SnapmanCellSetText(gDaily,row,,DateTime());
SnapmanCellSetText(gDaily,row,,SnapmanGetUserName());
SnapmanGridSave(gDaily);
Print("日报考评提交成功!");
}else
{
Print("请填写主管考评。");
}
SnapmanCleanUp();
}

D、最终代码写完后将表格设置为不可以保存状态,这样表格就只能用来工作而不能用来存储数据,这样每个人写的日报审核就不会产生相互影响

02.花季团队考评,这张表包括:项目信息、员工今天的工作点数、完成进度、今天总结、明天计划、工作相关的图片和附件。事件包括:

A、初始化事件,自动获取项目信息、员工列表、自动计算选择员工的工作完成状态、日报考评信息、工作得分和工作考评级别、获取主管考评信息,事件代码:

wchar_t* GetEmployee(void *m,wchar_t *name)
{
Pair *p = ForeachMap(m);
wchar_t *result = NULL;
while(p)
{
if(wcsicmp(name,(wchar_t*)p->value)==)
{
if(!result)
{
result = (wchar_t*)p->key;
}else
{
result = concat3(result,L"\n",(wchar_t*)p->key);
}
}
p = ForeachMap(m);
}
return result;
} void * GetUserManager(void *g)
{
int row = ;
int maxRow = SnapmanGridGetTotalDataRow(g);
wchar_t *strName = NULL, *strManager = NULL;
void *result = NULL;
for(; row <= maxRow; row++)
{
strName = SnapmanCellGetText(g,row,);
strManager = SnapmanCellGetText(g,row,);
if(strName && strManager)
{
result = InsertMap(result,strName,strManager);
}
}
return result;
} int GetEvaluationRow(void *g,wchar_t *user,wchar_t *time)
{
int row = ;
int maxRow = SnapmanGridGetTotalDataRow(g);
wchar_t *d,*n;
for(; row <= maxRow; row++)
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(d&&n&&wcsicmp(time,d)==&&wcsicmp(n,user)==)return row;
}
return ;
}
wchar_t *GetEvaluationLevel(int score)
{
wchar_t *result = L("A");
if(score>=)
{
result[] = 'S';
}else if(score>=)
{
result[] = 'A';
}else if(score>=)
{
result[] = 'B';
}else if(score>=)
{
result[] = 'C';
}else
{
result[] = 'D';
}
return result;
} int GetProblemPoint(wchar_t *level)
{
if(wcsicmp(level,L("致命"))==)
{
return ;
}else if(wcsicmp(level,L("严重"))==)
{
return ;
}else if(wcsicmp(level,L("一般"))==)
{
return ;
}else if(wcsicmp(level,L("提示"))==)
{
return ;
}else
{
return ;
}
} void CalcEmployeeScope(void *g,void* gEvaluation,wchar_t *user)
{
void *gPlan = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\02.花季计划信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
int row = , totalPoint = , pTotalPoint = ,dTotalPoint = , nTaskCount = , nFinish = , nScore = ;
int erow = SnapmanGridGetTotalDataRow(gPlan);
int uFinishPoint = , uUnfinishRation = , uProblemPoint = , uProblemCount = ;
int uDailyPoinnt = , uDailyRatio = ;
int uManagerScore = , uManagerRatio = ;
int uWorkingScore = , uFinalScore = ;
//1、先运行计划中的工作进度
for(; row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gPlan,row,))==)//找到员工对应的任务
{
if(wcsicmp(Date(),SnapmanCellGetText(gPlan,row,)) >= )//只计算已经到期的任务
{
uFinishPoint += SnapmanCellGetInt(gPlan,row,) * SnapmanCellGetInt(gPlan,row,) / ;//累加完成的点数
totalPoint += SnapmanCellGetInt(gPlan,row,);//点数累加
nFinish += SnapmanCellGetInt(gPlan,row,);//进度累加
nTaskCount++;//个数累加
}
}
}
if(nTaskCount)
{
uUnfinishRation = nFinish/nTaskCount-;
}
SnapmanCellSetInt(g,,,uFinishPoint); //设置工作完成点数
SnapmanCellSetText(g,,,concat2(itostr(uUnfinishRation),L"%")); //设置进度偏差 //2、问题单考评
nTaskCount = ;
for(row = ,erow = SnapmanGridGetTotalDataRow(gProblem); row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gProblem,row,))==)//找到员工对应的任务
{
pTotalPoint += GetProblemPoint(SnapmanCellGetText(gProblem,row,));//点数累加
nTaskCount++;//个数累加
}
}
SnapmanCellSetInt(g,,,pTotalPoint); //设置问题单点数
SnapmanCellSetInt(g,,,nTaskCount); //设置问题单个数 //3、运算日报考评
nScore = nTaskCount = ;
for(row = ,erow = SnapmanGridGetTotalDataRow(gDaily); row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gDaily,row,))==)//找到员工对应的任务
{
dTotalPoint += SnapmanCellGetInt(gDaily,row,);//点数累加
nScore += SnapmanCellGetInt(gDaily,row,) * SnapmanCellGetInt(gDaily,row,);//考评分数累加
nTaskCount++;//个数累加
}
}
if(nTaskCount)
{
uDailyPoinnt = nScore / dTotalPoint;
uDailyRatio = SnapmanCellGetInt(g,,);
}
SnapmanCellSetInt(g,,,uDailyPoinnt); //设置日报考评分数 //4、运算工作得分和工作级别
uManagerScore = SnapmanCellGetInt(g,,);
uManagerRatio = SnapmanCellGetInt(g,,); uWorkingScore = (uFinishPoint - totalPoint + uFinishPoint - pTotalPoint) * ( - uDailyRatio) / totalPoint + uDailyPoinnt * uDailyRatio / ;
uFinalScore = (uFinishPoint - totalPoint + uFinishPoint - pTotalPoint) * ( - uDailyRatio - uManagerRatio) / totalPoint + uDailyPoinnt * uDailyRatio / + uManagerScore * uManagerRatio/; SnapmanCellSetInt(g,,,uWorkingScore); //设置工作得分
SnapmanCellSetText(g,,,GetEvaluationLevel(uWorkingScore)); //设置工作考评级别
SnapmanCellSetInt(g,,,uFinalScore); //设置最终得分
SnapmanCellSetText(g,,,GetEvaluationLevel(uFinalScore)); //设置最终考评级别 } void SetEmployeeChange(void *g,void *gEvaluation,wchar_t *user)
{
if(user==NULL||wcslen(user)==)return;
int row = GetEvaluationRow(gEvaluation,user,Date());
if(row > )
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//完成工作点数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//进度偏差
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//问题单点数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//问题单总数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//日报总分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//工作得分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//主管评语
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//主管打分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//最终分数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//考评级别
SnapmanCellSetText(g,,,GetEvaluationLevel(SnapmanCellGetInt(gEvaluation,row,)));//工作考评级别
}else
{
CalcEmployeeScope(g,gEvaluation,user);
}
}
void OnInitialize(void *g)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gEvaluation = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\05.花季员工考评"));
if(gProject&&gEvaluation)
{
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetText(g,,,Date());
SnapmanCellSetText(g,,,SnapmanCellGetText(gProject,,));
SnapmanCellSetCombo(g,,,GetEmployee(GetUserManager(gProject),SnapmanGetUserName()));
SnapmanCellSetText(g,,,SnapmanGetUserName());
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,);
SnapmanCellSetLock(g,,,); SnapmanCellSetComboIndex(g,,,);
SetEmployeeChange(g,gEvaluation,SnapmanCellGetText(g,,)); }
SnapmanCleanUp();
}

B、员工选择下拉框的选择事件,获取当前选择员工的工作完成状态、日报考评信息、工作得分和工作考评级别、获取主管考评信息,事件代码:

wchar_t* GetEmployee(void *m,wchar_t *name)
{
Pair *p = ForeachMap(m);
wchar_t *result = NULL;
while(p)
{
if(wcsicmp(name,(wchar_t*)p->value)==)
{
if(!result)
{
result = (wchar_t*)p->key;
}else
{
result = concat3(result,L"\n",(wchar_t*)p->key);
}
}
p = ForeachMap(m);
}
return result;
} void * GetUserManager(void *g)
{
int row = ;
int maxRow = SnapmanGridGetTotalDataRow(g);
wchar_t *strName = NULL, *strManager = NULL;
void *result = NULL;
for(; row <= maxRow; row++)
{
strName = SnapmanCellGetText(g,row,);
strManager = SnapmanCellGetText(g,row,);
if(strName && strManager)
{
result = InsertMap(result,strName,strManager);
}
}
return result;
} int GetEvaluationRow(void *g,wchar_t *user,wchar_t *time)
{
int row = ;
int maxRow = SnapmanGridGetTotalDataRow(g);
wchar_t *d,*n;
for(; row <= maxRow; row++)
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(d&&n&&wcsicmp(time,d)==&&wcsicmp(n,user)==)return row;
}
return ;
}
wchar_t *GetEvaluationLevel(int score)
{
wchar_t *result = L("A");
if(score>=)
{
result[] = 'S';
}else if(score>=)
{
result[] = 'A';
}else if(score>=)
{
result[] = 'B';
}else if(score>=)
{
result[] = 'C';
}else
{
result[] = 'D';
}
return result;
} int GetProblemPoint(wchar_t *level)
{
if(wcsicmp(level,L("致命"))==)
{
return ;
}else if(wcsicmp(level,L("严重"))==)
{
return ;
}else if(wcsicmp(level,L("一般"))==)
{
return ;
}else if(wcsicmp(level,L("提示"))==)
{
return ;
}else
{
return ;
}
} void CalcEmployeeScope(void *g,void* gEvaluation,wchar_t *user)
{
void *gPlan = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\02.花季计划信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
int row = , totalPoint = , pTotalPoint = ,dTotalPoint = , nTaskCount = , nFinish = , nScore = ;
int erow = SnapmanGridGetTotalDataRow(gPlan);
int uFinishPoint = , uUnfinishRation = , uProblemPoint = , uProblemCount = ;
int uDailyPoinnt = , uDailyRatio = ;
int uManagerScore = , uManagerRatio = ;
int uWorkingScore = , uFinalScore = ;
//1、先运行计划中的工作进度
for(; row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gPlan,row,))==)//找到员工对应的任务
{
if(wcsicmp(Date(),SnapmanCellGetText(gPlan,row,)) >= )//只计算已经到期的任务
{
uFinishPoint += SnapmanCellGetInt(gPlan,row,) * SnapmanCellGetInt(gPlan,row,) / ;//累加完成的点数
totalPoint += SnapmanCellGetInt(gPlan,row,);//点数累加
nFinish += SnapmanCellGetInt(gPlan,row,);//进度累加
nTaskCount++;//个数累加
}
}
}
if(nTaskCount)
{
uUnfinishRation = nFinish/nTaskCount-;
}
SnapmanCellSetInt(g,,,uFinishPoint); //设置工作完成点数
SnapmanCellSetText(g,,,concat2(itostr(uUnfinishRation),L"%")); //设置进度偏差 //2、问题单考评
nTaskCount = ;
for(row = ,erow = SnapmanGridGetTotalDataRow(gProblem); row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gProblem,row,))==)//找到员工对应的任务
{
pTotalPoint += GetProblemPoint(SnapmanCellGetText(gProblem,row,));//点数累加
nTaskCount++;//个数累加
}
}
SnapmanCellSetInt(g,,,pTotalPoint); //设置问题单点数
SnapmanCellSetInt(g,,,nTaskCount); //设置问题单个数 //3、运算日报考评
nScore = nTaskCount = ;
for(row = ,erow = SnapmanGridGetTotalDataRow(gDaily); row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gDaily,row,))==)//找到员工对应的任务
{
dTotalPoint += SnapmanCellGetInt(gDaily,row,);//点数累加
nScore += SnapmanCellGetInt(gDaily,row,) * SnapmanCellGetInt(gDaily,row,);//考评分数累加
nTaskCount++;//个数累加
}
}
if(nTaskCount)
{
uDailyPoinnt = nScore / dTotalPoint;
uDailyRatio = SnapmanCellGetInt(g,,);
}
SnapmanCellSetInt(g,,,uDailyPoinnt); //设置日报考评分数 //4、运算工作得分和工作级别
uManagerScore = SnapmanCellGetInt(g,,);
uManagerRatio = SnapmanCellGetInt(g,,);
Print("%d",uDailyPoinnt * uDailyRatio / );
uWorkingScore = (uFinishPoint - totalPoint + uFinishPoint - pTotalPoint) * ( - uDailyRatio) / totalPoint + uDailyPoinnt * uDailyRatio / ;
uFinalScore = (uFinishPoint - totalPoint + uFinishPoint - pTotalPoint) * ( - uDailyRatio - uManagerRatio) / totalPoint + uDailyPoinnt * uDailyRatio / + uManagerScore * uManagerRatio/; SnapmanCellSetInt(g,,,uWorkingScore); //设置工作得分
SnapmanCellSetText(g,,,GetEvaluationLevel(uWorkingScore)); //设置工作考评级别
SnapmanCellSetInt(g,,,uFinalScore); //设置最终得分
SnapmanCellSetText(g,,,GetEvaluationLevel(uFinalScore)); //设置最终考评级别 } void SetEmployeeChange(void *g,void *gEvaluation,wchar_t *user)
{
if(user==NULL||wcslen(user)==)return;
int row = GetEvaluationRow(gEvaluation,user,Date());
if(row > )
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//完成工作点数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//进度偏差
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//问题单点数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//问题单总数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//日报总分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//工作得分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//主管评语
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//主管打分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//最终分数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//考评级别
SnapmanCellSetText(g,,,GetEvaluationLevel(SnapmanCellGetInt(gEvaluation,row,)));//工作考评级别
}else
{
CalcEmployeeScope(g,gEvaluation,user);
}
}
void OnComboChanged(void *g, int row, int col,wchar_t *text)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gEvaluation = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\05.花季员工考评"));
if(gProject&&gEvaluation)
{
SetEmployeeChange(g,gEvaluation,text);
}
SnapmanCleanUp();
}

C、提交员工考评按钮事件,并最终计算员工的考评级别,事件代码:

wchar_t* GetEmployee(void *m,wchar_t *name)
{
Pair *p = ForeachMap(m);
wchar_t *result = NULL;
while(p)
{
if(wcsicmp(name,(wchar_t*)p->value)==)
{
if(!result)
{
result = (wchar_t*)p->key;
}else
{
result = concat3(result,L"\n",(wchar_t*)p->key);
}
}
p = ForeachMap(m);
}
return result;
} void * GetUserManager(void *g)
{
int row = ;
int maxRow = SnapmanGridGetTotalDataRow(g);
wchar_t *strName = NULL, *strManager = NULL;
void *result = NULL;
for(; row <= maxRow; row++)
{
strName = SnapmanCellGetText(g,row,);
strManager = SnapmanCellGetText(g,row,);
if(strName && strManager)
{
result = InsertMap(result,strName,strManager);
}
}
return result;
} int GetEvaluationRow(void *g,wchar_t *user,wchar_t *time)
{
int row = ;
int maxRow = SnapmanGridGetTotalDataRow(g);
wchar_t *d,*n;
for(; row <= maxRow; row++)
{
d = SnapmanCellGetText(g,row,);
n = SnapmanCellGetText(g,row,);
if(d&&n&&wcsicmp(time,d)==&&wcsicmp(n,user)==)return row;
}
return ;
}
wchar_t *GetEvaluationLevel(int score)
{
wchar_t *result = L("A");
if(score>=)
{
result[] = 'S';
}else if(score>=)
{
result[] = 'A';
}else if(score>=)
{
result[] = 'B';
}else if(score>=)
{
result[] = 'C';
}else
{
result[] = 'D';
}
return result;
} int GetProblemPoint(wchar_t *level)
{
if(wcsicmp(level,L("致命"))==)
{
return ;
}else if(wcsicmp(level,L("严重"))==)
{
return ;
}else if(wcsicmp(level,L("一般"))==)
{
return ;
}else if(wcsicmp(level,L("提示"))==)
{
return ;
}else
{
return ;
}
} void CalcEmployeeScope(void *g,void* gEvaluation,wchar_t *user)
{
void *gPlan = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\02.花季计划信息"));
void *gProblem = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\04.花季问题跟踪"));
void *gDaily = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\03.花季工作日报"));
int row = , totalPoint = , pTotalPoint = ,dTotalPoint = , nTaskCount = , nFinish = , nScore = ;
int erow = SnapmanGridGetTotalDataRow(gPlan);
int uFinishPoint = , uUnfinishRation = , uProblemPoint = , uProblemCount = ;
int uDailyPoinnt = , uDailyRatio = ;
int uManagerScore = , uManagerRatio = ;
int uWorkingScore = , uFinalScore = ;
//1、先运行计划中的工作进度
for(; row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gPlan,row,))==)//找到员工对应的任务
{
if(wcsicmp(Date(),SnapmanCellGetText(gPlan,row,)) >= )//只计算已经到期的任务
{
uFinishPoint += SnapmanCellGetInt(gPlan,row,) * SnapmanCellGetInt(gPlan,row,) / ;//累加完成的点数
totalPoint += SnapmanCellGetInt(gPlan,row,);//点数累加
nFinish += SnapmanCellGetInt(gPlan,row,);//进度累加
nTaskCount++;//个数累加
}
}
}
if(nTaskCount)
{
uUnfinishRation = nFinish/nTaskCount-;
}
SnapmanCellSetInt(g,,,uFinishPoint); //设置工作完成点数
SnapmanCellSetText(g,,,concat2(itostr(uUnfinishRation),L"%")); //设置进度偏差 //2、问题单考评
nTaskCount = ;
for(row = ,erow = SnapmanGridGetTotalDataRow(gProblem); row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gProblem,row,))==)//找到员工对应的任务
{
pTotalPoint += GetProblemPoint(SnapmanCellGetText(gProblem,row,));//点数累加
nTaskCount++;//个数累加
}
}
SnapmanCellSetInt(g,,,pTotalPoint); //设置问题单点数
SnapmanCellSetInt(g,,,nTaskCount); //设置问题单个数 //3、运算日报考评
nScore = nTaskCount = ;
for(row = ,erow = SnapmanGridGetTotalDataRow(gDaily); row <= erow; row++)
{
if(wcsicmp(user,SnapmanCellGetText(gDaily,row,))==)//找到员工对应的任务
{
dTotalPoint += SnapmanCellGetInt(gDaily,row,);//点数累加
nScore += SnapmanCellGetInt(gDaily,row,) * SnapmanCellGetInt(gDaily,row,);//考评分数累加
nTaskCount++;//个数累加
}
}
if(nTaskCount)
{
uDailyPoinnt = nScore / dTotalPoint;
uDailyRatio = SnapmanCellGetInt(g,,);
}
SnapmanCellSetInt(g,,,uDailyPoinnt); //设置日报考评分数 //4、运算工作得分和工作级别
uManagerScore = SnapmanCellGetInt(g,,);
uManagerRatio = SnapmanCellGetInt(g,,); uWorkingScore = (uFinishPoint - totalPoint + uFinishPoint - pTotalPoint) * ( - uDailyRatio) / totalPoint + uDailyPoinnt * uDailyRatio / ;
uFinalScore = (uFinishPoint - totalPoint + uFinishPoint - pTotalPoint) * ( - uDailyRatio - uManagerRatio) / totalPoint + uDailyPoinnt * uDailyRatio / + uManagerScore * uManagerRatio/; SnapmanCellSetInt(g,,,uWorkingScore); //设置工作得分
SnapmanCellSetText(g,,,GetEvaluationLevel(uWorkingScore)); //设置工作考评级别
SnapmanCellSetInt(g,,,uFinalScore); //设置最终得分
SnapmanCellSetText(g,,,GetEvaluationLevel(uFinalScore)); //设置最终考评级别 } int SetEmployeeChange(void *g,void *gEvaluation,wchar_t *user)
{
if(user==NULL||wcslen(user)==)return ;
int row = GetEvaluationRow(gEvaluation,user,Date());
if(row > )
{
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//完成工作点数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//进度偏差
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//问题单点数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//问题单总数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//日报总分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//工作得分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//主管评语
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//主管打分
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//最终分数
SnapmanCellSetText(g,,,SnapmanCellGetText(gEvaluation,row,));//考评级别
SnapmanCellSetText(g,,,GetEvaluationLevel(SnapmanCellGetInt(gEvaluation,row,)));//工作考评级别
}
CalcEmployeeScope(g,gEvaluation,user);
return row;
} void SaveEvaluation(void *g,void *gEvaluation,int row)
{
if(row==)row = SnapmanGridGetTotalDataRow(gEvaluation) + ;
SnapmanCellSetInt(gEvaluation,row,,row-); //设置序号
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //设置考评员工
SnapmanCellSetText(gEvaluation,row,,Date()); //设置考评时间
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //完成工作点数
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //进度偏差
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //问题单点数
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //问题单总数
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //日报总分
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //工作得分
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //主管评语
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //主管打分
SnapmanCellSetText(gEvaluation,row,,SnapmanGetUserName()); //设置主管
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,)); //最终分数
SnapmanCellSetText(gEvaluation,row,,SnapmanCellGetText(g,,));//考评级别
SnapmanGridSave(gEvaluation);
Print("员工考评提交成功。");
} void OnButtonClick(void *g, int row, int col)
{
if(SnapmanCellIsEmpty(g,,))
{
Print("请填写主管评语哦。");
return;
}else if(SnapmanCellIsEmpty(g,,))
{
Print("请填写主管打分。");
return;
}else
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\01.花季项目信息"));
void *gEvaluation = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\05.花季员工考评"));
if(gProject&&gEvaluation)
{
SaveEvaluation(g,gEvaluation,SetEmployeeChange(g,gEvaluation,SnapmanCellGetText(g,,)));
}
SnapmanCleanUp();
}
}

D、最终代码写完后将表格设置为不可以保存状态,这样表格就只能用来工作而不能用来存储数据,这样每个人写的员工考评就不会产生相互影响

03.花季项目进度,这张表包括:设计、开发、测试、版本发布进展,项目总体进展和预计项目完成时间。事件包括:

A、初始化事件,自动获计算设计、开发、测试、版本发布进展,项目总体进展和预计项目完成时间,事件代码:

void SetProjectInfo(void *g,void *gProject)
{
wchar_t *strProgress = NULL, *strDiff = NULL, *strStep = NULL;
wchar_t *strStep1 = L("设计");
wchar_t *strStep2 = L("开发");
wchar_t *strStep3 = L("测试");
wchar_t *strStep4 = L("版本发布");
wchar_t *strStarTime = SnapmanCellGetText(gProject,,);
char buffer[] = {};
int index = ;
double nd[] = {};//总进度
double id[] = {};//到今天个数
double td[] = {};//总个数
double nto = ,ito = ,tto = ;
int srow = ;
for(int row = SnapmanGridGetTotalDataRow(gProject); row >= ; row--)
{
strStep = SnapmanCellGetText(gProject,row,);
if(wcsicmp(strStep,strStep1)==)
{
index = ;
}else if(wcsicmp(strStep,strStep2)==)
{
index = ;
}else if(wcsicmp(strStep,strStep3)==)
{
index = ;
}else
{
index = ;
} if(wcsicmp(Date(),SnapmanCellGetText(gProject,row,)) >= )
{
tto++;
td[index]++;
}
nd[index] += SnapmanCellGetInt(gProject,row,);
nto += SnapmanCellGetInt(gProject,row,);
id[index]++;
ito++;
}
for(int i = ; i < ; i++)
{
if(id[i]==)
{
SnapmanCellSetText(g,srow,,L" -");
}else
{
sprintf(buffer," %.1f",nd[i]/id[i]);
SnapmanCellSetText(g,srow,,concat2(L(buffer),L"%"));
}
if(td[i]==)
{
SnapmanCellSetText(g,srow+,,L" -");
}else
{
sprintf(buffer," %.1f",(nd[i]-td[i]*)/td[i]);
SnapmanCellSetText(g,srow+,,concat2(L(buffer),L"%"));
}
srow += ;
}
if(ito==)
{
SnapmanCellSetText(g,,,L" -");
}else
{
sprintf(buffer,"%.1f",nto/ito);
SnapmanCellSetText(g,,,concat2(L(buffer),L"%"));
}
if(tto==)
{
SnapmanCellSetText(g,,,L" -");
}else
{
sprintf(buffer," %.1f",(nto-tto*)/tto);
SnapmanCellSetText(g,,,concat2(L(buffer),L"%"));
}
SnapmanCellSetText(g,,,SnapmanCellGetText(gProject,,)); if(strStarTime==NULL||wcslen(strStarTime)==)
{
SnapmanCellSetText(g,,,L" -");
}else
{
int n = DiffDay(Date(),strStarTime);
int d = ito==?:(int)((-nto/ito/) * n);
if(d < )d = ;
SnapmanCellSetText(g,,,AddDay(SnapmanCellGetText(gProject,,),d));
}
} void OnInitialize(void *g)
{
void *gProject = SnapmanGetGrid(L("\\花季项目管理系统\\Data\\02.花季计划信息"));
if(gProject)
{
SetProjectInfo(g,gProject);
}
}

        四、结论:就这样一个比较完整的项目管理系统就开发完成了,系统花了不到2天进行业务设计花了1天多一点进行事件代码开发;虽然有70%代码是重复的单不影响执行性能;Snapman将系统开发工作降低到业务设计量的工作直接超过了开发工作量。

Snapmanb版本的下载地址:http://www.snapman.xyz

怎么用snapman一个人在三天内开发出一个复杂的软件开发项目管理系统的更多相关文章

  1. 三、临时弹出一个QQ对话窗口

    第一种:需要添加好友才可以访问 <a href="http://wpa.qq.com/msgrd?v=3&uin=317985559&site=qq&menu= ...

  2. [moka同学笔记]php 获取时间(今天,昨天,三天内,本周,上周,本月,三年内,半年内,一年内,三年内)

    <?php /** * php 获取时间(今天,昨天,三天内,本周,上周,本月,三年内,半年内,一年内,三年内) * * author:ihelloworld2010@gmail.com * d ...

  3. ytu 1061: 从三个数中找出最大的数(水题,模板函数练习 + 宏定义练习)

    1061: 从三个数中找出最大的数 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 124[Submit][Status][We ...

  4. MS CRM 2011的自定义和开发(11)——插件(plugin)开发(三)

    http://www.cnblogs.com/StoneGarden/archive/2012/02/06/2340661.html MS CRM 2011的自定义和开发(11)——插件(plugin ...

  5. 程序员带你十天快速入门Python,玩转电脑软件开发(三)

    声明:本次教程主要适用于已经习得一门编程语言的程序员.想要学习第二门语言.有梦想,立志做全栈攻城狮的你 . 如果是小白,也可以学习本教程.不过可能有些困难.如有问题在文章下方进行讨论.或者添加QQ群5 ...

  6. python关于list的三个内置函数filter(), map(), reduce()

    ''' Python --version :Python 2.7.11 Quote : https://docs.python.org/2/tutorial/datastructures.html#m ...

  7. 2018-2019-20175205 实验三敏捷开发与XP实践《Java开发环境的熟悉》实验报告

    2018-2019-20175205 实验三敏捷开发与XP实践<Java开发环境的熟悉>实验报告 实验要求 没有Linux基础的同学建议先学习<Linux基础入门(新版)>&l ...

  8. 一起学习造轮子(三):从零开始写一个React-Redux

    本文是一起学习造轮子系列的第三篇,本篇我们将从零开始写一个React-Redux,本系列文章将会选取一些前端比较经典的轮子进行源码分析,并且从零开始逐步实现,本系列将会学习Promises/A+,Re ...

  9. Powershell极速教程-如何在三分钟内编写项目编译脚本

    分析及思路 来看一下项目目录结构 炒鸡正常的三板斧src+docs+tests.咦,怎么会多出一个build的文件夹呢,这就是我们今天要研究的目录.今天我会带着大家在五分钟之内编写一个极简的编译脚本. ...

随机推荐

  1. iis部署wcf服务过程

    一.在iis网站中添加wcf服务,一直添加到web.config目录即可 二.点击基本设置-->连接为-->特定用户.填写登入电脑的用户名和密码. 三.点击身份验证 四.控制面板,设置防火 ...

  2. 0.搭建myeclipse开发环境

    1.配置jdk 2.myeclipse集成tomcat 选择默认jdk

  3. Ext 创建workspace package

    Ext 创建workspace package Package ExtJs Project 1. 创建工作区间文件目录 md wpt 2. 进入目录 cd wpt 3. 创建 创建工作区间 sench ...

  4. 关于IO流代码BufferedReader

    package JBJADV003;import java.io.*;public class BufferedReaderTest { /** * @param args */ public sta ...

  5. 跟我一起读postgresql源码(六)——Executor(查询执行模块之——查询执行策略)

    时光荏苒,岁月如梭.楼主已经很久没有更新了.之前说好的一周一更的没有做到.实在是事出有因,没能静下心来好好看代码.当然这不能作为我不更新的理由,时间挤挤还是有的,拖了这么久,该再写点东西了,不然人就怠 ...

  6. Java 容器在实际项目中的应用

    前言:在java开发中我们离不开集合数组等,在java中有个专有名词:"容器" ,下面会结合Thinking in Java的知识和实际开发中业务场景讲述一下容器在Web项目中的用 ...

  7. 求n个逆元的O(n)算法

    它的推导过程如下,设,那么 对上式两边同时除,进一步得到 再把和替换掉,最终得到 初始化,这样就可以通过递推法求出模奇素数的所有逆元了. 转自  http://blog.csdn.net/acdrea ...

  8. NLP中的用N-gram语言模型做英语完型填空的环境搭建

    本文是对xing_NLP中的用N-gram语言模型做完型填空这样一个NLP项目环境搭建的一个说明,本来想写在README.md中.第一次用github中的wiki,想想尝试一下也不错,然而格式非常的混 ...

  9. 教你做炫酷的碎片式图片切换 (canvas)

    前言 老规矩,先上 DEMO 和 源码.图片区域是可以点击的,动画会从点击的位置开始发生. 本来这个效果是我3年前做的,只是当是是用无数个 div 标签完成的,性能比较成问题,在移动端完全跑不动.最近 ...

  10. oracle-plsql序列问题

    场景:用来汇总工作中数据库的异常问题! 1 问题 序列在会话中未定义 解决: 创建Sequence后直接查询它的当前值(CURRVAL)会出错,要先调用Sequence对象.NEXTVAL,才能查询当 ...