Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="clientName"></param>
        /// <returns></returns>
        public RASCLIENTS SaveRaseClient(string clientName, string adress, string tell, string createBy, string deptName, string staxCode, string dept)
        {
            var client = _RasClientsDal.GetRaseClientsByName(clientName);

            if (client == null)
            {
                client.RASCLIENTID     = _RasClientsDal.GetMaxClientCode();
                client                 = new RASCLIENTS();
                client.ORIGSTS         = "N";
                client.CATEGORY        = "非协议客户";
                client.COMPNAME        = clientName;
                client.SHORTNAME       = "XXXX";
                client.ADRESS          = adress;
                client.PHONE           = tell;
                client.ADDEDBY         = createBy;
                client.ADDDATE         = DateTime.Now;
                client.STATUS          = "Done";
                client.DEPT            = deptName;
                client.STAXCODE        = staxCode;
                client.ISPUBLIC        = "1";
                client.STARLIMSDEPT    = dept;
                client.ISDISCARD       = "N";
                client.DISPSTATUS      = "完成";
                client.INSTITUTIONNAME = "南京市产品质量监督检验院";
                _RasClientsDal.Add(client);
            }

            return(client);
        }
        /// <summary>
        /// 根据客户名称查询
        /// </summary>
        /// <param name="clientName"></param>
        /// <returns></returns>
        public JObject GetRaseClientsByName(string clientName)
        {
            try
            {
                clientName.NotAllowNullOrEmpty("客户名称");

                var client = _dal.GetRaseClientsByName(clientName);
                if (client != null)
                {
                    return(JObject.Parse(JsonConvert.SerializeObject(client)));
                }
                else
                {
                    return(null);
                }
            }
            catch (System.Exception ex)
            {
                SerilogServer.WriteErrorLog("GetRaseClientsByName", ex.Message, ex);
                throw ex;
            }
        }