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

            try
            {
                sb.Length = 0;
                sb.Append("UPDATE tProprietors SET ");
                sb.AppendFormat("Cdcode='{0}',", model.Cdcode);
                sb.AppendFormat("Cdbuslicence='{0}',", model.Cdbuslicence);
                sb.AppendFormat("CAllow='{0}',", model.CAllow);
                sb.AppendFormat("Ciid='{0}',", model.Ciid);
                sb.AppendFormat("Ciname='{0}',", model.Ciname);
                sb.AppendFormat("Cdname='{0}',", model.Cdname);
                sb.AppendFormat("Cdcardid='{0}',", model.Cdcardid);
                sb.AppendFormat("DisplayName='{0}',", model.DisplayName);
                sb.AppendFormat("Property='{0}',", model.Property);
                sb.AppendFormat("KindCode='{0}',", model.KindCode);
                sb.AppendFormat("RegCapital='{0}',", model.RegCapital);
                sb.AppendFormat("Unit='{0}',", model.Unit);
                sb.AppendFormat("Incorporator='{0}',", model.Incorporator);
                sb.AppendFormat("RegDate='{0}',", model.RegDate);
                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("CreditLevel='{0}',", model.CreditLevel);
                sb.AppendFormat("CreditRecord='{0}',", model.CreditRecord);
                sb.AppendFormat("ProductInfo='{0}',", model.ProductInfo);
                sb.AppendFormat("OtherInfo='{0}',", model.OtherInfo);
                sb.AppendFormat("CheckLevel='{0}',", model.CheckLevel);
                sb.AppendFormat("FoodSafeRecord='{0}',", model.FoodSafeRecord);
                sb.AppendFormat("IsLock='{0}',", model.IsLock);
                sb.AppendFormat("IsReadOnly='{0}',", model.IsReadOnly);
                sb.AppendFormat("Remark='{0}',", model.Remark);



                sb.AppendFormat("  WHERE Cdcode='{0}'", sOldCode);

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

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

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

            try
            {
                sb.Length = 0;
                sb.Append("INSERT INTO tProprietors");
                sb.Append(" (Cdcode,Cdbuslicence,CAllow,Ciid,Ciname,Cdname,Cdcardid,DisplayName,Property,KindCode,RegCapital,Unit,Incorporator,");
                if (model.RegDate != null)
                {
                    sb.Append("RegDate,");
                }
                sb.Append("DistrictCode,PostCode,Address,LinkMan,LinkInfo,CreditLevel,CreditRecord,ProductInfo,OtherInfo,CheckLevel,");
                sb.Append("FoodSafeRecord,IsLock,IsReadOnly,Remark) ");
                sb.Append(" VALUES(");
                sb.AppendFormat("'{0}',", model.Cdcode);
                sb.AppendFormat("'{0}',", model.Cdbuslicence);
                sb.AppendFormat("'{0}',", model.CAllow);
                sb.AppendFormat("'{0}',", model.Ciid);
                sb.AppendFormat("'{0}',", model.Ciname);
                sb.AppendFormat("'{0}',", model.Cdname);
                sb.AppendFormat("'{0}',", model.Cdcardid);
                sb.AppendFormat("'{0}',", model.DisplayName);
                sb.AppendFormat("'{0}',", model.Property);
                sb.AppendFormat("'{0}',", model.KindCode);
                sb.AppendFormat("'{0}',", model.RegCapital);
                sb.AppendFormat("'{0}',", model.Unit);
                sb.AppendFormat("'{0}',", model.Incorporator);
                if (model.RegDate != null)
                {
                    sb.AppendFormat("'{0}',", model.RegDate);
                }
                sb.AppendFormat("'{0}',", model.DistrictCode);
                sb.AppendFormat("'{0}',", model.PostCode);
                sb.AppendFormat("'{0}',", model.Address);
                sb.AppendFormat("'{0}',", model.LinkMan);
                sb.AppendFormat("'{0}',", model.LinkInfo);
                sb.AppendFormat("'{0}',", model.CreditLevel);
                sb.AppendFormat("'{0}',", model.CreditRecord);
                sb.AppendFormat("'{0}',", model.ProductInfo);
                sb.AppendFormat("'{0}',", model.OtherInfo);
                sb.AppendFormat("'{0}',", model.CheckLevel);
                sb.AppendFormat("'{0}',", model.FoodSafeRecord);
                sb.AppendFormat("{0},", model.IsLock);
                sb.AppendFormat("{0},", model.IsReadOnly);
                sb.AppendFormat("'{0}'", model.Remark);

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

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

            return(rtn);
        }