Beispiel #1
0
        /// <summary>
        /// 部分修改保存
        /// </summary>
        /// <param name="model">对象clsUserUnit的一个实例参数</param>
        /// <returns></returns>
        public int UpdatePart(clsUserUnit model, out string errMsg)
        {
            errMsg = string.Empty;
            int rtn = 0;

            try
            {
                sb.Length = 0;
                sb.Append(" UPDATE tUserUnit SET ");
                sb.AppendFormat(" StdCode='{0}'", model.StdCode);
                sb.AppendFormat(",CompanyID='{0}'", model.CompanyID);
                sb.AppendFormat(",FullName='{0}'", model.FullName);
                sb.AppendFormat(",ShortName='{0}'", model.ShortName);
                sb.AppendFormat(",DisplayName='{0}'", model.DisplayName);
                sb.AppendFormat(",ShortCut='{0}'", model.ShortCut);
                sb.AppendFormat(",DistrictCode='{0}'", model.DistrictCode);
                sb.AppendFormat(",PostCode='{0}'", model.PostCode);
                sb.AppendFormat(",Address='{0}'", model.Address);
                sb.AppendFormat(",LinkMan='{0}'", model.LinkMan);
                sb.AppendFormat(",LinkInfo='{0}'", model.LinkInfo);
                sb.AppendFormat(",WWWInfo='{0}'", model.WWWInfo);
                sb.Append(",IsReadOnly=");
                sb.Append(model.IsReadOnly);

                sb.Append(",IsLock=");
                sb.Append(model.IsLock);

                sb.AppendFormat(",Remark='{0}'", model.Remark);
                sb.AppendFormat(" WHERE SysCode='{0}'", model.SysCode);

                DataBase.ExecuteCommand(sb.ToString(), out errMsg);
                sb.Length = 0;

                rtn = 1;
            }
            catch (Exception e)
            {
                //Log.WriteLog("更新clsUserUnit",e);
                errMsg = e.Message;
            }

            return(rtn);
        }
Beispiel #2
0
        /// <summary>
        /// 插入一条明细记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Insert(clsUserUnit model, out string errMsg)
        {
            errMsg = string.Empty;
            int rtn = 0;

            try
            {
                sb.Length = 0;
                sb.Append("INSERT INTO tUserUnit(SysCode,StdCode,FullName,ShortName,DisplayName,ShortCut,DistrictCode,PostCode,Address,LinkMan,LinkInfo,WWWInfo,IsReadOnly,IsLock,Remark,CompanyID)");
                sb.Append(" VALUES(");
                sb.AppendFormat("'{0}','{1}','{2}','{3}','{4}','{5}','{7}','{8}','{9}','{10}','{11}',{12},{13},'{14}','{15}'", model.SysCode, model.StdCode, model.FullName, model.ShortName, model.DisplayName, model.ShortCut, model.DistrictCode, model.PostCode, model.Address, model.LinkMan, model.LinkInfo, model.WWWInfo, model.IsReadOnly, model.IsLock, model.Remark, model.CompanyID);
                sb.Append(")");
                DataBase.ExecuteCommand(sb.ToString(), out errMsg);
                sb.Length = 0;

                rtn = 1;
            }
            catch (Exception e)
            {
                errMsg = e.Message;
            }

            return(rtn);
        }