| | |
| | | /// <returns></returns> |
| | | [Route("Open_PrintTem/SaveOpenTmp")] |
| | | [HttpGet] |
| | | public object SaveOpenTmp(string HNumber, string HName) |
| | | public object SaveOpenTmp(string HNumber, string HName,string user) |
| | | { |
| | | ClsCNSRM oCn = new ClsCNSRM(); |
| | | //ClsCNSRM oCn = new ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("OpenPrintTmp_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无保存权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("Insert into SRM_OpenTmp " + |
| | |
| | | /// <returns></returns> |
| | | [Route("Open_PrintTem/DelOpenTmp")] |
| | | [HttpGet] |
| | | public object DelOpenTmp(string HItemID) |
| | | public object DelOpenTmp(string HItemID, string user) |
| | | { |
| | | ClsCNSRM oCn = new ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("OpenPrintTmp_Delete", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无删除权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("Delete from SRM_OpenTmp where HItemID='" + DBUtility.ClsPub.isLong(HItemID) + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.Commit(); |
| | |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region [设置默认打印模板] |
| | | /// <summary> |
| | | /// 设置默认印模板 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Open_PrintTem/DefaultOpenTmp")] |
| | | [HttpGet] |
| | | public object DefaultOpenTmp(string HNumber,string HName) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | //先把此模块下的模板默认模板标记都关闭 |
| | | oCn.RunProc("update SRM_OpenTmp set HStdFlag = 0 where HNumber='" + HNumber + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //更新当前模板为默认模板 |
| | | oCn.RunProc("update SRM_OpenTmp set HStdFlag = 1 where HNumber='" + HNumber + "' and HName='"+ HName + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.Commit(); |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "设置成功!"; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "设置失败" + e.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region [获取默认打印模板] |
| | | /// <summary> |
| | | /// 获取打印模板列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Open_PrintTem/GetDefaultOpenTmp_Json")] |
| | | [HttpGet] |
| | | public object GetDefaultOpenTmp_Json(string HNumber) |
| | | { |
| | | sWhere = " Where 默认标记=1 "; |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | if (HNumber != "") |
| | | { |
| | | sWhere = sWhere + " and ( HNumber = '" + HNumber + "') "; |
| | | } |
| | | try |
| | | { |
| | | ds = webserver.GetOpenTmpList(sWhere, ref DBUtility.ClsPub.sErrInfo); |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败,没有设置默认模板" + DBUtility.ClsPub.sErrInfo; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "获取成功!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "异常" + ex.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |