/// <summary>
        /// 得到新增sql
        /// </summary>
        public string GetAddBillSQL(QuitStorageOrder QuitStorageOrder)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into QuitStorageOrder(");
            strSql.Append("QuitStorageOrderGuid,QuitStorageOrderID,QuitStorageOrderDate,Dept,InStorage,MaterialPerson,StoragePerson,QualityPerson,BatchNo,Remark,CreateGuid,CreateDate,CheckGuid,CheckDate");
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append("'" + QuitStorageOrder.QuitStorageOrderGuid + "',");
            strSql.Append("'" + QuitStorageOrder.QuitStorageOrderID + "',");
            strSql.Append("'" + QuitStorageOrder.QuitStorageOrderDate + "',");
            strSql.Append("'" + QuitStorageOrder.Dept + "',");
            strSql.Append("'" + QuitStorageOrder.InStorage + "',");
            strSql.Append("'" + QuitStorageOrder.MaterialPerson + "',");
            strSql.Append("'" + QuitStorageOrder.StoragePerson + "',");
            strSql.Append("'" + QuitStorageOrder.QualityPerson + "',");
            strSql.Append("'" + QuitStorageOrder.BatchNo + "',");
            strSql.Append("'" + QuitStorageOrder.Remark + "',");
            strSql.Append("'" + QuitStorageOrder.CreateGuid + "',");
            strSql.Append("'" + QuitStorageOrder.CreateDate + "',");
            strSql.Append("'" + QuitStorageOrder.CheckGuid + "',");
            if (QuitStorageOrder.CheckDate == DateTime.Parse("1900-01-01"))
            {
                strSql.Append("null");
            }
            else
            {
                strSql.Append("'" + QuitStorageOrder.CheckDate + "'");
            }
            strSql.Append(")");


            return(strSql.ToString());
        }
        ///<summary>
        /// 保存数据
        /// </summary>
        /// <param name="pObj">信息集实体类</param>
        /// <returns>返回保存成功(true)或失败(false)</returns>
        public void SaveBill(QuitStorageOrder QuitStorageOrder, List <QuitStorageOrderDetail> QuitStorageOrderDetail)
        {
            CommonInterface pComm = CommonFactory.CreateInstance(CommonData.sql);

            try
            {
                pComm.BeginTrans();

                //保存单据主表数据
                //先删除主表数据
                string strDeleteSql = "Delete from QuitStorageOrder where  QuitStorageOrderGuid='" + QuitStorageOrder.QuitStorageOrderGuid + "'";
                pComm.Execute(strDeleteSql);

                //插入主表数据
                string strInsertSql = GetAddBillSQL(QuitStorageOrder);
                pComm.Execute(strInsertSql);


                //删除明细表
                strDeleteSql = "Delete from QuitStorageOrderDetail where  QuitStorageOrderGuid='" + QuitStorageOrder.QuitStorageOrderGuid + "'";
                pComm.Execute(strDeleteSql);

                //插入明细表数据
                for (int i = 0; i < QuitStorageOrderDetail.Count; i++)
                {
                    strInsertSql = GetAddBillDetailSQL(QuitStorageOrderDetail[i]);
                    pComm.Execute(strInsertSql);
                }


                pComm.CommitTrans();
            }
            catch (Exception e)
            {
                pComm.RollbackTrans();
                pComm.Close();
                throw e;
            }
        }