/// <summary> /// 同步枪位信息 /// </summary> /// <param name="unit_id"></param> /// <param name="gunark_id"></param> public static void syn_Gun_Position_Info(string unit_id, string gunark_id) { BLL.position_info gun_position_info_bll = new Gunark.BLL.position_info(); WebService.gunServices webService = SingleWebService.getWebService(); WebService.gunPositionInfo[] gun_position_info_list = webService.getGunPositionInfo(unit_id, gunark_id); for (int i = 0; i < gun_position_info_list.Length; i++) { if (!gun_position_info_bll.Exists(gun_position_info_list[i].gun_Position_Info_Id)) { Model.position_info gun_position_info = new Gunark.Model.position_info(); gun_position_info.GUN_POSITION_INFO_ID = gun_position_info_list[i].gun_Position_Info_Id; gun_position_info.UNIT_ID = gun_position_info_list[i].unitInfo.unitInfoCode; gun_position_info.GUNARK_ID = gun_position_info_list[i].gunArk.gunarkId; gun_position_info.GUN_POSITION_NUMBER = gun_position_info_list[i].gun_Position_Number; gun_position_info.GUN_POSITION_STATUS = gun_position_info_list[i].gun_Position_Status.ToString();; gun_position_info.GUN_INFO_ID = gun_position_info_list[i].gun_Info_ID; gun_position_info.GUN_BULLET_NUMBER = gun_position_info_list[i].gun_Bullet_Number; gun_position_info.GUN_TYPE = gun_position_info_list[i].gun_Bullet_Name; gun_position_info_bll.Add(gun_position_info); } } }
private static void addTask(string prams) { Bll.task_info task_info_bll = new Gunark.BLL.task_info(); Bll.task_info_detail task_detail_info_bll = new Gunark.BLL.task_info_detail(); Bll.position_info position_info_bll = new Gunark.BLL.position_info(); Bll.gun_info gun_info_bll = new Gunark.BLL.gun_info(); Bll.magazine_info magazine_info_bll = new Gunark.BLL.magazine_info(); int j = 10; string[] attributes = prams.Split('|'); //任务信息 Model.task_info task_info = new Gunark.Model.task_info(); task_info.task_ID = attributes[0]; task_info.GUNARK_ID = attributes[1]; task_info.UNIT_ID = attributes[2]; task_info.TASK_STATUS = attributes[3]; task_info.TASK_BIGTYPE = int.Parse(attributes[4]); task_info.TASK_SMALLTYPE = attributes[5]; task_info.TASK_PROPERTY = attributes[6]; task_info.TASK_PLAN_BEGINTIME = attributes[7]; task_info.TASK_PLAN_FINISHTIME = attributes[8]; task_info.TASK_APPLY_USERID = attributes[9]; task_info.TASK_APPLY_TIME = attributes[10]; task_info_bll.Add(task_info); //任务详情信息 int task_detail_info_count = int.Parse(attributes[11].Substring(1, attributes[11].LastIndexOf("&") - 1)); for (int i = 0; i < task_detail_info_count; i++) { Model.task_info_detail task_detail_info = new Gunark.Model.task_info_detail(); if(i == 0) task_detail_info.TASK_DETAIL_ID = attributes[++j].Substring(attributes[j].LastIndexOf("&") + 1); else task_detail_info.TASK_DETAIL_ID = attributes[++j]; task_detail_info.TASK_ID = attributes[++j]; task_detail_info.GUNARK_ID = attributes[++j]; task_detail_info.UNIT_ID = attributes[++j]; task_detail_info.GUN_INFO_ID = attributes[++j]; task_detail_info.GUN_POSITION_INFO_ID = attributes[++j]; task_detail_info.GUN_DUTY_USER = attributes[++j]; task_detail_info.BULLET_TYPE = attributes[++j]; task_detail_info.MAGAZINE_INFO_ID = attributes[++j]; task_detail_info.APPLY_BULLET_QTY = int.Parse(attributes[++j]); task_detail_info.DEPLETION_BULLET_QTY = int.Parse(attributes[++j]); if (i != task_detail_info_count - 1) ++j; task_detail_info_bll.Add(task_detail_info); } //枪位信息 int gun_position_info_count = 0; try { gun_position_info_count = int.Parse(attributes[j + 1].Substring(1, attributes[j + 1].LastIndexOf("&") - 1)); } catch { } if (gun_position_info_count != 0) { for (int i = 0; i < gun_position_info_count; i++) { Model.position_info gun_position_info = new Gunark.Model.position_info(); if (i == 0) gun_position_info.GUN_POSITION_INFO_ID = attributes[++j].Substring(3); else gun_position_info.GUN_POSITION_INFO_ID = attributes[++j]; gun_position_info.GUNARK_ID = attributes[++j]; gun_position_info.UNIT_ID = attributes[++j]; gun_position_info.GUN_POSITION_NUMBER = attributes[++j]; gun_position_info.GUN_POSITION_STATUS = attributes[++j]; gun_position_info.GUN_INFO_ID = attributes[++j]; gun_position_info.GUN_BULLET_NUMBER = attributes[++j]; gun_position_info.GUN_TYPE = attributes[++j]; if (i != gun_position_info_count - 1) ++j; position_info_bll.Add(gun_position_info); } //枪支信息 int gun_info_count = int.Parse(attributes[j + 1].Substring(1, attributes[j + 1].LastIndexOf("&") - 1)); for (int i = 0; i < gun_info_count; i++) { Model.gun_info gun_info = new Gunark.Model.gun_info(); if (i == 0) gun_info.GUN_INFO_ID = attributes[++j].Substring(3); else gun_info.GUN_INFO_ID = attributes[++j]; gun_info.GUNARK_ID = attributes[++j]; gun_info.UNIT_ID = attributes[++j]; gun_info.GUN_NUMBER = attributes[++j]; gun_info.GUN_TYPE = attributes[++j]; gun_info.GUN_STATUS = attributes[++j]; gun_info.GUN_BULLET_LOCATION = attributes[++j]; if (i != gun_info_count - 1) ++j; gun_info_bll.Add(gun_info); } //弹仓信息 int magazine_info_count = int.Parse(attributes[j + 1].Substring(1, attributes[j + 1].LastIndexOf("&") - 1)); for (int i = 0; i < magazine_info_count; i++) { Model.magazine_info magazine_info = new Gunark.Model.magazine_info(); if (i == 0) magazine_info.MAGAZINE_INFO_ID = attributes[++j].Substring(3); else magazine_info.MAGAZINE_INFO_ID = attributes[++j]; magazine_info.GUNARK_ID = attributes[++j]; magazine_info.UNIT_ID = attributes[++j]; magazine_info.MAGAZINE_NUMBER = attributes[++j]; magazine_info.STOCK_QTY = int.Parse(attributes[++j]); magazine_info.CAPACITY_QTY = int.Parse(attributes[++j]); magazine_info.MAGAZINE_NAME = attributes[++j]; magazine_info.BULLET_MODEL = attributes[++j]; magazine_info.BULLET_GROUP_ID = attributes[++j]; ////if (i != magazine_info_count - 1) //// ++j; magazine_info_bll.Add(magazine_info); } } else { int magazine_info_count = 0; //弹仓信息 try { magazine_info_count = int.Parse(attributes[j + 1].Substring(7, attributes[j + 1].LastIndexOf("&") - 1)); } catch { } for (int i = 0; i < magazine_info_count; i++) { Model.magazine_info magazine_info = new Gunark.Model.magazine_info(); if (i == 0) magazine_info.MAGAZINE_INFO_ID = attributes[++j].Substring(9); else magazine_info.MAGAZINE_INFO_ID = attributes[++j]; magazine_info.GUNARK_ID = attributes[++j]; magazine_info.UNIT_ID = attributes[++j]; magazine_info.MAGAZINE_NUMBER = attributes[++j]; magazine_info.STOCK_QTY = int.Parse(attributes[++j]); magazine_info.CAPACITY_QTY = int.Parse(attributes[++j]); magazine_info.MAGAZINE_NAME = attributes[++j]; magazine_info.BULLET_MODEL = attributes[++j]; magazine_info.BULLET_GROUP_ID = attributes[++j]; ////if (i != magazine_info_count - 1) //// ++j; magazine_info_bll.Add(magazine_info); } } }
private static void addTask(string prams) { Bll.task_info task_info_bll = new Gunark.BLL.task_info(); Bll.task_info_detail task_detail_info_bll = new Gunark.BLL.task_info_detail(); Bll.position_info position_info_bll = new Gunark.BLL.position_info(); Bll.gun_info gun_info_bll = new Gunark.BLL.gun_info(); Bll.magazine_info magazine_info_bll = new Gunark.BLL.magazine_info(); int j = 10; string[] attributes = prams.Split('|'); //任务信息 Model.task_info task_info = new Gunark.Model.task_info(); task_info.task_ID = attributes[0]; task_info.GUNARK_ID = attributes[1]; task_info.UNIT_ID = attributes[2]; task_info.TASK_STATUS = attributes[3]; task_info.TASK_BIGTYPE = int.Parse(attributes[4]); task_info.TASK_SMALLTYPE = attributes[5]; task_info.TASK_PROPERTY = attributes[6]; task_info.TASK_PLAN_BEGINTIME = attributes[7]; task_info.TASK_PLAN_FINISHTIME = attributes[8]; task_info.TASK_APPLY_USERID = attributes[9]; task_info.TASK_APPLY_TIME = attributes[10]; task_info_bll.Add(task_info); //任务详情信息 int task_detail_info_count = int.Parse(attributes[11].Substring(1, attributes[11].LastIndexOf("&") - 1)); for (int i = 0; i < task_detail_info_count; i++) { Model.task_info_detail task_detail_info = new Gunark.Model.task_info_detail(); if (i == 0) { task_detail_info.TASK_DETAIL_ID = attributes[++j].Substring(attributes[j].LastIndexOf("&") + 1); } else { task_detail_info.TASK_DETAIL_ID = attributes[++j]; } task_detail_info.TASK_ID = attributes[++j]; task_detail_info.GUNARK_ID = attributes[++j]; task_detail_info.UNIT_ID = attributes[++j]; task_detail_info.GUN_INFO_ID = attributes[++j]; task_detail_info.GUN_POSITION_INFO_ID = attributes[++j]; task_detail_info.GUN_DUTY_USER = attributes[++j]; task_detail_info.BULLET_TYPE = attributes[++j]; task_detail_info.MAGAZINE_INFO_ID = attributes[++j]; task_detail_info.APPLY_BULLET_QTY = int.Parse(attributes[++j]); task_detail_info.DEPLETION_BULLET_QTY = int.Parse(attributes[++j]); if (i != task_detail_info_count - 1) { ++j; } task_detail_info_bll.Add(task_detail_info); } //枪位信息 int gun_position_info_count = 0; try { gun_position_info_count = int.Parse(attributes[j + 1].Substring(1, attributes[j + 1].LastIndexOf("&") - 1)); } catch { } if (gun_position_info_count != 0) { for (int i = 0; i < gun_position_info_count; i++) { Model.position_info gun_position_info = new Gunark.Model.position_info(); if (i == 0) { gun_position_info.GUN_POSITION_INFO_ID = attributes[++j].Substring(3); } else { gun_position_info.GUN_POSITION_INFO_ID = attributes[++j]; } gun_position_info.GUNARK_ID = attributes[++j]; gun_position_info.UNIT_ID = attributes[++j]; gun_position_info.GUN_POSITION_NUMBER = attributes[++j]; gun_position_info.GUN_POSITION_STATUS = attributes[++j]; gun_position_info.GUN_INFO_ID = attributes[++j]; gun_position_info.GUN_BULLET_NUMBER = attributes[++j]; gun_position_info.GUN_TYPE = attributes[++j]; if (i != gun_position_info_count - 1) { ++j; } position_info_bll.Add(gun_position_info); } //枪支信息 int gun_info_count = int.Parse(attributes[j + 1].Substring(1, attributes[j + 1].LastIndexOf("&") - 1)); for (int i = 0; i < gun_info_count; i++) { Model.gun_info gun_info = new Gunark.Model.gun_info(); if (i == 0) { gun_info.GUN_INFO_ID = attributes[++j].Substring(3); } else { gun_info.GUN_INFO_ID = attributes[++j]; } gun_info.GUNARK_ID = attributes[++j]; gun_info.UNIT_ID = attributes[++j]; gun_info.GUN_NUMBER = attributes[++j]; gun_info.GUN_TYPE = attributes[++j]; gun_info.GUN_STATUS = attributes[++j]; gun_info.GUN_BULLET_LOCATION = attributes[++j]; if (i != gun_info_count - 1) { ++j; } gun_info_bll.Add(gun_info); } //弹仓信息 int magazine_info_count = int.Parse(attributes[j + 1].Substring(1, attributes[j + 1].LastIndexOf("&") - 1)); for (int i = 0; i < magazine_info_count; i++) { Model.magazine_info magazine_info = new Gunark.Model.magazine_info(); if (i == 0) { magazine_info.MAGAZINE_INFO_ID = attributes[++j].Substring(3); } else { magazine_info.MAGAZINE_INFO_ID = attributes[++j]; } magazine_info.GUNARK_ID = attributes[++j]; magazine_info.UNIT_ID = attributes[++j]; magazine_info.MAGAZINE_NUMBER = attributes[++j]; magazine_info.STOCK_QTY = int.Parse(attributes[++j]); magazine_info.CAPACITY_QTY = int.Parse(attributes[++j]); magazine_info.MAGAZINE_NAME = attributes[++j]; magazine_info.BULLET_MODEL = attributes[++j]; magazine_info.BULLET_GROUP_ID = attributes[++j]; ////if (i != magazine_info_count - 1) //// ++j; magazine_info_bll.Add(magazine_info); } } else { int magazine_info_count = 0; //弹仓信息 try { magazine_info_count = int.Parse(attributes[j + 1].Substring(7, attributes[j + 1].LastIndexOf("&") - 1)); } catch { } for (int i = 0; i < magazine_info_count; i++) { Model.magazine_info magazine_info = new Gunark.Model.magazine_info(); if (i == 0) { magazine_info.MAGAZINE_INFO_ID = attributes[++j].Substring(9); } else { magazine_info.MAGAZINE_INFO_ID = attributes[++j]; } magazine_info.GUNARK_ID = attributes[++j]; magazine_info.UNIT_ID = attributes[++j]; magazine_info.MAGAZINE_NUMBER = attributes[++j]; magazine_info.STOCK_QTY = int.Parse(attributes[++j]); magazine_info.CAPACITY_QTY = int.Parse(attributes[++j]); magazine_info.MAGAZINE_NAME = attributes[++j]; magazine_info.BULLET_MODEL = attributes[++j]; magazine_info.BULLET_GROUP_ID = attributes[++j]; ////if (i != magazine_info_count - 1) //// ++j; magazine_info_bll.Add(magazine_info); } } }
/// <summary> /// 同步枪位信息 /// </summary> /// <param name="unit_id"></param> /// <param name="gunark_id"></param> public static void syn_Gun_Position_Info(string unit_id, string gunark_id) { BLL.position_info gun_position_info_bll = new Gunark.BLL.position_info(); WebService.gunServices webService = SingleWebService.getWebService(); WebService.gunPositionInfo[] gun_position_info_list = webService.getGunPositionInfo(unit_id, gunark_id); for (int i = 0; i < gun_position_info_list.Length; i++) { if (!gun_position_info_bll.Exists(gun_position_info_list[i].gun_Position_Info_Id)) { Model.position_info gun_position_info = new Gunark.Model.position_info(); gun_position_info.GUN_POSITION_INFO_ID = gun_position_info_list[i].gun_Position_Info_Id; gun_position_info.UNIT_ID = gun_position_info_list[i].unitInfo.unitInfoCode; gun_position_info.GUNARK_ID = gun_position_info_list[i].gunArk.gunarkId; gun_position_info.GUN_POSITION_NUMBER = gun_position_info_list[i].gun_Position_Number; gun_position_info.GUN_POSITION_STATUS = gun_position_info_list[i].gun_Position_Status.ToString(); ; gun_position_info.GUN_INFO_ID = gun_position_info_list[i].gun_Info_ID; gun_position_info.GUN_BULLET_NUMBER = gun_position_info_list[i].gun_Bullet_Number; gun_position_info.GUN_TYPE = gun_position_info_list[i].gun_Bullet_Name; gun_position_info_bll.Add(gun_position_info); } } }