//public void UpdatePlanResult(string Id, float Ucpoint)
        //{
        //    //hmmmmmmmmmm...seem wrong...
        //    //var @planin = Plan.UpdatePlan(plan.Id, plan.Title, plan.Description, plan.UCPoint, plan.FPoint, plan.SEPoint, AbpSession.GetUserId());
        //    //await _planRepository.UpdateAsync(@planin);
        //    string connectionString = "Server=localhost; Database=SoftwareEstimationDb; Trusted_Connection=True;";
        //    //Create SQL conection to your database here
        //    using (SqlConnection conn = new SqlConnection(connectionString))
        //    {
        //        // Open your connection
        //        conn.Open();
        //        // Create the Command and Parameter objects.
        //        // Here change the columnames and table names as per you table
        //        using (SqlCommand cmd = new SqlCommand("UPDATE dbo.AppPlans SET [UCPoint]=@ucp WHERE [Id]=@planId", conn))
        //        {
        //            // Provide the query string with a parameter placeholder.
        //            //Change the control name as per your design
        //            cmd.Parameters.AddWithValue("@planId", Id);
        //            cmd.Parameters.AddWithValue("@ucp", Ucpoint);

        //            // Execute the Query
        //            cmd.ExecuteNonQuery();
        //        }
        //        conn.Close();
        //    }
        //}

        public async void SetUcp(UcpInput input)
        {
            var @ucp = UCPoint.SetValue(input.planID, input.uucp, input.tf, input.ef, input.ucpR, input.uucpR, input.tfR, input.efR, input.effort, input.time, input.staff);
            await _ucpRepository.InsertAsync(@ucp);

            setTotalEffort(input.effort, input.time, input.planID, 1);
        }
示例#2
0
        public static UCPoint SetValue(Guid planID, int[] uucp, int[] tf, int[] ef, float ucpR, float uucpR, float tfR, float efR, float effort, float time, int staff)
        {
            var @ucp = new UCPoint {
                PlanId = planID,
                u0     = uucp[0],
                u1     = uucp[1],
                u2     = uucp[2],
                u3     = uucp[3],
                u4     = uucp[4],
                u5     = uucp[5],


                t0  = tf[0],
                t1  = tf[1],
                t2  = tf[2],
                t3  = tf[3],
                t4  = tf[4],
                t5  = tf[5],
                t6  = tf[6],
                t7  = tf[7],
                t8  = tf[8],
                t9  = tf[9],
                t10 = tf[10],
                t11 = tf[11],
                t12 = tf[12],

                e0   = ef[0],
                e1   = ef[1],
                e2   = ef[2],
                e3   = ef[3],
                e4   = ef[4],
                e5   = ef[5],
                e6   = ef[6],
                e7   = ef[7],
                UCP  = ucpR,
                UUCP = uucpR,
                TF   = tfR,
                EF   = efR,

                Effort = effort,
                Time   = time,
                Staff  = staff
            };

            return(@ucp);
        }