示例#1
0
        public DrivingToEvaluate GetDrivingToEvaluate()
        {
            student = (Student)Session["Student"];
            ServiceSpeaker srsp = new ServiceSpeaker(ServiceSpeaker.ConstructionMode.fromFile, @"D:\SvmWcf.xml");
            Dictionary <string, string> spParams = new Dictionary <string, string>()
            {
                ["Param"] = student.Id.ToString()
            };
            string            dteinfo = srsp.Fetch("spSDGetDrivingToEvaluateByIdStudent", spParams);
            DrivingToEvaluate dte;

            if (dteinfo.Length > 0)
            {
                using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(dteinfo)))
                {
                    dte = (DrivingToEvaluate)(new XmlSerializer(typeof(DrivingToEvaluate)).Deserialize(ms));
                }
                WriteDTE(dte);
            }
            else
            {
                dte = null;
            }
            return(dte);
        }
示例#2
0
        public ActionResult SendRating(int mark, string comment)
        {
            Student                     st       = GetStudent();
            DrivingToEvaluate           dte      = (DrivingToEvaluate)Session["DrivingToEvaluate"];
            ServiceSpeaker              srsp     = new ServiceSpeaker(ServiceSpeaker.ConstructionMode.fromFile, @"D:\SvmWcf.xml");
            Dictionary <string, string> spParams = new Dictionary <string, string>()
            {
                ["IdDriving"]  = dte.Id.ToString(),
                ["IdCategory"] = "1",
                ["IdStudent"]  = st.Id.ToString(),
                ["Mark"]       = mark.ToString(),
                ["Comment"]    = comment
            };
            string Result = srsp.Fetch("spSDWriteDrivingRating", spParams);

            return(Message("Спасибо за оценку!"));
        }