public static string SendGoods(string guids, string logisNo, string logisName, string logisCost, string logisMobile) { BasicSecurity basic = new BasicSecurity(); string msg = string.Empty; //if (string.IsNullOrEmpty(guid) || string.IsNullOrEmpty(logisNo) || string.IsNullOrEmpty(logisName) || string.IsNullOrEmpty(logisCost)) return ""; if (string.IsNullOrEmpty(guids) || basic.UserName == "") return "登陆超时"; guids = guids.TrimEnd(','); Guid groupid = Guid.NewGuid(); List<T_ERP_BatchOrder> bch = new List<T_ERP_BatchOrder>(); T_ERP_BatchOrder bo = null; string[] newlist = guids.Split(','); foreach (string str in newlist) { bo = new T_ERP_BatchOrder(); bo.Creator = bo.Updator = basic.UserName; bo.IsDel = bo.Reserved3 = true; bo.Reserved2 = bo.Remark = ""; bo.Reserved1 = 0; bo.Guid = Guid.Parse(str); bo.GroupId = groupid; bch.Add(bo); } SerNoCaller.Calr_BatchOrder.Add(bch); Ultra.Logic.ResultData rd = SerNoCaller.Calr_SuppBatch.ExecSql("exec P_ERP_SendGoods @0,@1,@2,@3,@4,@5,@6", guids, groupid, logisNo, logisName, logisCost, logisMobile, basic.UserName); if (rd.QueryCount > 0) { msg = "发货成功"; } else { msg = rd.ErrMsg; } return msg; }
public static string UpdateLogis(string guid, string logisNo, string logisName, string logisCost, string logisMobile) { BasicSecurity basic = new BasicSecurity(); string msg = string.Empty; if (string.IsNullOrEmpty(guid) || string.IsNullOrEmpty(logisNo) || string.IsNullOrEmpty(logisName) || string.IsNullOrEmpty(logisCost)) return "操作失败,请刷新页面重新操作!"; if (basic.UserName == "") return "登陆超时"; Ultra.Logic.ResultData rd = SerNoCaller.Calr_SuppBatch.ExecSql("Update T_ERP_SuppBatch Set LogisNo = @0, LogisName =@1,LogisCost =@2,LogisMobile=@3 Where Guid = @4", logisNo, logisName, logisCost, logisMobile, guid); if (rd.QueryCount > 0) { msg = "修改成功"; } else { msg = rd.ErrMsg; } return msg; }
public override void OnAuthorization(HttpActionContext actionContext) { if (actionContext.Request.Headers.Authorization == null) { actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized, "Please enter username & password"); } else { string authenticationToken = actionContext.Request.Headers.Authorization.Parameter; string decodeAuthenticationToken = Encoding.UTF8.GetString(Convert.FromBase64String(authenticationToken)); string[] usernamepasswordarray = decodeAuthenticationToken.Split(':'); string username = usernamepasswordarray[0]; string password = usernamepasswordarray[1]; if (!BasicSecurity.Validateuser(username, password)) { //Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(username), null); actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized, "You are not authorized to use this services."); } } }