コード例 #1
0
ファイル: FileUpload.cs プロジェクト: chirstmaxbox/MISSystem
        public static string GetFilePath(int estRevID, string folderPath)
        {
            var    est       = new MyEstRev(estRevID);
            var    p         = new SpecProjectDetail(est.Value.JobID);
            string jobNumber = p.JobNumber;

            folderPath += jobNumber + "\\";
            if ((!System.IO.Directory.Exists(folderPath)))
            {
                System.IO.Directory.CreateDirectory(folderPath);
            }
            return(folderPath);
        }
コード例 #2
0
        private int GetValidationErrorID()
        {
            //Quote To
            var est = new MyEstRev(_estRevID);
            var cp  = new ProjectCompany(_jobID);

            if (!cp.isThereAQuotetoCompany)
            {
                return((int)NValidationErrorValue.QuoteTo);
            }
            if (cp.QuoteToContactID < 1000)
            {
                return((int)NValidationErrorValue.QouteToContact);
            }
            if (!est.IsThisEstimationHaveChildren())
            {
                return((int)NValidationErrorValue.AtLeastOneItem);
            }
            if (!est.IsThisEstimationHasBenSubmited())
            {
                return(1102);                                       //Should be locked or have a reason
            }
            return(0);
        }
コード例 #3
0
        public void GenerateTitle()
        {
            //generate Quote Title

            var connectionSQL = new SqlConnection(SalesCenterConfiguration.ConnectionString);
            //Get Row Schema
            const string sqlSelectString = "SELECT * FROM Sales_JobMasterList_quoteRev WHERE (quoteRevID =0)";
            var          selectCommand   = new SqlCommand(sqlSelectString, connectionSQL);
            var          adapter1        = new SqlDataAdapter(selectCommand);

            var ds1 = new DataSet();

            ds1.Tables.Clear();

            try
            {
                connectionSQL.Open();
                adapter1.Fill(ds1, "t1");

                DataRow row = ds1.Tables["t1"].NewRow();

                var pcv = new ProjectChildrenVersion(_jobID);
                row["quoteRev"]    = pcv.NewestQuoteRev;
                row["quoteOption"] = 0;
                row["quoteAmount"] = 0;

                row["quoteStatus"] = NJobStatus.qProcessing;
                row["estRevID"]    = _estRevID;

                row["isssueDate"] = DateTime.Today;

                var cst = new CustomerDetails(_cID);
                row["termBalance"] = cst.TermID;
                row["Currency"]    = cst.Currency;
                row["termDeposit"] = cst.TermDeposit;

                row["jobID"]          = _jobID;
                row["quoteGST"]       = true;
                row["quotePST"]       = false;
                row["quoteLocked"]    = false;
                row["isItemCopied"]   = false;
                row["PrintOption"]    = 1;
                row["DiscountText"]   = "Discount";
                row["DiscountAmount"] = 0;

                var est = new MyEstRev(_estRevID);
                row["sa1ID"] = est.Value.sa1ID;

                //Add this into dataset
                ds1.Tables["t1"].Rows.Add(row);

                var cb = new SqlCommandBuilder(adapter1);
                adapter1 = cb.DataAdapter;
                adapter1.Update(ds1, "t1");
            }
            catch (SqlException ex)
            {
                string result = ex.Message;
            }
            finally
            {
                connectionSQL.Close();
            }
        }