private static Model.user analysisUser(string prams) { string[] attributes = prams.Split('|'); Model.user user = new Gunark.Model.user(); user.USER_POLICENUMB = attributes[0]; user.USER_REALNAME = attributes[1]; user.USER_NAME = attributes[2]; if (!"1".Equals(attributes[3])) { user.USER_PWD = attributes[3]; } else { user.USER_PWD = new Bll.user().GetModel(attributes[22]).USER_PWD; } user.USER_STATE = int.Parse(attributes[4]); user.USER_ADDRESS = attributes[5]; user.USER_OFFICETELEP = attributes[6]; user.USER_MOBILTELEP = attributes[7]; user.USER_SEX = int.Parse(attributes[8]); user.USER_EMAIL = attributes[9]; user.USER_POSTCODE = attributes[10]; user.USER_PRIVIEGES = int.Parse(attributes[11]); user.USER_GUNLICENSE = attributes[12]; user.USER_GUNLICENSEDATE = attributes[13]; user.USER_JOBSTATUS = int.Parse(attributes[18]); user.UNITINFO_CODE = attributes[19]; user.GROUP_ID = attributes[20]; user.USER_BANNED = int.Parse(attributes[21]); user.USER_ID = attributes[22]; return(user); }
private static void analysisUser1(string prams) { Bll.user user_bll = new Gunark.BLL.user(); int j = -1; string[] attributes = prams.Split('|'); int user_count = int.Parse(attributes[0].Substring(0, attributes[0].IndexOf("&"))); for (int i = 0; i < user_count; i++) { Model.user user = new Gunark.Model.user(); if (i == 0) { user.USER_POLICENUMB = attributes[++j].Substring(attributes[0].IndexOf("&") + 1); } else { user.USER_POLICENUMB = attributes[++j]; } user.USER_REALNAME = attributes[++j]; user.USER_NAME = attributes[++j]; user.USER_PWD = attributes[++j]; user.USER_STATE = int.Parse(attributes[++j]); user.USER_ADDRESS = attributes[++j]; user.USER_OFFICETELEP = attributes[++j]; user.USER_MOBILTELEP = attributes[++j]; user.USER_SEX = int.Parse(attributes[++j]); user.USER_EMAIL = attributes[++j]; user.USER_POSTCODE = attributes[++j]; user.USER_PRIVIEGES = int.Parse(attributes[++j]); user.USER_GUNLICENSE = attributes[++j]; user.USER_GUNLICENSEDATE = attributes[++j]; j = j + 4; user.USER_JOBSTATUS = int.Parse(attributes[++j]); user.UNITINFO_CODE = attributes[++j]; user.GROUP_ID = attributes[++j]; user.USER_BANNED = int.Parse(attributes[++j]); user.USER_ID = attributes[++j]; if (i != user_count - 1) { ++j; } user_bll.Add(user); } }
private static void analysisUser1(string prams) { Bll.user user_bll = new Gunark.BLL.user(); int j = -1; string[] attributes = prams.Split('|'); int user_count = int.Parse(attributes[0].Substring(0, attributes[0].IndexOf("&"))); for (int i = 0; i < user_count; i++) { Model.user user = new Gunark.Model.user(); if (i == 0) user.USER_POLICENUMB = attributes[++j].Substring(attributes[0].IndexOf("&") + 1); else user.USER_POLICENUMB = attributes[++j]; user.USER_REALNAME = attributes[++j]; user.USER_NAME = attributes[++j]; user.USER_PWD = attributes[++j]; user.USER_STATE = int.Parse(attributes[++j]); user.USER_ADDRESS = attributes[++j]; user.USER_OFFICETELEP = attributes[++j]; user.USER_MOBILTELEP = attributes[++j]; user.USER_SEX = int.Parse(attributes[++j]); user.USER_EMAIL = attributes[++j]; user.USER_POSTCODE = attributes[++j]; user.USER_PRIVIEGES = int.Parse(attributes[++j]); user.USER_GUNLICENSE = attributes[++j]; user.USER_GUNLICENSEDATE = attributes[++j]; j = j + 4; user.USER_JOBSTATUS = int.Parse(attributes[++j]); user.UNITINFO_CODE = attributes[++j]; user.GROUP_ID = attributes[++j]; user.USER_BANNED = int.Parse(attributes[++j]); user.USER_ID = attributes[++j]; if (i != user_count - 1) ++j; user_bll.Add(user); } }
private static Model.user analysisUser(string prams) { string[] attributes = prams.Split('|'); Model.user user = new Gunark.Model.user(); user.USER_POLICENUMB = attributes[0]; user.USER_REALNAME = attributes[1]; user.USER_NAME = attributes[2]; if (!"1".Equals(attributes[3])) user.USER_PWD = attributes[3]; else user.USER_PWD = new Bll.user().GetModel(attributes[22]).USER_PWD; user.USER_STATE = int.Parse(attributes[4]); user.USER_ADDRESS = attributes[5]; user.USER_OFFICETELEP = attributes[6]; user.USER_MOBILTELEP = attributes[7]; user.USER_SEX = int.Parse(attributes[8]); user.USER_EMAIL = attributes[9]; user.USER_POSTCODE = attributes[10]; user.USER_PRIVIEGES = int.Parse(attributes[11]); user.USER_GUNLICENSE = attributes[12]; user.USER_GUNLICENSEDATE = attributes[13]; user.USER_JOBSTATUS = int.Parse(attributes[18]); user.UNITINFO_CODE = attributes[19]; user.GROUP_ID = attributes[20]; user.USER_BANNED = int.Parse(attributes[21]); user.USER_ID = attributes[22]; return user; }
public static void analysis(WebService.synInfo synInfo) { WebService.gunServices webService = SingleWebService.getWebService(); #region model Model.gunark gunark = new Gunark.Model.gunark(); Model.user user = new Gunark.Model.user(); Model.group group = new Gunark.Model.group(); Model.gbg gbg = new Gunark.Model.gbg(); Model.fingerprint fingerPrint = new Gunark.Model.fingerprint(); #endregion model #region bll Bll.user user_bll = new Gunark.BLL.user(); Bll.gunark gunark_bll = new Gunark.BLL.gunark(); Bll.group group_bll = new Gunark.BLL.group(); Bll.gbg gbg_bll = new Gunark.BLL.gbg(); Bll.fingerprint fingerPrint_bll = new Gunark.BLL.fingerprint(); #endregion bll #region attritubes string[] attritubes = null; #endregion attritubes #region 同步类型 switch (synInfo.syn_Type) { #region 枪柜 case "枪柜信息增加"://通过 gunark = analysisGunark(synInfo.syn_Param); gunark_bll.Add(gunark); //获取枪弹绑定关系 attritubes = synInfo.syn_Param.Split('|'); WebService.gunarkGroupGunBullet[] gggb = webService.getGunarkGroupGunBullet(attritubes[0]); for (int i = 0; i < gggb.Length; i++) { Model.gbg ggbg = new Gunark.Model.gbg(); gbg.GGGBID = gggb[i].gggbId; gbg.GROUP_ID = gggb[i].groupId; gbg.GUN_LOCATION = gggb[i].gunLocation; gbg.GUNARK_ID = gggb[i].gunarkId; gbg.BULLET_LOCATION = int.Parse(gggb[i].bulletLocation); gbg_bll.Add(gbg); } break; case "枪柜信息修改"://未通过 gunark = analysisGunark(synInfo.syn_Param); gunark_bll.Update(gunark); break; case "注销"://未通过 attritubes = synInfo.syn_Param.Split('|'); gunark = gunark_bll.GetModel(attritubes[0]); gunark.GUNARK_STATUS = 0; gunark_bll.Update(gunark); break; case "是否枪弹对应"://未通过 break; case "是否使用组权限"://未通过 break; #endregion 枪柜 #region 用户(用户绑定组未通过【寄存组有问题】、新增枪柜增加用户) case "增加用户": user = analysisUser(synInfo.syn_Param); user_bll.Add(user); break; case "更新用户": user = analysisUser(synInfo.syn_Param); user_bll.Update(user); break; case "枪柜增加用户": analysisUser1(synInfo.syn_Param); break; #endregion 用户 #region 组信息(组增加已通过、新增枪柜增加组) case "增加班组": group = analysisGroup(synInfo.syn_Param); group_bll.Add(group); break; case "组注销": attritubes = synInfo.syn_Param.Split('|'); group = group_bll.GetModel(attritubes[0]); group_bll.Update(group); break; case "枪柜增加组": analysisGroup1(synInfo.syn_Param); break; #endregion 组信息 #region 枪弹组绑定关系(未测试) case "枪柜对应修改": attritubes = synInfo.syn_Param.Split('|'); gbg = gbg_bll.GetModel(attritubes[0]); gbg.GUN_LOCATION = int.Parse(attritubes[2]); gbg.BULLET_LOCATION = int.Parse(attritubes[3]); gbg_bll.Update(gbg); break; case "枪位所属组修改": attritubes = synInfo.syn_Param.Split('|'); gbg = gbg_bll.GetModelByGunPos(attritubes[0], attritubes[1]); gbg.GROUP_ID = attritubes[2]; gbg_bll.Update(gbg); break; #endregion 枪弹组绑定关系 #region 指纹信息(未测试) case "指纹增加": fingerPrint = analysisFingerPrint(synInfo.syn_Param); fingerPrint_bll.Add(fingerPrint); break; case "指纹修改": //通过USER_ID查 fingerPrint = fingerPrint_bll.GetModelByUser(attritubes[1], attritubes[4]); fingerPrint.USER_FINGERPRINT = StrToByte(attritubes[6]); fingerPrint.USER_BAN = int.Parse(attritubes[7]); fingerPrint_bll.Update(fingerPrint); break; #endregion 指纹信息 #region 增加任务(测试通过) case "增加任务": addTask(synInfo.syn_Param); break; #endregion 增加任务 default: break; } #endregion 同步类型 }
public static void analysis(WebService.synInfo synInfo) { WebService.gunServices webService = SingleWebService.getWebService(); #region model Model.gunark gunark = new Gunark.Model.gunark(); Model.user user = new Gunark.Model.user(); Model.group group = new Gunark.Model.group(); Model.gbg gbg = new Gunark.Model.gbg(); Model.fingerprint fingerPrint = new Gunark.Model.fingerprint(); #endregion model #region bll Bll.user user_bll = new Gunark.BLL.user(); Bll.gunark gunark_bll = new Gunark.BLL.gunark(); Bll.group group_bll = new Gunark.BLL.group(); Bll.gbg gbg_bll = new Gunark.BLL.gbg(); Bll.fingerprint fingerPrint_bll = new Gunark.BLL.fingerprint(); #endregion bll #region attritubes string[] attritubes = null; #endregion attritubes #region 步类型 switch (synInfo.syn_Type) { #region 枪柜 case "枪柜信息增加": //通过 gunark = analysisGunark(synInfo.syn_Param); gunark_bll.Add(gunark); //获取枪弹绑定关系 attritubes = synInfo.syn_Param.Split('|'); WebService.gunarkGroupGunBullet[] gggb = webService.getGunarkGroupGunBullet(attritubes[0]); for (int i = 0; i < gggb.Length; i++) { Model.gbg ggbg = new Gunark.Model.gbg(); gbg.GGGBID = gggb[i].gggbId; gbg.GROUP_ID = gggb[i].groupId; gbg.GUN_LOCATION = gggb[i].gunLocation; gbg.GUNARK_ID = gggb[i].gunarkId; gbg.BULLET_LOCATION = int.Parse(gggb[i].bulletLocation); gbg_bll.Add(gbg); } break; case "枪柜信息修改": //未通过 gunark = analysisGunark(synInfo.syn_Param); gunark_bll.Update(gunark); break; case "注销": //未通过 attritubes = synInfo.syn_Param.Split('|'); gunark = gunark_bll.GetModel(attritubes[0]); gunark.GUNARK_STATUS = 0; gunark_bll.Update(gunark); break; case "是否枪弹对应": //未通过 break; case "是否使用组权限": //未通过 break; #endregion 枪柜 #region 用户(用户绑定组未通过【寄存组有问题】、新增枪柜增加用户) case "增加用户": user = analysisUser(synInfo.syn_Param); user_bll.Add(user); break; case "更新用户": user = analysisUser(synInfo.syn_Param); user_bll.Update(user); break; case "枪柜增加用户": analysisUser1(synInfo.syn_Param); break; #endregion 用户 #region 组信息(组增加已通过、新增枪柜增加组) case "增加班组": group = analysisGroup(synInfo.syn_Param); group_bll.Add(group); break; case "组注销": attritubes = synInfo.syn_Param.Split('|'); group = group_bll.GetModel(attritubes[0]); group_bll.Update(group); break; case "枪柜增加组": analysisGroup1(synInfo.syn_Param); break; #endregion 组信息 #region 枪弹组绑定关系(未测试) case "枪柜对应修改": attritubes = synInfo.syn_Param.Split('|'); gbg = gbg_bll.GetModel(attritubes[0]); gbg.GUN_LOCATION = int.Parse(attritubes[2]); gbg.BULLET_LOCATION = int.Parse(attritubes[3]); gbg_bll.Update(gbg); break; case "枪位所属组修改": attritubes = synInfo.syn_Param.Split('|'); gbg = gbg_bll.GetModelByGunPos(attritubes[0], attritubes[1]); gbg.GROUP_ID = attritubes[2]; gbg_bll.Update(gbg); break; #endregion 枪弹组绑定关系 #region 指纹信息(未测试) case "指纹增加": fingerPrint = analysisFingerPrint(synInfo.syn_Param); fingerPrint_bll.Add(fingerPrint); break; case "指纹修改": //通过USER_ID查 fingerPrint = fingerPrint_bll.GetModelByUser(attritubes[1], attritubes[4]); fingerPrint.USER_FINGERPRINT = StrToByte(attritubes[6]); fingerPrint.USER_BAN = int.Parse(attritubes[7]); fingerPrint_bll.Update(fingerPrint); break; #endregion 指纹信息 #region 增加任务(测试通过) case "增加任务": addTask(synInfo.syn_Param); break; #endregion 增加任务 default: break; } #endregion 步类型 }