Exemplo n.º 1
0
        public ActionResult DelData(List <bool> Check, List <int> ID, List <int> MemID, List <short> RowVersion, string PrimaryKeyName)
        {
            ShipmentService svCompany = new ShipmentService();

            svCompany.DelData <b2bCompanyCertify>(Check, ID, RowVersion, PrimaryKeyName);


            if (PrimaryKeyName == "CompCertifyID")
            {
                svCompany.DelData <b2bCompanyCertify>(Check, ID, RowVersion, PrimaryKeyName);
            }
            else if (PrimaryKeyName == "CompPaymentID")
            {
                svShipment.DelData <emShipmentProduct>(Check, ID, RowVersion, PrimaryKeyName);
            }
            else if (PrimaryKeyName == "ID")
            {
                svCompany.DelData <emShipmentProduct>(Check, ID, RowVersion, PrimaryKeyName);
            }
            else if (PrimaryKeyName == "JobID")
            {
                JobService svJob = new JobService();
                svJob.DelData <emJob>(Check, ID, RowVersion, PrimaryKeyName);
                svCompany.IsResult = svJob.IsResult;
            }
            else if (PrimaryKeyName == "ArticleID")
            {
                svCompany.DelData <b2bArticle>(Check, ID, RowVersion, PrimaryKeyName);
                if (svCompany.IsResult)
                {
                    ArticleService svArticle = new ArticleService();
                    svArticle.DeleteData <emArticle>(ID, RowVersion, PrimaryKeyName);
                    svCompany.IsResult = svArticle.IsResult;
                }
            }

            if (svCompany.IsResult)
            {
                return(Json(new { Result = true }));
            }
            else
            {
                return(Json(new { Result = false }));
            }
        }
 /*------------------------DeleteData-----------------------------*/
 #region DelData
 public ActionResult DelData(List <bool> Check, List <int> ArticleID, List <short> RowVersion, string PrimaryKeyName)
 {
     if (PrimaryKeyName == "ArticleID")
     {
         svArticle.DelData <b2bArticle>(Check, ArticleID, RowVersion, PrimaryKeyName);
         if (svArticle.IsResult)
         {
             svArticle.DeleteData <emArticle>(ArticleID, RowVersion, PrimaryKeyName);
             svArticle.IsResult = svArticle.IsResult;
         }
     }
     if (svArticle.IsResult)
     {
         return(Json(new { Result = true }));
     }
     else
     {
         return(Json(new { Result = false }));
     }
 }