Exemplo n.º 1
0
 private ReqeFunStruct opUserParam()
 {
     ReqeFunStruct newUserO = new ReqeFunStruct();
     newUserO.SubSysName = SubSysName.CommonBaseFuncCall;
     newUserO.FunName = ComFunCallEnum.Submit_AddOrEdit;
     Submit_AddOrEdit addUser0 = new Submit_AddOrEdit();
     addUser0.TableName = "[sys_user]";
     Dictionary<string, string> DicParam = new Dictionary<string, string>();
     DicParam.Add("user_name", "123");
     DicParam.Add("password", "456");
     DicParam.Add("create_by", GlobalStaticObj.UserID);
     DicParam.Add("create_time", DateTime.UtcNow.Ticks.ToString());
     DicParam.Add("user_id", System.Guid.NewGuid().ToString());
     addUser0.DicParam = DicParam;
     newUserO.FunObject = addUser0;
     return newUserO;
 }
Exemplo n.º 2
0
 /// <summary> 新增或更新
 /// </summary>
 /// <param name="opName">操作名</param>
 /// <param name="accCode">帐套代码</param>
 /// <param name="tableName">表名</param>
 /// <param name="keyName">主键名称</param>
 /// <param name="keyValue">主键值,如果有值,表示更新记录</param>
 /// <param name="dicFileds">字段集合</param>
 /// <returns>返回执行是否成功</returns>
 public static bool Submit_AddOrEdit(string opName, string accCode, string tableName, string keyName, string keyValue, Dictionary<string, string> dicFileds)
 {
     ReqeFunStruct reqeFunStruct = new ReqeFunStruct();
     reqeFunStruct.SubSysName = SubSysName.CommonBaseFuncCall;
     reqeFunStruct.FunName = ComFunCallEnum.Submit_AddOrEdit;
     reqeFunStruct.AccCode = accCode;
     Submit_AddOrEdit submit_AddOrEdit = new Submit_AddOrEdit();
     submit_AddOrEdit.TableName = string.Format("{0}", tableName);
     submit_AddOrEdit.DicParam = dicFileds;
     submit_AddOrEdit.pkName = keyName;//默认第一个
     submit_AddOrEdit.pkVal = keyValue;
     reqeFunStruct.FunObject = submit_AddOrEdit;
     UserIDOP userOp = new UserIDOP() { UserID = GlobalStaticObj.UserID, OPName = opName };
     reqeFunStruct.userIDOP = userOp;
     reqeFunStruct.PCClientCookieStr = GlobalStaticObj.CookieStr;
     var addStr = HXCCommon.DotNetEncrypt.DESEncrypt.Encrypt(Newtonsoft.Json.JsonConvert.SerializeObject(reqeFunStruct));
     var respO = JsonOperate(addStr);
     if (respO.IsSuccess == "0")
     {
         return false;
     }
     return bool.Parse(respO.ReturnObject);
 }