Beispiel #1
0
        public ActionResult GetBrands()
        {
            var results = EstimateData.GetBrands();

            var jsonResult = SerializeObjectToJson(results);

            return(jsonResult);
        }
Beispiel #2
0
        private void viewEstimateData(EstimateData estd)
        {
            plnd[idx] = new PlanningData();

            plnd[idx].Sales       = estd.Total;
            plnd[idx].EstimateID  = estd.EstimateID;
            plnd[idx].EstimateVer = estd.VersionNo;
        }
Beispiel #3
0
        public ActionResult GetEstimateById(int id)
        {
            var results = EstimateData.GetEstimateById(id);

            var jsonResult = SerializeObjectToJson(results);

            return(jsonResult);
        }
Beispiel #4
0
 public ActionResult SaveEstimate(EstimateBO estimateEntity)
 {
     if (estimateEntity.EST_ID != 0 && estimateEntity.EST_ID != null)
     {
         EstimateData.Update(estimateEntity);
         return(new HttpStatusCodeResult(201, "Update successful"));
     }
     else
     {
         EstimateData.Save(estimateEntity);
         return(new HttpStatusCodeResult(201, "Creation successful"));
     }
 }
Beispiel #5
0
        private void loadEstimateData()
        {
            BillingOp blo    = new BillingOp();
            string    wParam = "WHERE TaskEntryID = " + Convert.ToString(ted.TaskEntryID) + " ORDER BY VersionNo DESC";
            DataTable dt     = blo.UsingParamater_Select("D_Estimate", wParam);

            if (dt == null)
            {
                DMessage.SelectInvalid();
                return;
            }
            DataRow      dr   = dt.Rows[0];
            EstimateData estd = new EstimateData(dr);

            blo    = new BillingOp();
            wParam = " WHERE EstimateID = " + Convert.ToString(estd.EstimateID);
            dt     = blo.UsingParamater_Select("D_EstimateCont", wParam);
            if (dt == null)
            {
                DMessage.SelectInvalid();
                return;
            }

            edit_Labels();
            readyDgv(dt.Rows.Count);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dr = dt.Rows[i];
                dataGridView1.Rows[i].Cells["ItemCode"].Value   = Convert.ToString(dr["ItemCode"]);
                dataGridView1.Rows[i].Cells["Item"].Value       = Convert.ToString(dr["Item"]);
                dataGridView1.Rows[i].Cells["ItemDetail"].Value = Convert.ToString(dr["ItemDetail"]);
                dataGridView1.Rows[i].Cells["Unit"].Value       = Convert.ToString(dr["Unit"]);
                if (Convert.ToString(dr["Unit"]) != "")
                {
                    dataGridView1.Rows[i].Cells["CQuantity"].Value = decPointFormat(Convert.ToDecimal(dr["Quantity"]));
                    dataGridView1.Rows[i].Cells["CCost"].Value     = decFormat(Convert.ToDecimal(dr["Cost"]));
                    dataGridView1.Rows[i].Cells["CAmount"].Value   = decFormat(Convert.ToDecimal(dr["Cost"]) * Convert.ToDecimal(dr["Quantity"]));

                    dataGridView1.Rows[i].Cells["Quantity"].Value = dataGridView1.Rows[i].Cells["CQuantity"].Value;
                    dataGridView1.Rows[i].Cells["Amount"].Value   = dataGridView1.Rows[i].Cells["CAmount"].Value;
                }
            }

            reCalculateAll();
            return;
        }
Beispiel #6
0
        private string DisplayPopupName(EstimateData data, SetionType type)
        {
            string value = "";

            switch (type)
            {
            case SetionType.Region: value = data.DisplayName; break;

            case SetionType.Provice: value = data.DisplayName; break;

            case SetionType.Amphur: value = data.DisplayName; break;

            case SetionType.Tumbol: value = data.DisplayName; break;
            }

            return(value);
        }
Beispiel #7
0
        public EstimateDetailsTest()
        {
            //Arrange
            estimateData = new EstimateData();
            Mock <JKMServices.BLL.Interface.IResourceManagerFactory> mockBllJKMResource = new Mock <JKMServices.BLL.Interface.IResourceManagerFactory>();

            mockCRMCustomerDetails = new Mock <JKMServices.DAL.CRM.ICustomerDetails>();
            mockCRMEstimateDetails = new Mock <JKMServices.DAL.CRM.IEstimateDetails>();
            Mock <JKMServices.DAL.CRM.IMoveDetails>          mockCRMMoveDetails = new Mock <JKMServices.DAL.CRM.IMoveDetails>();
            Mock <JKMServices.BLL.EmailEngine.IEmailHandler> mockEmailEngine    = new Mock <JKMServices.BLL.EmailEngine.IEmailHandler>();
            Mock <Utility.Logger.ILogger>      mockLogger             = new Mock <Utility.Logger.ILogger>();
            Mock <Utility.ISharepointConsumer> mockSharepointConsumer = new Mock <Utility.ISharepointConsumer>();

            estimateDetails = new EstimateDetails(mockCRMCustomerDetails.Object,
                                                  mockCRMEstimateDetails.Object,
                                                  mockCRMMoveDetails.Object,
                                                  mockEmailEngine.Object,
                                                  mockLogger.Object,
                                                  mockBllJKMResource.Object,
                                                  mockSharepointConsumer.Object);
        }
Beispiel #8
0
        private bool loadEstimateData()
        {
            EstPlanOp epo   = new EstPlanOp();
            int       verNo = (String.IsNullOrEmpty(comboBoxEVersion.Text)) ? 0 : Convert.ToInt32(comboBoxEVersion.Text);
            DataTable dt    = epo.Estimate_Select(ted.TaskEntryID, verNo);

            if (dt == null)
            {
                return(false);
            }
            DataRow      dr   = dt.Rows[0];
            EstimateData estd = new EstimateData(dr);

            dt = epo.EstimateCont_Select(estd.EstimateID);
            if (dt == null)
            {
                return(false);
            }
            viewEstimateContToDgv(dt, dataGridView1);
            viewEstimateData(estd);

            viewPlanningContSummary();
            return(true);
        }
Beispiel #9
0
        public ActionResult DeleteEstimates(List <int> ids)
        {
            EstimateData.DeleteEstimates(ids);

            return(new HttpStatusCodeResult(200, "Deletion Successful"));
        }