コード例 #1
0
        public ActionResult DeleteBuylead(List <int> BuyleadID, List <int> CateLV1, List <int> CateLV2, List <int> CateLV3)
        {
            var svBuylead = new BuyleadService();

            try
            {
                svBuylead.Delete(BuyleadID, CateLV1, CateLV2, CateLV3, LogonCompID);
            }
            catch (Exception ex)
            {
                svBuylead.MsgError.Add(ex);
                CreateLogFiles(ex);
            }
            return(Json(new { IsResult = svBuylead.IsResult, MsgError = GenerateMsgError(svBuylead.MsgError) }));
        }
コード例 #2
0
        public ActionResult Delete(List <int> ID, List <int> CateLV1, List <int> CateLV2, List <int> CateLV3, List <int> CompID)
        {
            var svBuylead = new BuyleadService();
            var svCompany = new CompanyService();
            var compid    = CompID;
            var products  = svBuylead.SelectData <b2bBuylead>("BuyleadID,CompID", svBuylead.SQLWhereListInt(ID, "BuyleadID"));

            try
            {
                foreach (var item in products)
                {
                    svBuylead.Delete(ID, CateLV1, CateLV2, CateLV3, (int)item.CompID);
                    var imgManager = new FileHelper();
                    svCompany.UpdateBuyleadCount((int)item.CompID);
                    imgManager.DeleteFilesInDir("Buylead/" + item.CompID + "/" + item.BuyleadID);
                }
            }
            catch (Exception ex)
            {
                svBuylead.MsgError.Add(ex);
                CreateLogFiles(ex);
            }
            return(Json(new { IsResult = svBuylead.IsResult, MsgError = GenerateMsgError(svBuylead.MsgError) }));
        }