/// <summary> /// 基础管理(货位信息-编辑货位) /// </summary> /// <param name="entity"></param> /// <param name="isNew"></param> /// <returns></returns> public bool UpdateLocationInfoC02(LocationEntity entity, bool isNew) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); #region 0-10 loStr.Append("lcCode=").Append(entity.LocationCode).Append("&"); loStr.Append("lcName=").Append(entity.LocationName).Append("&"); loStr.Append("znCode=").Append(entity.ZoneCode).Append("&"); loStr.Append("passageCode=").Append(entity.PassageCode).Append("&"); loStr.Append("floorCode=").Append(entity.FloorCode).Append("&"); loStr.Append("shelfCode=").Append(entity.ShelfCode).Append("&"); loStr.Append("cellCode=").Append(entity.CellCode).Append("&"); loStr.Append("sortOrder=").Append(entity.SortOrder).Append("&"); loStr.Append("whCode=").Append(entity.WarehouseCode).Append("&"); loStr.Append("isActive=").Append(entity.IsActive).Append("&"); #endregion #region 11-14 loStr.Append("lowerSize=").Append(entity.LowerSize).Append("&"); loStr.Append("upperSize=").Append(entity.UpperSize).Append("&"); loStr.Append("ugCode=").Append(entity.GrpCode).Append("&"); loStr.Append("chCode=").Append(entity.Ch_Code).Append("&"); loStr.Append("chName=").Append(entity.Ch_Name).Append("&"); loStr.Append("umCode=").Append(entity.UnitCode); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_UpdateLocationInfoC02); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 存储排序记录 /// </summary> /// <param name="header"></param> /// <returns></returns> public bool CreateLoadingInfo(LoadingHeaderEntity header) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("warehouseCode=").Append(header.WarehouseCode).Append("&"); loStr.Append("loadingNO=").Append(header.LoadingNO).Append("&"); loStr.Append("vehicleID=").Append(header.VehicleID).Append("&"); loStr.Append("updateDate=").Append(header.UpdateDate).Append("&"); loStr.Append("userName="******"&"); #region list 转 json List <string> prop = new List <string>() { "LoadingNO", "BillNO", "InVehicleSort", "UpdateDate", "BillID" }; string soHeaderEntity = GetRes <LoadingDetailEntity>(header.Details, prop); loStr.Append("jsonDetail=").Append(soHeaderEntity).Append("&"); List <string> user = new List <string>() { "LoadingNO", "UserName", "UserCode", "UpdateDate", "TaskType" }; string loadingUserEntity = GetRes <LoadingUserEntity>(header.Users, user); loStr.Append("jsonUser=").Append(loadingUserEntity); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_CreateLoadingInfo); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 基础管理(包装关系-编辑包装关系) /// </summary> /// <param name="UmCode"></param> /// <param name="Qty"></param> /// <param name="SkuCode"></param> /// <param name="Barcode"></param> /// <param name="Weight"></param> /// <param name="Length"></param> /// <param name="Width"></param> /// <param name="Height"></param> /// <param name="IsActive"></param> /// <param name="ID"></param> /// <param name="isCreateNew"></param> /// <returns></returns> public bool SaveUpdateUmSku(string UmCode, int Qty, string SkuCode, string Barcode, decimal Weight, decimal Length, decimal Width, decimal Height, string IsActive, int ID, bool isCreateNew) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); #region loStr.Append("umCode=").Append(UmCode).Append("&"); loStr.Append("qty=").Append(Qty).Append("&"); loStr.Append("skuCode=").Append(SkuCode).Append("&"); loStr.Append("weight=").Append(Weight).Append("&"); loStr.Append("length=").Append(Length).Append("&"); loStr.Append("width=").Append(Width).Append("&"); loStr.Append("height=").Append(Height).Append("&"); int sUnit = 0; //销售单位与库存单位,转换倍数大于1时为销售单位,否则为库存单位 if (Qty > 1) { sUnit = 1; } loStr.Append("sUnit=").Append(sUnit).Append("&"); loStr.Append("id=").Append(ID).Append("&"); loStr.Append("isActive=").Append(IsActive); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveUpdateUmSku); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 打印销售发货单-生成车次信息 /// </summary> /// <param name="whCode"></param> /// <param name="creator"></param> /// <param name="vhNo"></param> /// <param name="vehicleName"></param> /// <param name="userPhone"></param> /// <param name="list"></param> /// <param name="listUsers"></param> /// <param name="warehouseType"></param> /// <param name="loadingNo"></param> /// <returns></returns> public bool CreateTrain(string whCode, string creator, string vhNo, string vehicleName, string userPhone, List<SOHeaderEntity> list, List<UserEntity> listUsers, EWarehouseType warehouseType, string loadingNo) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("whCode=").Append(whCode).Append("&"); loStr.Append("creator=").Append(creator).Append("&"); loStr.Append("vehicleNo=").Append(vhNo).Append("&"); loStr.Append("vehicleName=").Append(vehicleName).Append("&"); loStr.Append("vehiclePhone=").Append(userPhone).Append("&"); loStr.Append("loadingNo=").Append(loadingNo).Append("&"); loStr.Append("warehouseType=").Append(EUtilStroreType.WarehouseTypeToInt(warehouseType)).Append("&"); #region list 转 json List<string> prop = new List<string>() { "BillNO", "OriginalBillNo", "BillID", "BillType" }; string soHeaderEntity = GetRes<SOHeaderEntity>(list, prop); loStr.Append("soHeaderEntity=").Append(soHeaderEntity).Append("&"); List<string> prop1 = new List<string>() { "UserName", "UserCode", "ROLE_ID" }; string userStr = GetRes<UserEntity>(listUsers, prop1); loStr.Append("listUsers=").Append(userStr); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_CreateTrain); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return false; } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject<Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return false; } if (bill.flag != 0) { MsgBox.Warn(bill.error); return false; } #endregion return true; } catch (Exception ex) { MsgBox.Err(ex.Message); } return false; }
/// <summary> /// 到货登记,绑定送货牌与入库单 /// </summary> /// <param name="billNO"></param> /// <param name="cardNO"></param> /// <param name="driver"></param> /// <param name="contact"></param> /// <param name="vehicleNO"></param> /// <param name="creator"></param> /// <param name="userQd"></param> /// <param name="userCheck"></param> /// <param name="userPutaway"></param> /// <param name="descriptinQd"></param> /// <param name="descriptionCheck"></param> /// <param name="descriptionPutaway"></param> /// <returns></returns> private bool CreateVechile(int billNO, string cardNO, string driver, string contact, string vehicleNO, string creator, string userQd, string userCheck, string userPutaway, string descriptinQd, string descriptionCheck, string descriptionPutaway) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(billNO).Append("&"); loStr.Append("cardNo=").Append(cardNO).Append("&"); loStr.Append("driver=").Append(driver).Append("&"); loStr.Append("contact=").Append(contact).Append("&"); loStr.Append("vehicleNo=").Append(vehicleNO).Append("&"); loStr.Append("creator=").Append(creator).Append("&"); loStr.Append("userQD=").Append(userQd).Append("&"); loStr.Append("userCheck=").Append(userCheck).Append("&"); loStr.Append("userPutaway=").Append(userPutaway).Append("&"); loStr.Append("descriptionQD=").Append(descriptinQd).Append("&"); loStr.Append("descriptionCheck=").Append(descriptionCheck).Append("&"); loStr.Append("descriptionPutaway=").Append(descriptionPutaway); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_CreateVechile); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 回款确认-更新发货单的回款确认标记 /// </summary> /// <param name="lstHeader"></param> /// <param name="loginName"></param> /// <returns></returns> public bool UpdateConfirmFlag(List <SOHeaderEntity> lstHeader, string loginName) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("loginName=").Append(loginName).Append("&"); #region list 转 json List <string> prop = new List <string>() { "ReceiveAmount", "RealAmount", "CrnAmount", "OtherAmount", "BillID", "PaymentBy" }; string soHeaderEntity = GetRes <SOHeaderEntity>(lstHeader, prop); #endregion loStr.Append("lstHeader=").Append(soHeaderEntity); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_UpdateConfirmFlag); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
private void ObterToken(Entity tokenConfigRecord) { var client = new HttpClient(); //get all attibutes required to get token string tokenEndPoint = (string)tokenConfigRecord[token_endpoint_attribute]; string clientId = (string)tokenConfigRecord[clientid_attribute]; string clientSecret = (string)tokenConfigRecord[client_secret_attribute]; string resource = (string)tokenConfigRecord[resource_attribute]; client.BaseAddress = new Uri(tokenEndPoint); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/x-www-form-urlencoded")); var content = new FormUrlEncodedContent(new[] { new KeyValuePair <string, string>("resource", resource), new KeyValuePair <string, string>("client_id", clientId), new KeyValuePair <string, string>("client_secret", clientSecret), new KeyValuePair <string, string>("client_info", "1"), new KeyValuePair <string, string>("grant_type", "client_credentials") }); var result = client.PostAsync("", content).GetAwaiter().GetResult(); string resultContent = result.Content.ReadAsStringAsync().GetAwaiter().GetResult(); if (!string.IsNullOrEmpty(resultContent) && resultContent.Contains("access_token")) { var tokenParse = new TokenParse(resultContent); Token.Set(ExecutionContext, tokenParse.access_token); var dataExpiracao = DateTime.Now.AddSeconds(tokenParse.expires_in); ExpiresIn.Set(ExecutionContext, dataExpiracao); Sucess.Set(ExecutionContext, true); Message.Set(ExecutionContext, "Sucess"); //grava token na entidade para cache var tokenUpdt = new Entity() { LogicalName = tokenConfigRecord.LogicalName, Id = tokenConfigRecord.Id }; tokenUpdt[data_expiracao] = dataExpiracao; tokenUpdt[valor_token] = tokenParse.access_token; Service.Update(tokenUpdt); } else { if (!string.IsNullOrEmpty(resultContent) && resultContent.Contains("error_description")) { var tokenParse = new TokenParse(resultContent); Message.Set(ExecutionContext, tokenParse.error_description); } else { Message.Set(ExecutionContext, "Requisição não retornou um token válido."); } } }
/// <summary> /// 基础管理(车辆信息-更改) /// </summary> /// <param name="entity"></param> /// <param name="isNew"></param> /// <returns></returns> public bool UpdateSave(VehicleEntity entity, bool isNew) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("vhCode=").Append(entity.VehicleCode).Append("&"); loStr.Append("vhNo=").Append(entity.VehicleNO).Append("&"); loStr.Append("vhVolume=").Append(entity.VehicleVolume).Append("&"); loStr.Append("userCode=").Append(entity.UserCode).Append("&"); loStr.Append("rtCode=").Append(entity.RouteCode).Append("&"); loStr.Append("vhType=").Append(entity.VhType).Append("&"); loStr.Append("vhAttri=").Append(entity.VhAttri).Append("&"); if (isNew) { loStr.Append("isActive=").Append("Y"); } else { loStr.Append("isActive=").Append(entity.IsActive); } string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_UpdateSave); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
protected override void SendMessage(NativeActivityContext context) { var number = base.From.Get(context); var number2 = base.To.Get(context); var text = base.Body.Get(context); PhoneNumber from = number; var body = text; var messageResource = MessageResource.Create(number2, null, from, null, body); Sid.Set(context, messageResource.Sid); Sucess.Set(context, value: true); }
/// <summary> /// 盘点任务分派--保存任务分派 /// </summary> /// <param name="userName"></param> /// <param name="billID"></param> /// <param name="userCode"></param> /// <param name="locations"></param> /// <returns></returns> public bool SaveCountTask(string userName, int billID, string userCode, List <CountDetailEntity> locations) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("userName="******"&"); loStr.Append("billId=").Append(billID).Append("&"); loStr.Append("counts=").Append(locations.Count).Append("&"); loStr.Append("userCode=").Append(userCode).Append("&"); loStr.Append("wareHouseType=").Append(EUtilStroreType.WarehouseTypeToInt(GlobeSettings.LoginedUser.WarehouseType)).Append("&"); List <string> prop = new List <string>() { "ID" }; string jsonDetail = GetResList <CountDetailEntity>("jsonDetail", locations, prop); loStr.Append("jsonDetail=").Append(jsonDetail); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveCountTask); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 新建或者修改公司信息 /// </summary> /// <param name="Company"></param> /// <returns></returns> public bool CreateOrUpdateCompany(CompanyEntity Company, bool isCreateNew) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); #region loStr.Append("id=").Append(Company.CompanyCode).Append("&"); loStr.Append("name=").Append(Company.CompanyName).Append("&"); loStr.Append("address=").Append(Company.Address).Append("&"); loStr.Append("phone=").Append(Company.Phone).Append("&"); loStr.Append("fax=").Append(Company.Fax).Append("&"); loStr.Append("email=").Append(Company.Email).Append("&"); loStr.Append("postCode=").Append(Company.Postcode).Append("&"); loStr.Append("remark=").Append(Company.Remark).Append("&"); loStr.Append("isCreateNew=").Append(isCreateNew); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_CreateOrUpdateCompany); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 收货单据管理,收货完成 /// </summary> /// <param name="focusedHeaders"></param> /// <param name="userName"></param> /// <param name="authUserCode"></param> /// <returns></returns> public bool ReceivedComplete(List <AsnBodyEntity> focusedHeaders, string userName, string authUserCode) { try { #region 组装发送数据 string jsons = string.Empty; jsons += "userName="******"&billIds="; foreach (AsnBodyEntity header in focusedHeaders) { jsons += header.BillID; jsons += ","; } jsons = jsons.Substring(0, jsons.Length - 1); #endregion #region 请求数据 string jsonQuery = WebWork.SendRequest(jsons, WebWork.URL_ReceivedComplete); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Warn(ex.Message); } return(false); }
public override int GetHashCode() { int hash = 1; if (Sucess != false) { hash ^= Sucess.GetHashCode(); } if (Message.Length != 0) { hash ^= Message.GetHashCode(); } return(hash); }
/// <summary> /// 创建盘点单---保存盘点单 /// </summary> /// <param name="remark"></param> /// <param name="userName"></param> /// <param name="warehouse"></param> /// <param name="locations"></param> /// <param name="tagCode"></param> /// <returns></returns> public bool SaveCountBill(string remark, string userName, string warehouse, List <LocationEntity> locations, string tagCode) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("remark=").Append(remark).Append("&"); loStr.Append("userName="******"&"); loStr.Append("warehouse=").Append(warehouse).Append("&"); loStr.Append("tagCode=").Append(tagCode).Append("&"); List <string> prop = new List <string>() { "LocationCode" }; string jsonStr = GetResList <LocationEntity>("jsonStr", locations, prop); loStr.Append("jsonStr=").Append(jsonStr); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveCountBill); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 添加或编辑物料 /// </summary> /// <param name="entity"></param> /// <param name="isNew">添加或编辑</param> /// <returns>1:成功;-1:物料编号已存在;-2:已关联其它供应商,无法置为空;-3:该关联已存在</returns> public bool UpdateSkuInfo(MaterialEntity entity, bool isNew) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); #region loStr.Append("securityQty=").Append(entity.SecurityQty).Append("&"); loStr.Append("tempCode=").Append(entity.TemperatureCode).Append("&"); loStr.Append("minStockQty=").Append(entity.MinStockQty).Append("&"); loStr.Append("maxStockQty=").Append(entity.MaxStockQty).Append("&"); loStr.Append("updateTy=").Append(entity.LastUpdateBy).Append("&"); loStr.Append("updateDate=").Append(entity.LastUpdateDate).Append("&"); loStr.Append("skuType=").Append(entity.SkuType).Append("&"); loStr.Append("skuCode=").Append(entity.MaterialCode); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_UpdateSkuInfo); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
protected override void SendMessage(NativeActivityContext context) { var number = base.From.Get(context); var number2 = base.To.Get(context); var text = base.Body.Get(context); var list = new List <Uri>(new Uri[] { new Uri(MediaUrl.Get(context)) }); var from = number; var body = text; var mediaUrl = list; MessageResource messageResource = MessageResource.Create(number2, null, from, null, body, mediaUrl); Sid.Set(context, messageResource.Sid); Sucess.Set(context, value: true); }
/// <summary> /// //存入数据库,排除已经关联的 /// </summary> /// <param name="brandCode"></param> /// <param name="suppliers"></param> /// <returns></returns> public bool CreateRelationWithSupplier(string brandCode, List <SupplierEntity> suppliers) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("brdCode=").Append(brandCode).Append("&"); string jsons = string.Empty; foreach (SupplierEntity tem in suppliers) { jsons += tem.SupplierCode; jsons += ","; } jsons = jsons.Substring(0, jsons.Length - 1); loStr.Append("sCodes=").Append(jsons); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_CreateRelationWithSupplier); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 保存或更新通道表 /// </summary> /// <param name="channel"></param> /// <param name="isNew"></param> /// <returns></returns> public bool SaveAddChannel(ChannelEntity channel, bool isNew, int isEdit, int bak_Code) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); #region loStr.Append("chCode=").Append(channel.Ch_Code).Append("&"); loStr.Append("bakChCode=").Append(channel.Bak_Ch_Code).Append("&"); loStr.Append("chName=").Append(channel.Ch_Name).Append("&"); loStr.Append("isActive=").Append(channel.Is_Active).Append("&"); loStr.Append("remark=").Append(channel.Remark).Append("&"); loStr.Append("creator=").Append(channel.Creator); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveAddChannel); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 添加日志 /// </summary> /// <param name="type">日志类型</param> /// <param name="creator">当前操作人</param> /// <param name="billNo">订单编号</param> /// <param name="description">操作描述</param> /// <param name="module">模块</param> /// <param name="createTime">创建时间</param> /// <param name="remark">备注信息</param> /// <returns></returns> public bool Insert(ELogType type, string creator, string billNo, string description, string module, DateTime createTime, string remark) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("type=").Append(type).Append("&"); loStr.Append("creator=").Append(creator).Append("&"); loStr.Append("billNo=").Append(billNo).Append("&"); loStr.Append("description=").Append(description).Append("&"); loStr.Append("module=").Append(module).Append("&"); loStr.Append("remark=").Append(remark); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_Insert); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 通过商品编码审计 /// </summary> /// <param name="skuCode"></param> /// <param name="shortQty"></param> /// <param name="gID"></param> /// <param name="isCase"></param> /// <returns></returns> public bool InquiryBySku(string skuCode, decimal shortQty, string gID, int isCase) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("skuCode=").Append(skuCode).Append("&"); loStr.Append("shortQty=").Append(shortQty).Append("&"); if (GlobeSettings.LoginedUser.WarehouseType == EWarehouseType.混合仓) { loStr.Append("isCase=").Append(isCase).Append("&"); } loStr.Append("gId=").Append(gID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_InquiryBySku); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
public bool CheckQtyPutQty(int billId) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billId=").Append(billId); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_CheckQtyPutQty); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { if (MsgBox.AskOK(bill.error) != DialogResult.OK) { return(false); } else { return(true); } } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
protected override void Execute(NativeActivityContext context) { try { Init(context); var text = From.Get(context); var text2 = To.Get(context); var dateSentBefore = DateSentBefore.Get(context); var dateSent = DateSent.Get(context); var dateSentAfter = DateSentAfter.Get(context); var num = Limit.Get(context); ReadMessageOptions readMessageOptions = new ReadMessageOptions(); if (!string.IsNullOrWhiteSpace(text)) { readMessageOptions.From = text; } if (!string.IsNullOrWhiteSpace(text2)) { readMessageOptions.To = text2; } readMessageOptions.DateSentBefore = dateSentBefore; readMessageOptions.DateSent = dateSent; readMessageOptions.DateSentAfter = dateSentAfter; readMessageOptions.Limit = ((num < 1) ? 1 : num); ResourceSet <MessageResource> resourceSet = MessageResource.Read(readMessageOptions); var dataTable = CriarDataTable(); foreach (MessageResource item in resourceSet) { dataTable.Rows.Add(item.DateCreated, item.DateUpdated, item.DateSent, item.Direction.ToString(), item.ErrorCode, item.ErrorMessage, item.From, item.Sid, item.Status.ToString(), item.To, item.Body); } Sucess.Set(context, value: true); Result.Set(context, dataTable); } catch (Exception ex) { Sucess.Set(context, value: false); ErrorMessage.Set(context, ex.Message); } }
/// <summary> /// 改变用户的任务优先级 /// </summary> /// <param name="taskList">任务列表</param> /// <returns></returns> public bool ChangeUserTaskLevel(List <TaskEntity> taskList) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); List <string> prop = new List <string>() { "UserAttri", "UserCode", "RoleID", "RoleEnabled" }; string jsonStr = GetResList <TaskEntity>("jsonStr", taskList, prop); jsonStr = "{" + jsonStr + "}"; loStr.Append("jsonStr=").Append(jsonStr); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_ChangeUserTaskLevel); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 存储排序记录 /// </summary> /// <param name="list"></param> public bool Insert(List <OrderSortEntity> list) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); List <string> prop = new List <string>() { "BillNo", "Attri1", "VehicleNo", "InVehicleSort", "PiecesQty" }; string pickPlanEntity = GetResList <OrderSortEntity>("jsonStr", list, prop); string jsons = "{" + pickPlanEntity + "," + pickPlanEntity + "}"; loStr.Append("jsonStr=").Append(jsons); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_InsertSortBill); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
protected override void Execute(NativeActivityContext context) { try { Init(context); var flag = MessageResource.Delete(Sid.Get(context)); Sucess.Set(context, flag); ErrorMessage.Set(context, flag ? "" : "Erro ao excluir mensagem."); } catch (Exception ex) { Sucess.Set(context, value: false); ErrorMessage.Set(context, ex.Message); } }
/// <summary> /// 批量新增容器/修改容器信息 /// </summary> public bool SaveAddContainerInfo(ContainerEntity Container, bool isNew, int ctNum) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("ctCode=").Append(Container.ContainerCode).Append("&"); loStr.Append("ctName=").Append(Container.ContainerName).Append("&"); loStr.Append("ctType=").Append(Container.ContainerType).Append("&"); loStr.Append("ctWeight=").Append(Container.ContainerWeight).Append("&"); loStr.Append("ctNum=").Append(ctNum).Append("&"); loStr.Append("whCode=").Append(Container.WarehouseCode); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveAddContainerInfo); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 基础管理(本库物料-更新本库物料) /// </summary> /// <param name="entity"></param> /// <param name="isCreateNew"></param> /// <returns></returns> public bool SaveUpdateSkuWarehouse(SkuWarehouseEntity entity, bool isCreateNew) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); #region loStr.Append("minStockQty=").Append(entity.MinStockQty).Append("&"); loStr.Append("maxStockQty=").Append(entity.MaxStockQty).Append("&"); loStr.Append("securityQty=").Append(entity.SecurityQty).Append("&"); loStr.Append("id=").Append(entity.SkuWarehouseID); #endregion string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveUpdateSkuWarehouse); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 基础管理(货区信息-更改货区信息) /// </summary> /// <param name="entity"></param> /// <param name="isNew"></param> /// <returns></returns> public bool SaveUpdateZone(ZoneEntity entity, bool isNew) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("znCode=").Append(entity.ZoneCode).Append("&"); loStr.Append("znName=").Append(entity.ZoneName).Append("&"); loStr.Append("ztCode=").Append(entity.ZoneTypeCode).Append("&"); loStr.Append("whCode=").Append(entity.WarehouseCode).Append("&"); loStr.Append("tempCode=").Append(entity.TemperatureCode).Append("&"); loStr.Append("isActive=").Append(entity.IsActive); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveUpdateZone); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 存储排序记录 /// </summary> /// <param name="billIDs"></param> /// <param name="userName"></param> /// <param name="errBillNO"></param> /// <returns></returns> public bool SaveSortOrders(string billIDs, string userName, out string errBillNO) { errBillNO = ""; try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("billIds=").Append(billIDs).Append("&"); loStr.Append("userName="******"&"); loStr.Append("warehouseType=").Append(EUtilStroreType.WarehouseTypeToInt(GlobeSettings.LoginedUser.WarehouseType)).Append("&"); loStr.Append("uuid=").Append(Guid.NewGuid().ToString().Replace("-", "")); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_SaveSortOrders); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }
/// <summary> /// 生成叫号信息 /// </summary> /// <param name="callType"></param> /// <param name="billNO"></param> /// <param name="description"></param> /// <param name="userCode"></param> /// <param name="taskID"></param> /// <returns></returns> public bool CreateCalling(string callType, string billNO, string description, string userCode, int taskID) { try { #region 请求数据 System.Text.StringBuilder loStr = new System.Text.StringBuilder(); loStr.Append("callType=").Append(callType).Append("&"); loStr.Append("billNo=").Append(billNO).Append("&"); loStr.Append("description=").Append(description).Append("&"); loStr.Append("userCode=").Append(userCode).Append("&"); loStr.Append("taskId=").Append(taskID); string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_CreateCalling); if (string.IsNullOrEmpty(jsonQuery)) { MsgBox.Warn(WebWork.RESULT_NULL); //LogHelper.InfoLog(WebWork.RESULT_NULL); return(false); } #endregion #region 正常错误处理 Sucess bill = JsonConvert.DeserializeObject <Sucess>(jsonQuery); if (bill == null) { MsgBox.Warn(WebWork.JSON_DATA_NULL); return(false); } if (bill.flag != 0) { MsgBox.Warn(bill.error); return(false); } #endregion return(true); } catch (Exception ex) { MsgBox.Err(ex.Message); } return(false); }