Ejemplo n.º 1
0
        public ActionResult Edit(ProgressOrb _friend)
        {
            string endda    = _friend.tgl;
            string tglB     = endda.Substring(0, 2);
            string blnB     = endda.Substring(3, 2);
            string thnB     = endda.Substring(6, 4);
            string NewEndda = thnB + "/" + blnB + "/" + tglB;

            using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["PPIC"].ConnectionString))

            {
                string sqlQuery = "Update tProgressOrb Set progress = " + _friend.progress + ", tgl = \'" + NewEndda + "\'  Where id = " + _friend.id;

                int rowsAffected = db.Execute(sqlQuery);
            }

            //return RedirectToAction("Index");
            return(new EmptyResult());
        }
Ejemplo n.º 2
0
        public ActionResult Create(ProgressOrb _friend)
        {
            string endda    = _friend.tgl;
            string tglB     = endda.Substring(0, 2);
            string blnB     = endda.Substring(3, 2);
            string thnB     = endda.Substring(6, 4);
            string NewEndda = thnB + "/" + blnB + "/" + tglB;

            using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["PPIC"].ConnectionString))

            {
                string sqlQuery = "Insert Into tProgressOrb (iCustomerProductID, cInquiryCode, progress, tgl) Values(" + _friend.iCustomerProductID + ",\'" + _friend.cInquiryCode + "\'," + _friend.progress + ",\'" + NewEndda + "\')";

                int rowsAffected = db.Execute(sqlQuery);
            }

            //return RedirectToAction("Index");
            return(new EmptyResult());
        }