private void SyncToPSI(marketSalesActiveActEntity ent, List <marketSalesActiveActSubEntity> subEnts) { DateTime date = System.DateTime.Now; string CREATE_DATE = date.ToString("yyyyMMddHHmmss"); JS5_S12_SALES_ACT_DATA_M_UPTableAdapter ad = new JS5_S12_SALES_ACT_DATA_M_UPTableAdapter(); DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_FILE_UPLOADTableAdapter fileAd = new JS5_S12_SALES_FILE_UPLOADTableAdapter(); JS5_S12_SALES_ACT_DATA_D_UPTableAdapter adSub = new JS5_S12_SALES_ACT_DATA_D_UPTableAdapter(); String StatusCode = "002"; String StatusName = "已確認"; if (ent.is_Delete == 1) { StatusCode = "004"; StatusName = "已作废"; } ad.InsertQuery(ent.id, 1, ent.sales_No, CREATE_DATE, CREATE_DATE, "PSIadmin_APP@" + CREATE_DATE + "@APP", "PSIadmin_APP@" + CREATE_DATE + "@APP", 1, "FLNET", ent.ACT_NO, ent.ACT_NAME, ent.ACT_REPORT_NO, ent.SHOP_CODE, ent.SHOP_NAME, StatusCode, StatusName, "无", "无", ent.id, 1, "PSIadmin_APP", date, date); if (ent.file_id_Type002 != null && !ent.file_id_Type002.Equals("")) { string[] fileids = ent.file_id_Type002.Split(",".ToCharArray()); string physical_path = System.DateTime.Now.ToString("yyyyMM"); foreach (string fileid in fileids) { //写入发票信息 fileAd.InsertQuery(System.Guid.NewGuid().ToString(), fileid + ".jpg", ent.sales_No, System.DateTime.Now, ent.sales_No, System.DateTime.Now, 1, "jpg", 0, "", fileid + ".jpg", physical_path, "", "P13051", ent.id, "PDG1350", "002", "活動照片", ent.id, "Normal", "正常", 1, "PSIadmin_APP", date, date); } } if (ent.file_id_Type003 != null && !ent.file_id_Type003.Equals("")) { string[] fileids = ent.file_id_Type003.Split(",".ToCharArray()); string physical_path = System.DateTime.Now.ToString("yyyyMM"); foreach (string fileid in fileids) { //写入发票信息 fileAd.InsertQuery(System.Guid.NewGuid().ToString(), fileid + ".jpg", ent.sales_No, System.DateTime.Now, ent.sales_No, System.DateTime.Now, 1, "jpg", 0, "", fileid + ".jpg", physical_path, "", "P13051", ent.id, "PDG1350", "003", "DM照片", ent.id, "Normal", "正常", 1, "PSIadmin_APP", date, date); } } if (ent.file_id_Type004 != null && !ent.file_id_Type004.Equals("")) { string[] fileids = ent.file_id_Type004.Split(",".ToCharArray()); string physical_path = System.DateTime.Now.ToString("yyyyMM"); foreach (string fileid in fileids) { //写入发票信息 fileAd.InsertQuery(System.Guid.NewGuid().ToString(), fileid + ".jpg", ent.sales_No, System.DateTime.Now, ent.sales_No, System.DateTime.Now, 1, "jpg", 0, "", fileid + ".jpg", physical_path, "", "P13051", ent.id, "PDG1350", "004", "其他", ent.id, "Normal", "正常", 1, "PSIadmin_APP", date, date); } } //foreach (var subEnt in subEnts) //{ // String subStatusCode = "002"; // String subStatusName = "已確認"; // if (subEnt.isDelete == 1) // { // subStatusCode = "004"; // subStatusName = "已作废"; // } // adSub.InsertQuery(subEnt.id, 1, ent.sales_No, CREATE_DATE, CREATE_DATE, "PSIadmin_APP@" + CREATE_DATE + "@APP", "PSIadmin_APP@" + CREATE_DATE + "@APP", 1, "FLNET" // , ent.ACT_REPORT_NO, subEnt.ACT_REPORT_ITEM_NO.Value, subEnt.BRAND_CODE, subEnt.BRAND_NAME, subEnt.MACHINE_MODEL_NO, (decimal)subEnt.SALES_PRICE.Value, subEnt.T_TVSIZEID, subEnt.TVSIZE.Value, subEnt.IS_NEW_PRD_FLAG.Value // , subStatusCode, subStatusName, "无", "无", subEnt.id, 1, "PSIadmin_APP", date, date); // //写入图片信息 // if (subEnt.file_id_Type001 != null && !subEnt.file_id_Type001.Equals("")) // { // string[] fileids = subEnt.file_id_Type001.Split(",".ToCharArray()); // string physical_path = System.DateTime.Now.ToString("yyyyMM"); // foreach (string fileid in fileids) // { // //写入发票信息 // fileAd.InsertQuery(System.Guid.NewGuid().ToString(), fileid + ".jpg", ent.sales_No, System.DateTime.Now, ent.sales_No, System.DateTime.Now, 1, "jpg", 0, "", fileid + ".jpg", physical_path, "", "P13051", ent.id, "PDG1350", "001", "促銷照片", subEnt.id, // "Normal", "正常", 1, "PSIadmin_APP", date, date); // } // } //} QueriesTableAdapter tad = new QueriesTableAdapter(); String outMessage = ""; tad.SP_SALES_ACT_DATA_UPLOAD("FLNET", ent.id, out outMessage); if (!outMessage.Equals("OK")) { throw new Exception(outMessage); } }
public void SyncToPSI(marketSalesOtherEntity ent) { DataSynchronizationLib.DataSetPopTableAdapters.V_COMPETITOR_MACHINETableAdapter bandAd = new DataSynchronizationLib.DataSetPopTableAdapters.V_COMPETITOR_MACHINETableAdapter(); string brandName = "";// ent.BRAND_CODE;//brandRepostiory.IQueryable().First(p => p.BRAND_CODE.Equals(ent.BRAND_CODE)).BRAND_NAME; var list = bandAd.GetDataById(ent.BRAND_CODE); if (list != null && list.Count > 0) { brandName = list.First().BRAND; } else { brandName = ""; } string shopName = shopRep.IQueryable().First(p => p.SHOP_CODE.Equals(ent.shopCode) && p.ACTIVE_FLAG == 1).SHOP_NAME; int tvsize = int.Parse(ent.T_TVIZEID);//tvsizeRep.IQueryable().First(p => p.T_TVSIZEID.Equals(ent.T_TVIZEID)).TVSIZE.Value; DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_COMPETITOR_UPTableAdapter ad = new DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_COMPETITOR_UPTableAdapter(); ad.InsertQuery(ent.id, 1, ent.userid, ent.Created_Time.Value.ToString("yyyyMMddHHmmss"), ent.Modify_Time.Value.ToString("yyyyMMddHHmmss"), "PSIadmin_APP@" + ent.Created_Time.Value.ToString("yyyyMMddHHmmss") + "@APP", "PSIadmin_APP@" + ent.Modify_Time.Value.ToString("yyyyMMddHHmmss") + "@APP" , 1, "FLNET", ent.userid, ent.BRAND_CODE, brandName, ent.KEY_MODEL_CODE, ent.KEY_MODEL_CODE, (decimal)ent.SALES_PRICE.Value, ent.T_TVIZEID, tvsize, ent.IS_CURVED_FLAG.Value, ent.IS_OLED_FLAG.Value , ent.IS_QUANTUM_DOT_FLAG.Value, "", ent.id, 1, "PSIadmin_APP", ent.Created_Time.Value, ent.Modify_Time, ent.shopCode, shopName, ent.IS_SMART_TV_FLAG, ent.ACT_NO, ent.ACT_NAME); DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_FILE_UPLOADTableAdapter fileAd = new JS5_S12_SALES_FILE_UPLOADTableAdapter(); QueriesTableAdapter tad = new QueriesTableAdapter(); String outMessage = ""; if (ent.prdFileIds != null && !ent.prdFileIds.Equals("")) { string[] fileids = ent.prdFileIds.Split(",".ToCharArray()); string physical_path = System.DateTime.Now.ToString("yyyyMM"); foreach (string fileid in fileids) { //写入发票信息 fileAd.InsertQuery(System.Guid.NewGuid().ToString(), fileid + ".jpg", ent.userid, System.DateTime.Now, ent.userid, System.DateTime.Now, 1, "jpg", 0, "", fileid + ".jpg", physical_path, "", "P13055", ent.id, "PDG1351", "001", "竞品照片", ent.id, "Normal", "正常", 1, "PSIadmin_APP", ent.Created_Time.Value, ent.Created_Time); } } tad.SP_SALES_COMPETITOR_UPLOAD("FLNET", ent.id, out outMessage); if (!outMessage.Equals("OK")) { throw new Exception(outMessage); } }
//} private void SyncToPSI(marketSampleActEntity ent, bool isChange) { var res2 = from x in dbcontext.Set <marketSalesShopEntity>() where x.SHOP_CODE.Equals(ent.SHOP_CODE) select x; DateTime date = System.DateTime.Now; string CREATE_DATE = date.ToString("yyyyMMddHHmmss"); DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_FILE_UPLOADTableAdapter fileAd = new JS5_S12_SALES_FILE_UPLOADTableAdapter(); // if (!isChange) //{ JS5_S12_SALES_SAMPLE_UPTableAdapter sampleAd = new JS5_S12_SALES_SAMPLE_UPTableAdapter(); sampleAd.InsertQuery(ent.id, 1, ent.sales_No, CREATE_DATE, CREATE_DATE, "PSIadmin_APP@" + CREATE_DATE + "@APP", "PSIadmin_APP@" + CREATE_DATE + "@APP", 1, "FLNET" , ent.SAMPLE_UP_NO, res2.First().CUSTOMER_CODE, res2.First().CUSTOMER_NAME, ent.SHOP_CODE, ent.SHOP_NAME, ent.PRODUCT_TYPE_CODE, ent.PRODUCT_TYPE_NAME, ent.MACHINE_MODEL_NO, ent.SN_NO, ent.SAMPLE_DATE.Value, "无", ent.id, 1, "PSIadmin_APP", date, date, ent.UP_TYPE_CODE, ent.UP_TYPE_NAME, ent.SAMPLE_TYPE_CODE, ent.SAMPLE_TYPE_NAME, ent.SOURCE_SAMPLE_UP_NO, ent.PRODUCT_STATUS_CODE, ent.REMARK ); if (ent.file_ids != null && !ent.file_ids.Equals("")) { string[] fileids = ent.file_ids.Split(",".ToCharArray()); string physical_path = System.DateTime.Now.ToString("yyyyMM"); foreach (string fileid in fileids) { //写入发票信息 fileAd.InsertQuery(System.Guid.NewGuid().ToString(), fileid + ".jpg", ent.sales_No, System.DateTime.Now, ent.sales_No, System.DateTime.Now, 1, "jpg", 0, "", fileid + ".jpg", physical_path, "", "P13056", ent.id, "PDG1351", "001", "样品照片", ent.id, "Normal", "正常", 1, "PSIadmin_APP", date, date); } } QueriesTableAdapter tad = new QueriesTableAdapter(); String outMessage = ""; tad.SP_SALES_SAMPLE_UPLOAD("FLNET", ent.id, out outMessage); if (!outMessage.Equals("OK")) { throw new Exception(outMessage); } }
private void SyncToPSI_delete(marketSampleActEntity ent) { var res2 = from x in dbcontext.Set <marketSalesShopEntity>() where x.SHOP_CODE.Equals(ent.SHOP_CODE) select x; DateTime date = System.DateTime.Now; string CREATE_DATE = date.ToString("yyyyMMddHHmmss"); DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_FILE_UPLOADTableAdapter fileAd = new JS5_S12_SALES_FILE_UPLOADTableAdapter(); // if (!isChange) //{ JS5_S12_SALES_SAMPLE_UPTableAdapter sampleAd = new JS5_S12_SALES_SAMPLE_UPTableAdapter(); sampleAd.InsertQuery(ent.id, 1, ent.sales_No, CREATE_DATE, CREATE_DATE, "PSIadmin_APP@" + CREATE_DATE + "@APP", "PSIadmin_APP@" + CREATE_DATE + "@APP", 0, "FLNET" , ent.SAMPLE_UP_NO, res2.First().CUSTOMER_CODE, res2.First().CUSTOMER_NAME, ent.SHOP_CODE, ent.SHOP_NAME, ent.PRODUCT_TYPE_CODE, ent.PRODUCT_TYPE_NAME, ent.MACHINE_MODEL_NO, ent.SN_NO, ent.SAMPLE_DATE.Value, "无", ent.id, 1, "PSIadmin_APP", date, date, ent.UP_TYPE_CODE, ent.UP_TYPE_NAME, ent.SAMPLE_TYPE_CODE, ent.SAMPLE_TYPE_NAME, ent.SOURCE_SAMPLE_UP_NO, ent.PRODUCT_STATUS_CODE, ent.REMARK ); QueriesTableAdapter tad = new QueriesTableAdapter(); String outMessage = ""; tad.SP_SALES_SAMPLE_UPLOAD("FLNET", ent.id, out outMessage); if (!outMessage.Equals("OK")) { throw new Exception(outMessage); } }
public void uploadFile(TaskReportEntity ent, string UP_TYPE, string UP_TYPE_NAME) { JS5_S12_CRM_FILE_INFO_UPLOADTableAdapter ad = new JS5_S12_CRM_FILE_INFO_UPLOADTableAdapter(); string id = System.Guid.NewGuid().ToString(); IPsiSalesEmpOrgRepository orgRep = new PsiSalesEmpOrgRepository(); var orglist = orgRep.FindList("select a.* from psi_salesemporg a join aspnetusers b on a.EMPLOYEE_CODE=b.UserName where b.Id='" + ent.userId + "'"); string orgId = ""; if (orglist.Count() > 0) { orgId = orglist.First().ORG_ID; } else { ImarketSalesShopRepository shopRepository = new marketSalesShopRepository(); var shop = shopRepository.getShopByUserId(ent.userId); if (shop.Count > 0) { orgId = shop.First().ORG_ID; } } ad.Insert(id, 1, ent.userId, ent.reportTime.Value.ToString("yyyyMMddHHmmss"), System.DateTime.Now.ToString("yyyyMMddHHmmss"), "PSIadmin_APP@" + ent.reportTime.Value.ToString("yyyyMMddHHmmss") + "@APP", "PSIadmin_APP@" + System.DateTime.Now.ToString("yyyyMMddHHmmss") + "@APP", "FLNET", 1, ent.fileName, "099", "其他", "002", "工作報告", orgId, "002", "APP檔案管理", "无", ent.id, UP_TYPE, UP_TYPE_NAME, 1, "PSIadmin_APP", System.DateTime.Now, System.DateTime.Now ); DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_FILE_UPLOADTableAdapter fileAd = new JS5_S12_SALES_FILE_UPLOADTableAdapter(); string physical_path = ent.reportTime.Value.ToString("yyyyMM"); fileAd.InsertQuery(System.Guid.NewGuid().ToString(), ent.fileId + "." + ent.fileExt, "PSIadmin_APP@" + System.DateTime.Now.ToString("yyyyMMddHHmmss") + "@APP", System.DateTime.Now, "PSIadmin_APP@" + System.DateTime.Now.ToString("yyyyMMddHHmmss") + "@APP", System.DateTime.Now, 1, ent.fileExt, 0, "", ent.fileName, physical_path, "", "P13049", id, "CDG1294", "002", "工作報告", id, "Normal", "正常", 1, "PSIadmin_APP", System.DateTime.Now, System.DateTime.Now); SCMQueriesTableAdapter spAd = new SCMQueriesTableAdapter(); String outMessage = ""; spAd.SP_CRM_FILE_INFO_UPLOAD("FLNET", id, out outMessage); if (!outMessage.Equals("OK")) { throw new Exception(outMessage); } }
public void ReplyTask(string taskId, string userId, string title, string context, string fileId, string fileExt) { var ent = this.FindEntity(taskId); if (ent.RECEIVE_EMPLOYEE_CODE == null || ent.RECEIVE_EMPLOYEE_CODE.Equals("")) { return; } if (!ent.isReply.HasValue || ent.isReply.Value == 0) { ent.isReply = 1; ent.REPLY_SUBJECT = title; ent.REPLY_CONTENT = context; ent.REPLY_FileId = fileId; ent.REPLY_fileExt = fileExt; JS5_S12_CRM_MESSAGE_REPLY_UPTableAdapter ReplyAd = new JS5_S12_CRM_MESSAGE_REPLY_UPTableAdapter(); string id = System.Guid.NewGuid().ToString(); ReplyAd.Insert(id, 1, ent.RECEIVE_EMPLOYEE_CODE, System.DateTime.Now.ToString("yyyyMMddHHmmss"), System.DateTime.Now.ToString("yyyyMMddHHmmss"), "APP@" + System.DateTime.Now.ToString("yyyyMMddHHmmss") , "APP@" + System.DateTime.Now.ToString("yyyyMMddHHmmss"), "FLNET", 1, ent.MESSAGE_BILL_NO, (decimal)ent.MESSAGE_SUB_NO, title, context, ent.RECEIVE_EMPLOYEE_CODE, ent.RECEIVE_EMPLOYEE_NAME, ent.RECEIVE_MANAGE_ORG_ID, ent.RECEIVE_JOB_CODE, "001", "一般回复", "无", id, "Normal", "正常", 1, "PSIadmin_APP", System.DateTime.Now, System.DateTime.Now, 0, "", null, ""); DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_FILE_UPLOADTableAdapter fileAd = new JS5_S12_SALES_FILE_UPLOADTableAdapter(); if (fileId != null && !fileId.Equals("")) { string[] fileids = fileId.Split(",".ToCharArray()); string physical_path = System.DateTime.Now.ToString("yyyyMM"); foreach (string fileid in fileids) { //写入报告信息 fileAd.InsertQuery(System.Guid.NewGuid().ToString(), fileid + ".jpg", ent.RECEIVE_EMPLOYEE_CODE, System.DateTime.Now, ent.RECEIVE_EMPLOYEE_CODE, System.DateTime.Now, 1, fileExt, 0, "", fileid + "." + fileExt, physical_path, "", "P13047", id, "PDG1367", "001", "回复报告", id, "Normal", "正常", 1, "PSIadmin_APP", System.DateTime.Now, System.DateTime.Now); } } SCMQueriesTableAdapter spAd = new DataSynchronizationLib.SCMTableAdapters.SCMQueriesTableAdapter(); String outMessage = ""; spAd.SP_CRM_MESSAGE_REPLY_UP("FLNET", id, out outMessage); if (!outMessage.Equals("OK")) { throw new Exception(outMessage); } this.Update(ent); } }
public salesActualChangeRes Submit2(userKaoqinEntity itemsEntity) { //没有上班卡的情况不能刷下班卡 if (itemsEntity.kaoqin_Type.Equals("2")) { var testRes = this.FindList("SELECT * FROM user_kaoqin where userId='" + itemsEntity.userId + "' and kaoqin_Type='1' and checkTime>='" + DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00" + "' and checkTime <='" + DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59" + "'"); if (testRes.Count() <= 0) { return(new salesActualChangeRes() { errorCode = "0001", isOk = false, errorMessage = "打卡失败,未刷上班卡,不能刷下班卡!" }); } } itemsEntity.id = System.Guid.NewGuid().ToString(); this.Insert(itemsEntity); try { ImarketSalesRepository salesRepo = new marketSalesRepository(); //var res = from x in dbcontext.Set<userKaoqinEntity>() // join p in dbcontext.Set<aspnetusersEntity>() on new { id = x.userId } equals new { id = p.Id } // join c in dbcontext.Set<marketSalesEntity>() on new { phone = p.PhoneNumber } equals new { phone = c.sales_PhoneNumber } // where x.id.Equals(itemsEntity.id) && c.Active == 1 // select c; //if (res.Count() >= 1) //{ var sales = salesRepo.GetUserInfo(itemsEntity.userId); String ShopCode = ""; String SalesNo = ""; SalesNo = sales.SalesNo; string KQ_MODE_CODE = "NormalKQ"; if (sales.POP_TYPE_CODE.Equals("GuideMan")) { ImarketSalesShopRepository shopRepository = new marketSalesShopRepository(); var Shop = shopRepository.getShopByUserId(itemsEntity.userId); if (Shop.Count() <= 0) { itemsEntity.is_Sync = 0; this.Update(itemsEntity); return(new salesActualChangeRes() { errorCode = "0001", isOk = false, errorMessage = "打卡失败,门店关系错误,请联系管理员" }); } ShopCode = Shop.First().SHOP_CODE; //查找门店中的GPS位置 var res2 = from x in dbcontext.Set <marketSalesShopEntity>() where x.SHOP_CODE.Equals(ShopCode) && x.ACTIVE_FLAG == 1 select x; double shop_LATITUDE = res2.First().LATITUDE.Value; double shop_LONGITUDE = res2.First().LONGITUDE.Value; double distance = userKaoqinRepository.GetDistance(shop_LATITUDE, shop_LONGITUDE, itemsEntity.LATITUDE.Value, itemsEntity.LONGITUDE.Value); /** * if (!res.First().POP_TYPE_CODE.Equals("GuideMan")) * { * if ((itemsEntity.kaoqin_Type.Equals("1") || itemsEntity.kaoqin_Type.Equals("2"))) * { * this.Delete(itemsEntity); * return new salesActualChangeRes() { errorCode = "0001", isOk = false, errorMessage = "业务员账号无法使用考勤打卡功能" }; * } * } **/ if (itemsEntity.file_id == null || itemsEntity.file_id.Equals("")) { KQ_MODE_CODE = "SpecialKQ"; if (itemsEntity.kaoqin_Type.Equals("1") || itemsEntity.kaoqin_Type.Equals("2")) { if (distance > 1000) { this.Delete(itemsEntity); return(new salesActualChangeRes() { errorCode = "0001", isOk = false, errorMessage = "打卡失败,距离门店距离超出1000米" }); } } } itemsEntity.DISTINCE = distance; this.Update(itemsEntity); } DateTime nowTime = System.DateTime.Now; string CREATE_DATE = nowTime.ToString("yyyyMMddHHmmss"); string KaoQinType = ""; string ClockType = ""; if (itemsEntity.kaoqin_Type.Equals("1")) { KaoQinType = "002"; ClockType = "ClockIn"; } else if (itemsEntity.kaoqin_Type.Equals("2")) { KaoQinType = "002"; ClockType = "ClockOut"; } else if (itemsEntity.kaoqin_Type.Equals("3")) { KaoQinType = "001"; ClockType = "ClockIn"; } else if (itemsEntity.kaoqin_Type.Equals("4")) { KaoQinType = "001"; ClockType = "ClockOut"; } else if (itemsEntity.kaoqin_Type.Equals("5")) { KaoQinType = "001"; ClockType = "ClockIn"; } else if (itemsEntity.kaoqin_Type.Equals("6")) { KaoQinType = "001"; ClockType = "ClockOut"; } else if (itemsEntity.kaoqin_Type.Equals("7")) { KaoQinType = "004"; ClockType = "ClockIn"; } else if (itemsEntity.kaoqin_Type.Equals("8")) { KaoQinType = "004"; ClockType = "ClockOut"; } else if (itemsEntity.kaoqin_Type.Equals("9")) { KaoQinType = "003"; ClockType = "ClockIn"; } else if (itemsEntity.kaoqin_Type.Equals("10")) { KaoQinType = "003"; ClockType = "ClockOut"; } else if (itemsEntity.kaoqin_Type.Equals("11")) { KaoQinType = "005"; ClockType = "ClockIn"; } DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_KQ_DATA_UPLOADTableAdapter ad = new DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_KQ_DATA_UPLOADTableAdapter(); ad.InsertQuery(itemsEntity.id, 1, SalesNo, CREATE_DATE, CREATE_DATE, "PSIadmin_APP@" + CREATE_DATE + "@APP", "PSIadmin_APP@" + CREATE_DATE + "@APP", 1, "FLNET", ShopCode, SalesNo, KaoQinType, ClockType, itemsEntity.checkTime.Value, itemsEntity.LONGITUDE.ToDecimal(), itemsEntity.LATITUDE.ToDecimal(), itemsEntity.DISTINCE.ToDecimal(), "", itemsEntity.id, 1, "PSIadmin_APP", nowTime, nowTime, KQ_MODE_CODE, itemsEntity.adder); DataSynchronizationLib.DataSetPopTableAdapters.JS5_S12_SALES_FILE_UPLOADTableAdapter fileAd = new JS5_S12_SALES_FILE_UPLOADTableAdapter(); if (itemsEntity.file_id != null && !itemsEntity.file_id.Equals("")) { string[] fileids = itemsEntity.file_id.Split(",".ToCharArray()); string physical_path = System.DateTime.Now.ToString("yyyyMM"); foreach (string fileid in fileids) { fileAd.InsertQuery(System.Guid.NewGuid().ToString(), fileid + ".jpg", "PSIadmin_APP@" + CREATE_DATE + "@APP", System.DateTime.Now, "PSIadmin_APP@" + CREATE_DATE + "@APP", System.DateTime.Now, 1, "jpg", 0, "", fileid + ".jpg", physical_path, "", "P13014", itemsEntity.id, "PDG1354", "001", "打卡照片", itemsEntity.id, "Normal", "正常", 1, "PSIadmin_APP", nowTime, nowTime); } } QueriesTableAdapter tad = new QueriesTableAdapter(); String outMessage = ""; tad.SP_SALES_BATCH_KQ_UPLOAD_A("FLNET", itemsEntity.id, out outMessage); if (!outMessage.Equals("OK")) { throw new Exception(outMessage); } itemsEntity.is_Sync = 1; this.Update(itemsEntity); //} //else //{ // itemsEntity.is_Sync = 0; // this.Update(itemsEntity); //this.Delete(itemsEntity); //return new salesActualChangeRes() { errorCode = "0001", isOk = false, errorMessage = "打卡失败,门店关系错误,请联系管理员" }; //} } catch (Exception ex) { this.Delete(itemsEntity); return(new salesActualChangeRes() { errorCode = "0001", isOk = false, errorMessage = ex.Message }); } return(new salesActualChangeRes() { errorCode = "0001", isOk = true, errorMessage = "刷卡成功" }); }