Beispiel #1
0
        /// <summary>
        /// RemoveOtherDataInfo
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public dynamic RemoveOtherDataInfo(OtherDataItem info)
        {
            using (SqlConnection sqlCon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["CC_ProdConn"].ConnectionString))
            {
                sqlCon.Open();

                string     sql;
                SqlCommand reply;

                sql = "delete from other_clone where id = @id";

                reply = new SqlCommand(sql, sqlCon);
                reply.CommandTimeout = 60;

                reply.Parameters.AddWithValue("@id", info.id);

                try
                {
                    reply.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                }

                sqlCon.Close();
                sqlCon.Dispose();
                string userName;
                if (HttpContext.Current.Request.UrlReferrer.Host.Contains("localhost") && HttpContext.Current.Request.UrlReferrer.Port == 51268)
                {
                    userName = "******";// HttpContext.Current.User.Identity.Name;
                }
                else
                {
                    userName = HttpContext.Current.User.Identity.Name;
                }
                var guidelines = new GuidelinesLayer();
                try
                {
                    return(guidelines.GetGuidelines(0, null, info.xccId, userName));
                }
                catch (InvalidOperationException)
                {
                    return("Selected scorecard does not contain record with this ID");
                }
                catch (Exception)
                {
                    return(new GuidelineScorecardInfo());
                }
            }
        }
        public dynamic RemoveOtherDataInfo([FromBody] OtherDataItem info)
        {
            GuidelinesLayer guidelinesLayer = new GuidelinesLayer();

            return(guidelinesLayer.RemoveOtherDataInfo(info));
        }