Example #1
0
        /// <summary>
        /// 生成报价单
        /// </summary>
        /// <param name="lv"></param>
        public static void CreateQuotation(ListView lv)
        {
            sqlLlist.Clear();
            int projectID = Convert.ToInt32(lv.SelectedItems[0].Tag);

            try
            {
                string sql = "insert into SA_quotation(quotationNo,SN,projectID,year) " +
                             "values('" + FrmProjectDocumentBLL.CreateQuotationNo() + "'," +
                             BaseSQL.GetMaxID("SN", "SA_quotation", "year", DateTime.Now.Year) + "," +
                             projectID + "," + DateTime.Now.Year + ")";
                sqlLlist.Add(sql);

                sql = "update a set a.FolderType=3  from SA_Projects a where a.ProjectID=" + projectID;
                sqlLlist.Add(sql);

                BaseSQL.ExecuteSqlTran(sqlLlist);
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException("生成报价单错误。", ex);
            }
        }
Example #2
0
        /// <summary>
        /// 生成报价单
        /// </summary>
        /// <param name="lv"></param>
        public static void CreateQuotation(ListView lv)
        {
            sqlLlist.Clear();
            int projectID = Convert.ToInt32(lv.SelectedItems[0].Tag);

            try
            {
                string sql = "insert into SA_quotation(quotationNo,SN,projectID,year) " +
                             "values('" + FrmProjectDocumentBLL.CreateQuotationNo() + "'," +
                             BaseSQL.GetMaxID("SN", "SA_quotation", "year", DateTime.Now.Year) + "," +
                             projectID + "," + DateTime.Now.Year + ")";
                sqlLlist.Add(sql);

                sql = "update a set a.FolderType=3  from SA_Projects a where a.ProjectID=" + projectID;
                sqlLlist.Add(sql);

                BaseSQL.ExecuteSqlTran(sqlLlist);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, f.tsmiTs.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }