11
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using BLL.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -737,5 +738,33 @@ Where ProjectId=@ProjectId ";
|
||||
int count = GetDataService.SendCarNo(this.ProjectId);
|
||||
Alert.ShowInTop("刷新完成" + count.ToString() + "条。", MessageBoxIcon.Success);
|
||||
}
|
||||
|
||||
protected void btnToYunMou_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var sitePerson = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == rowID);
|
||||
var person = Funs.DB.Person_Persons.FirstOrDefault(x => x.IdentityCard == sitePerson.IdentityCard);
|
||||
if (!string.IsNullOrEmpty(person.PhotoUrl))
|
||||
{
|
||||
var token = YunMouHelper.getToken();
|
||||
var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId);
|
||||
|
||||
var res1 = YunMouHelper.addPerson(person.IdentityCard, person.PersonName, string.IsNullOrEmpty(person.Telephone) ? "" : person.Telephone, person.PhotoUrl, token);
|
||||
var res2 = YunMouHelper.addPersonsToGroups(project.YunMouGroupId, new string[] { person.IdentityCard }, token);
|
||||
person.YunMouState = "已经同步";
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
this.BindGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择用户", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user