Пример #1
0
        /// <summary>
        /// 插入一条明细记录
        /// </summary>
        /// <param name="OprObject"></param>
        /// <returns></returns>
        public int Insert(clsStockRecord OprObject, out string sErrMsg)
        {
            sErrMsg = string.Empty;
            int rtn = 0;

            try
            {
                string insertSql = "insert into tStockRecord(SysCode,StdCode,CompanyID,CompanyName,DisplayName,InputDate,FoodID,FoodName,Model,InputNumber,OutputNumber,Unit,ProduceDate,ExpirationDate,ProduceCompanyID,ProduceCompanyName,PrivoderID,PrivoderName,LinkInfo,LinkMan,CertificateType1,CertificateType2,CertificateType3,CertificateType4,CertificateType5,CertificateType6,CertificateType7,CertificateType8,CertificateType9,CertificateInfo,MakeMan,Remark,DistrictCode)"
                                   + " values('"
                                   + OprObject.SysCode + "','"
                                   + OprObject.StdCode + "','"
                                   + OprObject.CompanyID + "','"
                                   + OprObject.CompanyName + "','"
                                   + OprObject.DisplayName + "','"
                                   + OprObject.InputDate + "','"
                                   + OprObject.FoodID + "','"
                                   + OprObject.FoodName + "','"
                                   + OprObject.Model + "',"
                                   + OprObject.InputNumber + ","
                                   + OprObject.OutputNumber + ",'"
                                   + OprObject.Unit + "','"
                                   + OprObject.ProduceDate + "','"
                                   + OprObject.ExpirationDate + "','"
                                   + OprObject.ProduceCompanyID + "','"
                                   + OprObject.ProduceCompanyName + "','"
                                   + OprObject.PrivoderID + "','"
                                   + OprObject.PrivoderName + "','"
                                   + OprObject.LinkInfo + "','"
                                   + OprObject.LinkMan + "','"
                                   + OprObject.CertificateType1 + "','"
                                   + OprObject.CertificateType2 + "','"
                                   + OprObject.CertificateType3 + "','"
                                   + OprObject.CertificateType4 + "','"
                                   + OprObject.CertificateType5 + "','"
                                   + OprObject.CertificateType6 + "','"
                                   + OprObject.CertificateType7 + "','"
                                   + OprObject.CertificateType8 + "','"
                                   + OprObject.CertificateType9 + "','"
                                   + OprObject.CertificateInfo + "','"
                                   + OprObject.MakeMan + "','"
                                   + OprObject.Remark + "','"
                                   + OprObject.DistrictCode + "')";
                DataBase.ExecuteCommand(insertSql, out sErrMsg);

                rtn = 1;
            }
            catch (Exception e)
            {
                //				Log.WriteLog("添加tSaleRecord",e);
                sErrMsg = e.Message;
            }

            return(rtn);
        }
Пример #2
0
        /// <summary>
        /// 部分修改保存
        /// </summary>
        /// <param name="OprObject">对象clsStockRecord的一个实例参数</param>
        /// <returns></returns>
        public int UpdatePart(clsStockRecord OprObject, string sOldCode, out string sErrMsg)
        {
            sErrMsg = string.Empty;
            int rtn = 0;

            try
            {
                string updateSql = "update tStockRecord set "
                                   + "StdCode='" + OprObject.StdCode + "',"
                                   + "CompanyID='" + OprObject.CompanyID + "',"
                                   + "CompanyName='" + OprObject.CompanyName + "',"
                                   + "DisplayName='" + OprObject.DisplayName + "',"
                                   + "InputDate='" + OprObject.InputDate + "',"
                                   + "FoodID='" + OprObject.FoodID + "',"
                                   + "FoodName='" + OprObject.FoodName + "',"
                                   + "Model='" + OprObject.Model + "',"
                                   + "InputNumber=" + OprObject.InputNumber + ","
                                   + "OutputNumber=" + OprObject.OutputNumber + ","
                                   + "Unit='" + OprObject.Unit + "',"
                                   + "ProduceDate='" + OprObject.ProduceDate + "',"
                                   + "ExpirationDate='" + OprObject.ExpirationDate + "',"
                                   + "ProduceCompanyID='" + OprObject.ProduceCompanyID + "',"
                                   + "ProduceCompanyName='" + OprObject.ProduceCompanyName + "',"
                                   + "PrivoderID='" + OprObject.PrivoderID + "',"
                                   + "PrivoderName='" + OprObject.PrivoderName + "',"
                                   + "LinkInfo='" + OprObject.LinkInfo + "',"
                                   + "LinkMan='" + OprObject.LinkMan + "',"
                                   + "CertificateType1='" + OprObject.CertificateType1 + "',"
                                   + "CertificateType2='" + OprObject.CertificateType2 + "',"
                                   + "CertificateType3='" + OprObject.CertificateType3 + "',"
                                   + "CertificateType4='" + OprObject.CertificateType4 + "',"
                                   + "CertificateType5='" + OprObject.CertificateType5 + "',"
                                   + "CertificateType6='" + OprObject.CertificateType6 + "',"
                                   + "CertificateType7='" + OprObject.CertificateType7 + "',"
                                   + "CertificateType8='" + OprObject.CertificateType8 + "',"
                                   + "CertificateType9='" + OprObject.CertificateType9 + "',"
                                   + "CertificateInfo='" + OprObject.CertificateInfo + "',"
                                   + "MakeMan='" + OprObject.MakeMan + "',"
                                   + "Remark='" + OprObject.Remark + "',"
                                   + "DistrictCode='" + OprObject.DistrictCode + "' "
                                   + " where SysCode='" + sOldCode + "' ";
                DataBase.ExecuteCommand(updateSql, out sErrMsg);

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

            return(rtn);
        }